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

StringBlock isn't Thread Safe #711

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 601 created by aluedeke@testobject.com on 2014-02-07T13:09:10.000Z:

We are using the apktool in an multithreaded enviroment. When using it single threaded it works fine for us. When running it multithreaded its crashing with the following stack:

java.lang.IllegalStateException: Current state = RESET, new state = FLUSHED
at java.nio.charset.CharsetDecoder.throwIllegalStateException(CharsetDecoder.java:968)
at java.nio.charset.CharsetDecoder.flush(CharsetDecoder.java:657)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:786)
at brut.androlib.res.decoder.StringBlock.decodeString(StringBlock.java:279)
at brut.androlib.res.decoder.StringBlock.getString(StringBlock.java:110)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:191)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:167)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:133)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:108)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
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 brut.androlib.Androlib.getResTable(Androlib.java:51)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:191)

With the attached patch the issue dissappears.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by connor.tumbleson on 2014-02-07T13:35:46.000Z:

https://code.google.com/p/android-apktool/source/detail?r=e48ab8b9b943ede435e61e4ef1ecdde7440e8e40&name=wip-2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment