diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 11940cd..c8b6336 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -4,7 +4,6 @@
-
diff --git a/app/src/main/java/mobi/acpm/inspeckage/ui/MainActivity.java b/app/src/main/java/mobi/acpm/inspeckage/ui/MainActivity.java
index 4b304df..d53ebed 100644
--- a/app/src/main/java/mobi/acpm/inspeckage/ui/MainActivity.java
+++ b/app/src/main/java/mobi/acpm/inspeckage/ui/MainActivity.java
@@ -60,7 +60,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
boolean granted = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
if (!granted) {
- requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_PHONE_STATE}, 0);
+ requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
}
}else{
File inspeckage = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + Config.P_ROOT);
diff --git a/app/src/main/java/mobi/acpm/inspeckage/util/Config.java b/app/src/main/java/mobi/acpm/inspeckage/util/Config.java
index 0bc45c6..b830fa7 100644
--- a/app/src/main/java/mobi/acpm/inspeckage/util/Config.java
+++ b/app/src/main/java/mobi/acpm/inspeckage/util/Config.java
@@ -98,4 +98,6 @@ public class Config {
public static final String SP_USER_PASS = "login_pass";
public static final String SP_SWITCH_AUTH = "switch_auth";
+
+ public static final String KEYPAIR_ALIAS = "alias";
}
diff --git a/app/src/main/java/mobi/acpm/inspeckage/webserver/WebServer.java b/app/src/main/java/mobi/acpm/inspeckage/webserver/WebServer.java
index fbd3613..9c6ae29 100644
--- a/app/src/main/java/mobi/acpm/inspeckage/webserver/WebServer.java
+++ b/app/src/main/java/mobi/acpm/inspeckage/webserver/WebServer.java
@@ -11,7 +11,6 @@
import android.security.KeyPairGeneratorSpec;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
-import android.telephony.TelephonyManager;
import android.text.Html;
import android.util.Log;
@@ -38,6 +37,7 @@
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import javax.net.ssl.KeyManagerFactory;
import javax.security.auth.x500.X500Principal;
@@ -100,9 +100,14 @@ public WebServer(String host, int port, Context context) throws IOException {
keyAliases.add(aliases.nextElement());
}
- //use device id as an alias, that way each installation has your own alias
- TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
- String alias = telephonyManager.getDeviceId() + "";
+ //use uuid as an alias, that way each installation has your own alias
+ if(mPrefs.getString(Config.KEYPAIR_ALIAS,"").equals("")) {
+ SharedPreferences.Editor edit = mPrefs.edit();
+ edit.putString(Config.KEYPAIR_ALIAS, UUID.randomUUID().toString());
+ edit.apply();
+ }
+
+ String alias = mPrefs.getString(Config.KEYPAIR_ALIAS,"");
boolean genNewKey = true;
for (String key : keyAliases) {
@@ -1816,5 +1821,4 @@ public String hooksContent(String type, int count) {
public static boolean isModuleEnabled() {
return false;
}
-
}
\ No newline at end of file