zdzhjx / android-apktool

Automatically exported from code.google.com/p/android-apktool
Other
0 stars 0 forks source link

Decompiling Setting.apk creates "values-ᅫ@-rES" folder #761

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.apktool if framework-res.apk
2.apktool d Settings.apk

What is the expected output? What do you see instead?
values-ᅫ@-rES is created while decompiling thus we cannot build Settings

What version of the product are you using? On what operating system?
Using Apktool 2.0.0-RC4 on Windows 8.1 64-bit

Please provide any additional information below.
When i tries to decompile Setting.apk or framework-res.apk of CM12 i am getting 
a folder called "values-ᅫ@-rES"
Due to this folder I can't recompile
Deleting this folder would let me to recompile But the app doesn't work (with 
the same system signature)

Download Link for Framework and Settings ==> 
https://www.dropbox.com/s/4v350tkkggk1tip/Apktool%20Error.zip?dl=0

LOGS

C:\Users\Laura\Desktop\Loli>apktool if framework-res.apk
I: Framework installed to: C:\Users\Laura\apktool\framework\1.apk

C:\Users\Laura\Desktop\Loli>apktool d Settings.apk
I: Using Apktool 2.0.0-RC4 on Settings.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Laura\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
testI: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

C:\Users\Laura\Desktop\Loli>apktool b Settings
I: Using Apktool 2.0.0-RC4
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Laura\Desktop\Loli\Settings\res 
values-?@-rES
Exception in thread "main" brut.androlib.AndrolibException: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec 
command: 
[C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_883642563236148147.tmp, p, 
--forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, 
--version-code, 21, --version-name, 5.0.2-c88e2eeec4, -F, 
C:\Users\Laura\AppData\Local\Temp\APKTOOL1035266375298065500.tmp, -0, arsc, -I, 
C:\Users\Laura\apktool\framework\1.apk, -S,
C:\Users\Laura\Desktop\Loli\Settings\res, -M, 
C:\Users\Laura\Desktop\Loli\Settings\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:442)
        at brut.androlib.Androlib.buildResources(Androlib.java:379)
        at brut.androlib.Androlib.build(Androlib.java:282)
        at brut.androlib.Androlib.build(Androlib.java:255)
        at brut.apktool.Main.cmdBuild(Main.java:225)
        at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could 
not exec command: 
[C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_883642563236148147.tmp, p, 
--forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, 
--version-code, 21, --version-name, 5.0.2-c88e2eeec4, -F, 
C:\Users\Laura\AppData\Local\Temp\APKTOOL1035266375298065500.tmp, -0, arsc, -I, 
C:\Users\Laura\apktool\framework\1.apk, -S, 
C:\Users\Laura\Desktop\Loli\Settings\res, -M, 
C:\Users\Laura\Desktop\Loli\Settings\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:504)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:428)
        ... 5 more
Caused by: brut.common.BrutException: could not exec command: 
[C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_883642563236148147.tmp, p, 
--forced-package-id,
127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, 
--version-name, 5.0.2-c88e2eeec4, -F, 
C:\Users\Laura\AppData\Local\Temp\APKTOOL1035266375298065500.tmp, -0, arsc, -I, 
C:\Users\Laura\apktool\framework\1.apk, -S, 
C:\Users\Laura\Desktop\Loli\Settings\res, -M, 
C:\Users\Laura\Desktop\Loli\Settings\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:89)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:498)
        ... 6 more

C:\Users\Laura\Desktop\Loli>

Original issue reported on code.google.com by laura.al...@gmail.com on 17 Feb 2015 at 1:35

Attachments:

GoogleCodeExporter commented 9 years ago
Yep. This is a big problem.

Missed support for this in upgrade to Lollipop. We have no support for 3 letter 
lang codes.

https://android-review.googlesource.com/#/c/82116/
https://android-review.googlesource.com/#/c/82117/

Started working on a patch.

Original comment by connor.tumbleson on 17 Feb 2015 at 4:03

GoogleCodeExporter commented 9 years ago
Thank you so much
You are an awesome dev

Original comment by laura.al...@gmail.com on 17 Feb 2015 at 5:27

GoogleCodeExporter commented 9 years ago
Need to add to unit-tests

en-rUS
en-sLatn-rUS
en-vPOSIX

r = 'region prefix'
s = 'script prefix'
v = 'variant prefix'

Original comment by connor.tumbleson on 17 Feb 2015 at 5:40

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/pull/100

WIP

Original comment by connor.tumbleson on 17 Feb 2015 at 11:22

GoogleCodeExporter commented 9 years ago
link dump

https://code.google.com/p/android/issues/detail?id=106574#c7
https://android-review.googlesource.com/#/c/82116/1/libs/androidfw/ResourceTypes
.cpp
https://github.com/android/platform_frameworks_base/commit/91447d88f2bdf9c2bf8d1
a53570efef6172fba74
https://android-review.googlesource.com/#/c/82116/1/include/androidfw/ResourceTy
pes.h

Original comment by connor.tumbleson on 18 Feb 2015 at 3:05

GoogleCodeExporter commented 9 years ago
This has been fixed as of: https://github.com/iBotPeaches/Apktool/pull/100

Since this was a BIG change to underlying code. I've made a snapshot build 
below. You may use and test the change before the next public release.

Original comment by connor.tumbleson on 25 Feb 2015 at 11:03

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks 
All working perfectly fine now

Original comment by laura.al...@gmail.com on 1 Mar 2015 at 3:29

GoogleCodeExporter commented 9 years ago
Hi there! I encountered the same issue. And on updating the old 
apktool_2.0.0rc4.jar with apktool-2.0.0-f8d153-SNAPSHOT-small.jar, now I'm not 
able to decompile the apk at all. I see the below error:
I: Using Apktool 2.0.0-f8d153-SNAPSHOT on xxhdpi_normal_1_nondebug.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode 
arsc file
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:52)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:621)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:73)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:65)
    at brut.androlib.Androlib.getResTable(Androlib.java:63)
    at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:209)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92)
    at brut.apktool.Main.cmdDecode(Main.java:165)
    at brut.apktool.Main.main(Main.java:81)
Caused by: java.io.IOException: Expected: 0x00000008, got: 0x00000000
    at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:56)
    at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:237)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:200)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:188)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:156)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:113)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
    ... 8 more

Original comment by keerthy....@gmail.com on 11 Mar 2015 at 6:25

GoogleCodeExporter commented 9 years ago
Not sure. Check how many bytes are in the ResConfig header or upload the apk.

Original comment by connor.tumbleson on 11 Mar 2015 at 6:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Can you please tell me how I can check on the ResConfig header? 

Original comment by keerthy....@gmail.com on 11 Mar 2015 at 6:42

GoogleCodeExporter commented 9 years ago
Guess I figured why. When I decompiled the apk it did not add the all framework 
ids in android.yml. So it was freaking out. After adding the ids in 
android.yml, it worked just fine. Thank you for the tool! :)

Original comment by keerthy....@gmail.com on 11 Mar 2015 at 7:06