mirror of https://github.com/m2049r/xmrwallet.git
fix permissions Q needs to read our old wallet files (#744)
This commit is contained in:
parent
21f44380b1
commit
99681e1bbb
|
@ -3,6 +3,7 @@
|
||||||
package="com.m2049r.xmrwallet">
|
package="com.m2049r.xmrwallet">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
|
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:requestLegacyExternalStorage="true"
|
android:preserveLegacyExternalStorage="true"
|
||||||
android:name=".XmrWalletApplication"
|
android:name=".XmrWalletApplication"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class LegacyStorageHelper {
|
||||||
static public void migrateWallets(Context context) {
|
static public void migrateWallets(Context context) {
|
||||||
try {
|
try {
|
||||||
if (isStorageMigrated(context)) return;
|
if (isStorageMigrated(context)) return;
|
||||||
if (!hasWritePermission(context)) {
|
if (!hasReadPermission(context)) {
|
||||||
// nothing to migrate, so don't try again
|
// nothing to migrate, so don't try again
|
||||||
setStorageMigrated(context);
|
setStorageMigrated(context);
|
||||||
return;
|
return;
|
||||||
|
@ -121,9 +121,9 @@ public class LegacyStorageHelper {
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasWritePermission(Context context) {
|
private static boolean hasReadPermission(Context context) {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
||||||
return context.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_DENIED;
|
return context.checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_DENIED;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue