Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded apktool to version 2.0.0-RC2. #8

Closed
wants to merge 1 commit into from

Conversation

paymand
Copy link

@paymand paymand commented Nov 14, 2014

Merge appium/appium-adb#64 after merging this.

In our app we have upgraded to apktool version 2.0.0-RC2 since it is required to process APKs generated by the Lollipop SDK. Currently, I'm patching my Appium installation with the new appium_apk_tools.jar, but it would be nice to upgrade it in Appium if it is safe.

Without this fix, Appium fails to extract the app strings. Here's the relevant part of appium.log:

2014-11-14 09:55:22:098 - warn: Error getting strings.xml from apk
2014-11-14 09:55:22:099 - info: [debug] Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:54)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:540)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:76)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:68)
    at io.appium.apktools.StringsXML.run(StringsXML.java:84)
    at io.appium.apktools.Main.main(Main.java:31)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
    at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
    at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:43)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:100)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
    ... 5 more

@paymand
Copy link
Author

paymand commented Nov 14, 2014

Note that the new version of apk_tool requires requires Java 1.7.x:
iBotPeaches/Apktool@edb1aa7
and this is what happens if you don't have Java 1.7.x installed:

2014-11-14 17:26:21:394 - warn: Error getting strings.xml from apk
2014-11-14 17:26:21:394 - info: [debug] Exception in thread "main" java.lang.UnsupportedClassVersionError: brut/androlib/res/AndrolibResources : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at io.appium.apktools.StringsXML.<clinit>(StringsXML.java:26)
    at io.appium.apktools.Main.main(Main.java:25)

But I guess that should be ok?

@jlipps
Copy link

jlipps commented Nov 14, 2014

I'm not sure what version of java we require for running with appium, but if we don't yet require 1.7 i'm hesitant to merge this in a minor release

@bootstraponline
Copy link
Contributor

We don't yet require 1.7, it's currently scheduled for appium 1.4. This would break people's ability to run tests if they had an older Java so I agree a minor release doesn't make sense. It would be nice to get this fixed soon though.

@jlipps
Copy link

jlipps commented Nov 17, 2014

ok, let's hold off till 1.4

@sebv
Copy link

sebv commented Nov 20, 2014

Cannot we have both jars, detect the java version?

@sebv
Copy link

sebv commented Nov 21, 2014

in apktool_v2.0.0-RC2 branch.

@sebv sebv closed this Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants