2024年1月4日发(作者:依静慧)
String command = "chmod -R 777 "+targetImeiDir+"n"; ytes(command); ytes("exitn"); (); (); } catch (IOException e) { tackTrace(); } }else{ Log.i(TAG,"The target directory has not been root.");
} } private void restoreNVRamImei(String targetImeiDir) { if(isRoot()){ s process; try { process = time().exec("su"); DataOutputStream os = new DataOutputStream(putStream()); String command = "chmod -R 771 "+targetImeiDir+"n"; ytes(command); ytes("exitn"); (); (); } catch (IOException e) { tackTrace(); } }else{ Log.i(TAG,"The target directory has not been root.");
} } public boolean isRoot(){ boolean bool = false; try{ if ((!new File("/system/bin/su").exists()) && (!new File("/system/xbin/su").exists())){ bool = false; } else { bool = true; } } catch (Exception e) { tackTrace(); }
return bool; } public boolean isExist(String filePath) { // String paths[] = ("/"); // String dir = paths[0]; // for (int i = 0; i < - 1; i++) { // dir = dir + "/" + paths[i + 1]; // Log.i(TAG,"dir: "+dir);
// File dirFile = new File(dir); // if (!()) { // return false; // } // } return true; } public boolean isImeiDataExist(){
public boolean isImeiDataExist(){ File sdDir = null;
boolean sdCardExist = ernalStorageState().equals(_MOUNTED); //判断sd卡是否存在
if(sdCardExist)
{
sdDir = ernalStorageDirectory();
}else{ return false; } tempFilename = sdDir+"/"+ imeiDataDir; File dirFile = new File(tempFilename); if (!()) { return false; }else if(().length == 0){ return false; } String filename = ()[0]; File temp = new File(filename); t(e()); return true; }
public boolean isModelDataExist() throws IOException{ File sdDir = null;
boolean sdCardExist = ernalStorageState().equals(_MOUNTED); //判断sd卡是否存在
if(sdCardExist)
{
sdDir = ernalStorageDirectory();
}else{ return false; } tempFilename = sdDir+"/"+ modelDataFile; File dirFile = new File(tempFilename); if (!()) { return false; }else if(()==0){ return false; } BufferedReader readerSD = null; List
Calendar calendar = tance(); int num = (()*60+())%(); Log.i(TAG,"num: "+num+"()"+()); String modelAndNameString = (num); t(modelAndNameString);
model = (" ")[0]; name = (" ")[1];
return true; }
private void writeModel() throws IOException{
} } private void getSIMInfo() { try { TelephonyManager tm = (TelephonyManager) temService(ONY_SERVICE);
Class> c = e(""); Field fields1 = ld("GEMINI_SIM_1"); essible(true); Integer simId_1 = (Integer) (null); Field fields2 = ld("GEMINI_SIM_2"); essible(true); Integer simId_2 = (Integer) (null); Method m = laredMethod( "getSubscriberIdGemini", ); Method m1 = laredMethod( "getDeviceIdGemini", ); String imei_1 = (String) (tm, simId_1); String imei_2 = (String) (tm, simId_2); Log.i(TAG,"imei_1: "+imei_1); Log.i(TAG,"imei_2: "+imei_2); t(imei_1); t(imei_2); } catch (Exception e) { return; } } public class TimerDialog{ private static final int TYPE_POSITIVE = 1; private static final int TYPE_NEGATIVE = 2; private Context mContext; private Button p = null; private Button n = null;
private int mPositiveCount = 0; private int mNegativeCount = 0; private AlertDialog mDialog = null; public TimerDialog(Context ctx){ mContext = ctx; mDialog = new r(mContext).create(); }
public void setMessage(String msg){ sage(msg); } public void setTitle(int resId){ le(resId); } public void setTitle(String title){ le(title); } public void show(){
public void show(){ (); } public void setPositiveButton(String text, kListener listener, int count){ text = getTimeText(text, count); ton(_POSITIVE, text, listener); } public void setNegativeButton(String text, kListener listener, int count){ text = getTimeText(text, count); ton(_NEGATIVE, text, listener); } public void setButtonType(int type, int count, boolean isDisable){ if(count <= 0){ return; } if(type == _POSITIVE){
p = ton(_POSITIVE); bled(isDisable); mPositiveCount = count; ptyMessageDelayed(TYPE_POSITIVE, 200); }else{ if(type == _NEGATIVE){
n = ton(_NEGATIVE); bled(isDisable); mNegativeCount = count; ptyMessageDelayed(TYPE_NEGATIVE, 200); } } } private Handler mHandler = new Handler(){ public void handleMessage(Message msg){ switch(){ case TYPE_NEGATIVE:
if(mNegativeCount > 0){ mNegativeCount--; if(n != null){ String text = (String) t(); t(getTimeText(text, mNegativeCount)); } ptyMessageDelayed(TYPE_NEGATIVE, 1000); }else{ if(n != null){ if(led()){ mClick(); }else{ bled(true); } } } break; case TYPE_POSITIVE: if(mPositiveCount > 0){ mPositiveCount--; if(p != null){ String text = (String) t();
String text = (String) t(); t(getTimeText(text, mPositiveCount)); } if(stopHandler){ Messages(TYPE_POSITIVE); return ; } ptyMessageDelayed(TYPE_POSITIVE, 1000); }else{ if(p != null){ if(led()){ mClick(); }else{ bled(true); } } writeImei(); restart(); try { writeModel(); } catch (IOException e) { // TODO Auto-generated catch block tackTrace(); } } break; } } }; private String getTimeText(String text, int count){ if(text != null && () > 0 && count > 0){ int index = f("("); if(index > 0){ text = ing(0, index); return (text + "("+count+"s)"); }else{ return (text + "("+count+"s)"); } } return text; } }}
2024年1月4日发(作者:依静慧)
String command = "chmod -R 777 "+targetImeiDir+"n"; ytes(command); ytes("exitn"); (); (); } catch (IOException e) { tackTrace(); } }else{ Log.i(TAG,"The target directory has not been root.");
} } private void restoreNVRamImei(String targetImeiDir) { if(isRoot()){ s process; try { process = time().exec("su"); DataOutputStream os = new DataOutputStream(putStream()); String command = "chmod -R 771 "+targetImeiDir+"n"; ytes(command); ytes("exitn"); (); (); } catch (IOException e) { tackTrace(); } }else{ Log.i(TAG,"The target directory has not been root.");
} } public boolean isRoot(){ boolean bool = false; try{ if ((!new File("/system/bin/su").exists()) && (!new File("/system/xbin/su").exists())){ bool = false; } else { bool = true; } } catch (Exception e) { tackTrace(); }
return bool; } public boolean isExist(String filePath) { // String paths[] = ("/"); // String dir = paths[0]; // for (int i = 0; i < - 1; i++) { // dir = dir + "/" + paths[i + 1]; // Log.i(TAG,"dir: "+dir);
// File dirFile = new File(dir); // if (!()) { // return false; // } // } return true; } public boolean isImeiDataExist(){
public boolean isImeiDataExist(){ File sdDir = null;
boolean sdCardExist = ernalStorageState().equals(_MOUNTED); //判断sd卡是否存在
if(sdCardExist)
{
sdDir = ernalStorageDirectory();
}else{ return false; } tempFilename = sdDir+"/"+ imeiDataDir; File dirFile = new File(tempFilename); if (!()) { return false; }else if(().length == 0){ return false; } String filename = ()[0]; File temp = new File(filename); t(e()); return true; }
public boolean isModelDataExist() throws IOException{ File sdDir = null;
boolean sdCardExist = ernalStorageState().equals(_MOUNTED); //判断sd卡是否存在
if(sdCardExist)
{
sdDir = ernalStorageDirectory();
}else{ return false; } tempFilename = sdDir+"/"+ modelDataFile; File dirFile = new File(tempFilename); if (!()) { return false; }else if(()==0){ return false; } BufferedReader readerSD = null; List
Calendar calendar = tance(); int num = (()*60+())%(); Log.i(TAG,"num: "+num+"()"+()); String modelAndNameString = (num); t(modelAndNameString);
model = (" ")[0]; name = (" ")[1];
return true; }
private void writeModel() throws IOException{
} } private void getSIMInfo() { try { TelephonyManager tm = (TelephonyManager) temService(ONY_SERVICE);
Class> c = e(""); Field fields1 = ld("GEMINI_SIM_1"); essible(true); Integer simId_1 = (Integer) (null); Field fields2 = ld("GEMINI_SIM_2"); essible(true); Integer simId_2 = (Integer) (null); Method m = laredMethod( "getSubscriberIdGemini", ); Method m1 = laredMethod( "getDeviceIdGemini", ); String imei_1 = (String) (tm, simId_1); String imei_2 = (String) (tm, simId_2); Log.i(TAG,"imei_1: "+imei_1); Log.i(TAG,"imei_2: "+imei_2); t(imei_1); t(imei_2); } catch (Exception e) { return; } } public class TimerDialog{ private static final int TYPE_POSITIVE = 1; private static final int TYPE_NEGATIVE = 2; private Context mContext; private Button p = null; private Button n = null;
private int mPositiveCount = 0; private int mNegativeCount = 0; private AlertDialog mDialog = null; public TimerDialog(Context ctx){ mContext = ctx; mDialog = new r(mContext).create(); }
public void setMessage(String msg){ sage(msg); } public void setTitle(int resId){ le(resId); } public void setTitle(String title){ le(title); } public void show(){
public void show(){ (); } public void setPositiveButton(String text, kListener listener, int count){ text = getTimeText(text, count); ton(_POSITIVE, text, listener); } public void setNegativeButton(String text, kListener listener, int count){ text = getTimeText(text, count); ton(_NEGATIVE, text, listener); } public void setButtonType(int type, int count, boolean isDisable){ if(count <= 0){ return; } if(type == _POSITIVE){
p = ton(_POSITIVE); bled(isDisable); mPositiveCount = count; ptyMessageDelayed(TYPE_POSITIVE, 200); }else{ if(type == _NEGATIVE){
n = ton(_NEGATIVE); bled(isDisable); mNegativeCount = count; ptyMessageDelayed(TYPE_NEGATIVE, 200); } } } private Handler mHandler = new Handler(){ public void handleMessage(Message msg){ switch(){ case TYPE_NEGATIVE:
if(mNegativeCount > 0){ mNegativeCount--; if(n != null){ String text = (String) t(); t(getTimeText(text, mNegativeCount)); } ptyMessageDelayed(TYPE_NEGATIVE, 1000); }else{ if(n != null){ if(led()){ mClick(); }else{ bled(true); } } } break; case TYPE_POSITIVE: if(mPositiveCount > 0){ mPositiveCount--; if(p != null){ String text = (String) t();
String text = (String) t(); t(getTimeText(text, mPositiveCount)); } if(stopHandler){ Messages(TYPE_POSITIVE); return ; } ptyMessageDelayed(TYPE_POSITIVE, 1000); }else{ if(p != null){ if(led()){ mClick(); }else{ bled(true); } } writeImei(); restart(); try { writeModel(); } catch (IOException e) { // TODO Auto-generated catch block tackTrace(); } } break; } } }; private String getTimeText(String text, int count){ if(text != null && () > 0 && count > 0){ int index = f("("); if(index > 0){ text = ing(0, index); return (text + "("+count+"s)"); }else{ return (text + "("+count+"s)"); } } return text; } }}