Fail to decompile and recompile apk with APKTool #1005

Closed
pdkonieczny opened this Issue Jul 21, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@pdkonieczny

with 2.0.1 and 2.0.0 unable to decompile and recompile OfficeSuite apk with error:

Decompile:
S: Could not decode file, replacing by FALSE value: drawable/btn_select_graphic_popup.9.xml

Recompile:

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\philipko\AppData\Local\Temp\brut_util_Jar_3948
754014834528088.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 21, --rename-manifest-package, com.mobisystems.editor.office_registered, --version-code, 3577, --version-
name, 8.2.3577, -F, C:\Users\philipko\AppData\Local\Temp\APKTOOL6308693178673622003.tmp, -0, arsc, -I, C:\Users\philipko\apktool\framework\1.apk, -S, C:\Users\philipko\Documents\data\DEV\BUG0578547-Of
ficeSuite\OfficeSuite_EMM_Pro_8.2_3577\.\res, -M, C:\Users\philipko\Documents\data\DEV\BUG0578547-OfficeSuite\OfficeSuite_EMM_Pro_8.2_3577\.\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:459)
        at brut.androlib.Androlib.buildResources(Androlib.java:397)
        at brut.androlib.Androlib.build(Androlib.java:285)
        at brut.androlib.Androlib.build(Androlib.java:256)
        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\philipko\AppData\Local\Temp\brut_util_Jar_3948754014834528088.tmp, p, --forced-package-id, 127,
 --min-sdk-version, 14, --target-sdk-version, 21, --rename-manifest-package, com.mobisystems.editor.office_registered, --version-code, 3577, --version-name, 8.2.3577, -F, C:\Users\philipko\AppData\Loc
al\Temp\APKTOOL6308693178673622003.tmp, -0, arsc, -I, C:\Users\philipko\apktool\framework\1.apk, -S, C:\Users\philipko\Documents\data\DEV\BUG0578547-OfficeSuite\OfficeSuite_EMM_Pro_8.2_3577\.\res, -M,
 C:\Users\philipko\Documents\data\DEV\BUG0578547-OfficeSuite\OfficeSuite_EMM_Pro_8.2_3577\.\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:419)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:445)
        ... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\philipko\AppData\Local\Temp\brut_util_Jar_3948754014834528088.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-
sdk-version, 21, --rename-manifest-package, com.mobisystems.editor.office_registered, --version-code, 3577, --version-name, 8.2.3577, -F, C:\Users\philipko\AppData\Local\Temp\APKTOOL630869317867362200
3.tmp, -0, arsc, -I, C:\Users\philipko\apktool\framework\1.apk, -S, C:\Users\philipko\Documents\data\DEV\BUG0578547-OfficeSuite\OfficeSuite_EMM_Pro_8.2_3577\.\res, -M, C:\Users\philipko\Documents\data
\DEV\BUG0578547-OfficeSuite\OfficeSuite_EMM_Pro_8.2_3577\.\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:89)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:413)
        ... 6 more
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Jul 24, 2015

Owner

Can you link / upload the apk?

I believe the problem is that a 9patch couldn't be decoded, thus during build it failed.

Owner

iBotPeaches commented Jul 24, 2015

Can you link / upload the apk?

I believe the problem is that a 9patch couldn't be decoded, thus during build it failed.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Jul 24, 2015

Owner

Yeah, I see the problem.

There is a file: res/drawable/btn_select_graphic_popup.9.xml. Now I've heard of nine patch drawables, but these are usually just to specify dithering or not. I've never seen a true .9.xml file which is why apktool is failing to decode it.

It sees .9.[ext] and believes its an image, but xml is not an image extension so it fails decode. The real file could be decoded if apktool could ignore non image extensions (which I will write a patch up).

The question is, "why is the .9.xml method used? I can't find any docs for it online.

Owner

iBotPeaches commented Jul 24, 2015

Yeah, I see the problem.

There is a file: res/drawable/btn_select_graphic_popup.9.xml. Now I've heard of nine patch drawables, but these are usually just to specify dithering or not. I've never seen a true .9.xml file which is why apktool is failing to decode it.

It sees .9.[ext] and believes its an image, but xml is not an image extension so it fails decode. The real file could be decoded if apktool could ignore non image extensions (which I will write a patch up).

The question is, "why is the .9.xml method used? I can't find any docs for it online.

@pdkonieczny

This comment has been minimized.

Show comment
Hide comment
@pdkonieczny

pdkonieczny Jul 24, 2015

I believe it was just a naming convention used for the XML file.

I believe it was just a naming convention used for the XML file.

iBotPeaches added a commit that referenced this issue Aug 3, 2015

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