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: 6273
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.

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

Re: Modifying an APK

Postby Jorpho » Fri Apr 26, 2019 3:48 am UTC

Nobody, eh? Well, I'd rather not be a Denver Coder.

After a good deal of screaming and anguish I mostly got things working in a virtual machine running Linux, specifically slax.

Only then did I learn of APK Easy Tool, which is mostly just a frontend for apktool but doesn't spit out cryptic error messages and also does signing.

So, if you have troubles, that's what you should be using.


Return to “The Help Desk”

Who is online

Users browsing this forum: No registered users and 9 guests