aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris "Koying" Browet <cbro@semperpax.com>2015-06-21 11:01:17 +0200
committerChris "Koying" Browet <cbro@semperpax.com>2015-06-21 11:04:17 +0200
commit693ce5877a604a342fca46b2d500ed35d965a25b (patch)
tree316e2b803a7f6db877b935da8ad1f04203e27791 /tools
parent6e7b397098acd80d3275632a4e0c4b06258fe113 (diff)
FIX: [droid] harden MigrateUserData
Diffstat (limited to 'tools')
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in
index c042703d40..81741ebee5 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in
@@ -417,8 +417,17 @@ public class Splash extends Activity {
}
private void MigrateUserData() {
- String sOldUserDir = getExternalFilesDir(null).getParentFile().getParentFile() + "/org.xbmc.xbmc/files/.xbmc";
- File fOldUserDir = new File(sOldUserDir);
+ String sOldUserDir;
+ File fOldUserDir;
+ try {
+ sOldUserDir = getExternalFilesDir(null).getParentFile().getParentFile() + "/org.xbmc.xbmc/files/.xbmc";
+ fOldUserDir = new File(sOldUserDir);
+ if (!fOldUserDir.exists())
+ return;
+ } catch (Exception e) {
+ return;
+ }
+
File fNewUserDir = new File(getExternalFilesDir(null), ".@APP_NAME_LC@");
String sKodiMigrated = fNewUserDir.getAbsolutePath() + "/.kodi_data_was_migrated";
File fKodiMigrated = new File(sKodiMigrated);