Commit 0ac91645 authored by jonasled's avatar jonasled

Merge branch 'develop'

parents a5c451d2 cb152694
......@@ -9,7 +9,7 @@ android {
applicationId "de.jonasled.proxdroid"
minSdkVersion 23
targetSdkVersion 29
versionCode Integer.valueOf(System.env.VERSION_CODE ?: 10)
versionCode Integer.valueOf(System.env.VERSION_CODE ?: 11)
versionName "1.12.0-${System.env.VERSION_SHA}"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
......
......@@ -51,27 +51,30 @@ public class startActivity extends AppCompatActivity implements IAuthenticateLis
editor = mPreferences.edit();
if(runcode == 0){
SecretKey key = null;
try {
key = KeyGenerator.getInstance("AES").generateKey();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
editor.putBoolean("fingerprintEnabled", false);
try {
SecretKey key = KeyGenerator.getInstance("AES").generateKey();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
savePassword(Base64.getEncoder().encodeToString(key.getEncoded()));
} else {
savePassword(android.util.Base64.encodeToString(key.getEncoded(), android.util.Base64.DEFAULT));
}
} catch (Exception e) {
System.out.println("Can't setup fingerprint.");
e.printStackTrace();
editor.putBoolean("fingerprintEnabled",false);
}
if(!mPreferences.getBoolean("fingerprintEnabled", false)){
try {
SecretKey key = KeyGenerator.getInstance("AES").generateKey();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
editor.putString("decryptKey", Base64.getEncoder().encodeToString(key.getEncoded()));
} else {
editor.putString("decryptKey", android.util.Base64.encodeToString(key.getEncoded(), android.util.Base64.DEFAULT));
}
} catch (NoSuchAlgorithmException e) {e.printStackTrace();}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
editor.putString("decryptKey", Base64.getEncoder().encodeToString(key.getEncoded()));
} else {
editor.putString("decryptKey", android.util.Base64.encodeToString(key.getEncoded(), android.util.Base64.DEFAULT));
}
}
editor.apply();
......@@ -82,6 +85,17 @@ public class startActivity extends AppCompatActivity implements IAuthenticateLis
System.out.println("running app update");
de.jonasled.proxdroid.DBHelper mydb = new de.jonasled.proxdroid.DBHelper(this);
mydb.appUpdate();
if(!mPreferences.getBoolean("fingerprintEnabled", false)){
String decryptPassword = mPreferences.getString("decryptKey", null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
decryptToken = new SecretKeySpec(Base64.getDecoder().decode(decryptPassword), "AES");
savePassword(Base64.getEncoder().encodeToString(decryptToken.getEncoded()));
} else {
decryptToken = new SecretKeySpec(android.util.Base64.decode(decryptPassword, android.util.Base64.DEFAULT), "AES");
savePassword(android.util.Base64.encodeToString(decryptToken.getEncoded(), android.util.Base64.DEFAULT));
}
}
}
if(!mPreferences.getBoolean("fingerprintEnabled", false)){
......
New Features:
* Now we use https and port 8006 as default for new server
* In the datastore control you can now search for files
\ No newline at end of file
* In the datastore control you can now search for files
Bugfix:
* You keep your settings after enabling / disabling the fingerprint
\ No newline at end of file
......@@ -140,4 +140,14 @@
<string name="tasks">任务</string>
<string name="log">日志</string>
<string name="aptUpdate">Apt 更新</string>
<string name="showOpaque">下载 Opaque</string>
<string name="spiceClientRequired">为了让这个功能正常工作,你需要一个支持SPICE的类似Opaque的外部应用程序.如果你不想买这个应用,你可以用Google Play Store描述中的GitHub链接自己编译.</string>
<string name="selectConsole">选择一个控制台</string>
<string name="spice">SPICE</string>
<string name="secret">秘钥</string>
<string name="tokenID">令牌 ID</string>
<string name="apiToken">API 令牌 (无控制台)</string>
<string name="account">用户账户</string>
<string name="loginType">登录类型</string>
<string name="reboot">重启</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment