diff options
author | Martijn Kaijser <machine.sanctum@gmail.com> | 2013-11-02 16:36:01 -0700 |
---|---|---|
committer | Martijn Kaijser <machine.sanctum@gmail.com> | 2013-11-02 16:36:01 -0700 |
commit | 509dd1eee79997b948dd830146e2e90c062846cf (patch) | |
tree | 70cff921446c1bff8883c0f288046b7ec23fc5a8 /tools | |
parent | 62a26632d0b5b50078387e7f868c2ddca03b8afd (diff) | |
parent | dd516c6ae6507ccb25ee4f78885cd43b4383c7e7 (diff) |
Merge pull request #3543 from koying/fixdroidassets
FIX: [droid] cleanup assets before build and reinstall (possible fix for #14565)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/android/packaging/Makefile | 2 | ||||
-rw-r--r-- | tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java | 27 |
2 files changed, 14 insertions, 15 deletions
diff --git a/tools/android/packaging/Makefile b/tools/android/packaging/Makefile index 1b4ea9bd17..7e7d4805fc 100644 --- a/tools/android/packaging/Makefile +++ b/tools/android/packaging/Makefile @@ -68,7 +68,7 @@ package: extras @echo "$(XBMCROOT)/xbmcapp-$(CPU)-debug.apk created" extras: libs - rm -rf xbmc/assets/python2.6/lib/ + rm -rf xbmc/assets mkdir -p xbmc/assets xbmc/res xbmc/res/raw xbmc/assets/python2.6/lib/ cp -rfp $(PREFIX)/share/xbmc/* ./xbmc/assets find `pwd`/xbmc/assets/ -depth -name ".git" -exec rm -rf {} \; diff --git a/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java b/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java index e3a6200bfa..8ecc127540 100644 --- a/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java +++ b/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java @@ -88,8 +88,21 @@ public class Splash extends Activity { this.mSplash = splash; } + void DeleteRecursive(File fileOrDirectory) { + if (fileOrDirectory.isDirectory()) + for (File child : fileOrDirectory.listFiles()) + DeleteRecursive(child); + + fileOrDirectory.delete(); + } + @Override protected Integer doInBackground(Void... param) { + if (fApkDir.exists()) { + // Remove existing files + Log.d(TAG, "Removing existing " + fApkDir.toString()); + DeleteRecursive(fApkDir); + } fApkDir.mkdirs(); // Log.d(TAG, "apk: " + sPackagePath); @@ -125,15 +138,6 @@ public class Splash extends Activity { continue; } - // Log.d(TAG, - // "time: " + e.getTime() + ";" - // + fFullPath.lastModified()); - - // If file exists and has same time, skip - if (e.getTime() == fFullPath.lastModified()) - continue; - - // Log.d(TAG, "writing: " + sFullPath); fFullPath.getParentFile().mkdirs(); try { @@ -145,11 +149,6 @@ public class Splash extends Activity { in.close(); out.close(); - - // save the zip time. this way we know for certain - // if we - // need to refresh. - fFullPath.setLastModified(e.getTime()); } catch (IOException e1) { e1.printStackTrace(); } |