Modifying an APK

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Moderators General, Prelates

User avatar
Jorpho
Posts: 6264
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Modifying an APK

Postby Jorpho » Wed Apr 17, 2019 4:50 am UTC

I have a couple of apps on my Android (Marshmallow) phone that install to the limited internal memory. According to https://developer.android.com/guide/top ... l-location , the way to fix this is simply to add android:installLocation="preferExternal" to AndroidManifest.xml .

So I downloaded apktool 2.4.0 from https://ibotpeaches.github.io/Apktool/ and was able to decode the APK, just like in https://ibotpeaches.github.io/Apktool/documentation/ . (I'm starting with this APK.) Attempting to build the APK promptly reveals that there's a bug in apktool 2.4.0, because of course there is.

So I decided to try versions 2.3.1 and 2.3.4, which turn up a different error:

Code: Select all

Exception in thread "main" java.util.zip.ZipError: jzentry == 0,
 jzfile = 364822008,
 total = 1368,
 name = 30dayf~1\dist\30dayf~1.apk.apktool_temp,
 i = 1,
 message = null
        at java.util.zip.ZipFile$ZipEntryIterator.next(Unknown Source)
        at java.util.zip.ZipFile$ZipEntryIterator.nextElement(Unknown Source)
        at java.util.zip.ZipFile$ZipEntryIterator.nextElement(Unknown Source)
        at brut.androlib.Androlib.copyExistingFiles(Androlib.java:629)
        at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:614)
        at brut.androlib.Androlib.build(Androlib.java:313)
        at brut.androlib.Androlib.build(Androlib.java:270)
        at brut.apktool.Main.cmdBuild(Main.java:227)
        at brut.apktool.Main.main(Main.java:75)


Unfortunately Google is not at all clear as to what may be causing this error. I really have no idea if I'm doing something obviously wrong here, considering I've never used this tool before. Would anyone happen to have any ideas?

Java version 1.8.0_201 on Windows 7x64, if that makes any difference.

Return to “The Help Desk”

Who is online

Users browsing this forum: No registered users and 1 guest