|
|
@ -11,6 +11,7 @@ import android.content.SharedPreferences;
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
import android.content.res.AssetManager;
|
|
|
|
import android.content.res.AssetManager;
|
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.content.res.Resources;
|
|
|
|
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.IBinder;
|
|
|
|
import android.os.IBinder;
|
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
@ -45,6 +46,8 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
private ShellService mService;
|
|
|
|
private ShellService mService;
|
|
|
|
private boolean mBound;
|
|
|
|
private boolean mBound;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Handler mHandler;
|
|
|
|
|
|
|
|
|
|
|
|
private String mServer = "61.169.135.146";
|
|
|
|
private String mServer = "61.169.135.146";
|
|
|
|
private int mPort = 7000;
|
|
|
|
private int mPort = 7000;
|
|
|
|
|
|
|
|
|
|
|
@ -70,6 +73,8 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.activity_main);
|
|
|
|
setContentView(R.layout.activity_main);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mHandler = new Handler();
|
|
|
|
|
|
|
|
|
|
|
|
String versionName = null;
|
|
|
|
String versionName = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
versionName = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
|
|
|
|
versionName = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
|
|
|
@ -133,6 +138,17 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
if (startFrp != 0) {
|
|
|
|
if (startFrp != 0) {
|
|
|
|
Log.i(TAG, "Will start server");
|
|
|
|
Log.i(TAG, "Will start server");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int autoClose = intent.getIntExtra("autoClose", 0);
|
|
|
|
|
|
|
|
if (autoClose != 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mHandler.postDelayed(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
MainActivity.this.finish();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
state_switch.setChecked(mBound || (startFrp != 0));
|
|
|
|
state_switch.setChecked(mBound || (startFrp != 0));
|
|
|
|