Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. public void imei1() {
  2. try {
  3. Process process = Runtime.getRuntime().exec("su"); //Generic SU Command
  4. DataOutputStream os = new DataOutputStream(process.getOutputStream());
  5.  
  6.  
  7. os.writeBytes("echo 'AT+EGMR=1,7," + "\"" + imei1.getText() + "\"" + "' >/dev/radio/pttycmd1");
  8.  
  9. os.close();
  10. Toast toast = Toast.makeText(getApplicationContext(),
  11. "IMEI1 изменен на " + imei1.getText(), Toast.LENGTH_SHORT);
  12. toast.show();
  13. try {
  14. process.waitFor();
  15. } catch (InterruptedException e) {
  16. // TODO Auto-generated catch block
  17. e.printStackTrace();
  18. }
  19.  
  20.  
  21. } catch (FileNotFoundException e) {
  22. e.printStackTrace();
  23. } catch (IOException e) {
  24. e.printStackTrace();
  25. }
  26.  
  27.  
  28. }
  29. public void imei2() {
  30. try {
  31. Process process = Runtime.getRuntime().exec("su"); //Generic SU Command
  32. DataOutputStream os = new DataOutputStream(process.getOutputStream());
  33.  
  34.  
  35. os.writeBytes("echo 'AT+EGMR=1,10," + "\"" + imei2.getText() + "\"" + "' >/dev/radio/pttycmd1");
  36.  
  37. os.close();
  38. Toast toast = Toast.makeText(getApplicationContext(),
  39. "IMEI2 изменен на " + imei2.getText(), Toast.LENGTH_SHORT);
  40. toast.show();
  41. try {
  42. process.waitFor();
  43. } catch (InterruptedException e) {
  44. // TODO Auto-generated catch block
  45. e.printStackTrace();
  46. }
  47.  
  48.  
  49. } catch (FileNotFoundException e) {
  50. e.printStackTrace();
  51. } catch (IOException e) {
  52. e.printStackTrace();
  53. }
  54.  
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement