|
|
|
@ -663,10 +663,14 @@ public class AppMaster {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonFrp = new JSONObject(frp);
|
|
|
|
|
String server = jsonFrp.optString("server_addr");
|
|
|
|
|
int port = jsonFrp.optInt("server_port", 7000);
|
|
|
|
|
|
|
|
|
|
mService.logger.info("Starting Frp Server " + server + ":" + Integer.toString(port));
|
|
|
|
|
|
|
|
|
|
Context context = mService.getApplicationContext();
|
|
|
|
|
Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.xypower.frpandroid");
|
|
|
|
|
if (intent != null) {
|
|
|
|
@ -682,7 +686,18 @@ public class AppMaster {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void stopFrp(JSONObject jsonObject) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
mService.logger.info("Stopping Frp Server");
|
|
|
|
|
Context context = mService.getApplicationContext();
|
|
|
|
|
Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.xypower.frpandroid");
|
|
|
|
|
if (intent != null) {
|
|
|
|
|
intent.putExtra("autoClose", 1);
|
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
|
context.startActivity(intent);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void importPublicKey(JSONObject jsonObject) {
|
|
|
|
|