diff options
Diffstat (limited to 'android/src')
-rw-r--r-- | android/src/org/rockbox/RockboxService.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java index 0737bf88ce..033ece320c 100644 --- a/android/src/org/rockbox/RockboxService.java +++ b/android/src/org/rockbox/RockboxService.java @@ -151,7 +151,8 @@ public class RockboxService extends Service { public void run() { - File rockboxDir = new File("/data/data/org.rockbox/app_rockbox/rockbox/"); + String rockboxDirPath = "/data/data/org.rockbox/app_rockbox/rockbox"; + File rockboxDir = new File(rockboxDirPath); /* the following block unzips libmisc.so, which contains the files * we ship, such as themes. It's needed to put it into a .so file @@ -174,7 +175,11 @@ public class RockboxService extends Service while(e.hasMoreElements()) { ZipEntry entry = (ZipEntry) e.nextElement(); - File file = new File(entry.getName()); + File file; + /* strip off /.rockbox when extracting */ + String fileName = entry.getName(); + int slashIndex = fileName.indexOf('/', 1); + file = new File(rockboxDirPath + fileName.substring(slashIndex)); if (!entry.isDirectory()) { |