|
|
@ -27,6 +27,7 @@ import com.xypower.common.ZipUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import org.json.JSONArray;
|
|
|
|
import org.json.JSONArray;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
import org.w3c.dom.Text;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
import java.io.BufferedWriter;
|
|
|
@ -652,10 +653,23 @@ public class AppMaster {
|
|
|
|
private void startFrp(JSONObject jsonObject) {
|
|
|
|
private void startFrp(JSONObject jsonObject) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// SysApi.forceStopApp(context, packageName);
|
|
|
|
// SysApi.forceStopApp(context, packageName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String frp = jsonObject.optString("frpc", null);
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(frp)) {
|
|
|
|
|
|
|
|
mService.logger.warning("Empty frpc node");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonFrp = new JSONObject(frp);
|
|
|
|
|
|
|
|
String server = jsonFrp.optString("server_addr");
|
|
|
|
|
|
|
|
int port = jsonFrp.optInt("server_port", 7000);
|
|
|
|
|
|
|
|
|
|
|
|
Context context = mService.getApplicationContext();
|
|
|
|
Context context = mService.getApplicationContext();
|
|
|
|
Intent intent = context.getPackageManager().getLaunchIntentForPackage("io.github.acedroidx.frp");
|
|
|
|
Intent intent = context.getPackageManager().getLaunchIntentForPackage("io.github.acedroidx.frp");
|
|
|
|
if (intent != null) {
|
|
|
|
if (intent != null) {
|
|
|
|
intent.putExtra("startFrp", 1);
|
|
|
|
intent.putExtra("startFrp", 1);
|
|
|
|
|
|
|
|
intent.putExtra("server", server);
|
|
|
|
|
|
|
|
intent.putExtra("port", port);
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
context.startActivity(intent);
|
|
|
|
context.startActivity(intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|