|
@@ -19,10 +19,12 @@ import com.common.pos.api.util.ShellUtils;
|
|
|
import com.telpo.faceSuZhouPark.R;
|
|
|
import com.telpo.faceSuZhouPark.utile.Config;
|
|
|
import com.telpo.faceSuZhouPark.utile.FaceScenicUtile;
|
|
|
+import com.telpo.faceSuZhouPark.utile.loacat.AppLogUtils;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.DataOutputStream;
|
|
|
import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
import java.io.InputStreamReader;
|
|
|
import java.util.Timer;
|
|
|
import java.util.TimerTask;
|
|
@@ -173,11 +175,18 @@ public class PassWordActivity extends BaseActivity {
|
|
|
public void onClick(View v) {
|
|
|
popupWindow.dismiss();
|
|
|
if (Type.equals("reboot")){
|
|
|
- Intent intent = new Intent(Intent.ACTION_REBOOT);
|
|
|
- intent.putExtra("nowait",1);
|
|
|
- intent.putExtra("interval",1);
|
|
|
- intent.putExtra("window",0);
|
|
|
- sendBroadcast(intent);
|
|
|
+// Intent intent = null;
|
|
|
+// intent = new Intent(Intent.ACTION_REBOOT);
|
|
|
+// intent.putExtra("nowait",1);
|
|
|
+// intent.putExtra("interval",1);
|
|
|
+// intent.putExtra("window",0);
|
|
|
+// sendBroadcast(intent);
|
|
|
+ exec("reboot");
|
|
|
+// try {
|
|
|
+// ShellUtils.execCommand("reboot", true);
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
}else {//退出应用
|
|
|
Config.mSessionId="";
|
|
|
finish();
|
|
@@ -188,13 +197,12 @@ public class PassWordActivity extends BaseActivity {
|
|
|
});
|
|
|
}
|
|
|
private String exec(String command) {
|
|
|
-
|
|
|
Process process = null;
|
|
|
BufferedReader reader = null;
|
|
|
InputStreamReader is = null;
|
|
|
DataOutputStream os = null;
|
|
|
-
|
|
|
try {
|
|
|
+ //"/system/bin/sh"
|
|
|
process = Runtime.getRuntime().exec("su");
|
|
|
is = new InputStreamReader(process.getInputStream());
|
|
|
reader = new BufferedReader(is);
|