Android Application Apk recompile error - Android Q&A, Help & Troubleshooting

hi there iam decompiling the apk file and getting error anyone can guide me how to fix ? for this prupose i decompiled chegg study application apk and did a little tweak and recompiled the folder upon recompiling getting this error :
Tool used: APK Easy Tool
invalid resource directory name: C:\Users\fahad_satti22\Desktop\apktool\chegg_original\res navigation
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\fahad_satti22\AppData\Local\Temp\brut_util_Jar_31928081245386695307597454261093548753.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 29, --version-code, 294, --version-name, 10.0.4, --no-version-vectors, -F, C:\Users\fahad_satti22\AppData\Local\Temp\APKTOOL6994267000475427236.tmp, -e, C:\Users\fahad_satti22\AppData\Local\Temp\APKTOOL3529958739332127621.tmp, -0, arsc, -I, C:\Users\fahad_satti22\AppData\Local\apktool\framework\1.apk, -S, C:\Users\fahad_satti22\Desktop\apktool\chegg_original\res, -M, C:\Users\fahad_satti22\Desktop\apktool\chegg_original\AndroidManifest.xml]

Related

[Q] AndroidManifest.xml is not well decompiled

Hey,
This is the first time that i ask something in a forum , the first time ever .
I used to found what i want in google or with some patience i found mostly the solution or i give up.
But this time i don't wanna give up :fingers-crossed: so here i'm asking for solution.
I'm trying to edit an android apk using apktools like i did many sevral time with others apk , but i had a problem from the begining
When i try to decompile using apktools
I get this error :
Code:
[COLOR="Red"][Fatal Error] AndroidManifest.xml:2:36: Element type "manifest" must be followed by either attribute specifications, ">" or "/>".[/COLOR]
And it decompile it
When i try to recompile it i got sevral error :
Code:
/usr/src/android/testMEapk/testMEapkDecompiled/AndroidManifest.xml:2: error: Error parsing XML: not well-formed (invalid token)
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_3771386797061777755.tmp, p, --forced-package-id, 127, --version-code, 65, -F, /tmp/APKTOOL1578726278950469476.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /usr/src/android/testMEapk/testMEapkDecompiled/res, -M, /usr/src/android/testMEapk/testMEapkDecompiled/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:435)
at brut.androlib.Androlib.buildResources(Androlib.java:363)
at brut.androlib.Androlib.build(Androlib.java:286)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_3771386797061777755.tmp, p, --forced-package-id, 127, --version-code, 65, -F, /tmp/APKTOOL1578726278950469476.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /usr/src/android/testMEapk/testMEapkDecompiled/res, -M, /usr/src/android/testMEapk/testMEapkDecompiled/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:470)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:416)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_3771386797061777755.tmp, p, --forced-package-id, 127, --version-code, 65, -F, /tmp/APKTOOL1578726278950469476.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /usr/src/android/testMEapk/testMEapkDecompiled/res, -M, /usr/src/android/testMEapk/testMEapkDecompiled/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:464)
... 6 more
After analyzing the problem i found that the AndroidManifest.xml is not well decompiled (not well written).
It contain several error it like all atributes name was removed from the file.
I thought that the problem is only on AndroidManifest.xml so i tried to add all attributes manyaly but my big surprise when i saw that all decompiled xml files are broken and not well written.
So my question doesn't any body have any idea about this ? why all xml file are not well decompiled ?
And how can i fix that.
I tried apktools Apktool v1.5.2 and apktool_2.0.0b9.jar and apktool_2.0.0b7jar same problem.
I hope that i will get some usefull answer and thanks for help.
This is how AndroidManifest.xml look like after decompiling the apk :
No body got this problem before ?
I hope that i will recieve an answer from my first question

[SOLVED] [APKTOOL] De- and Recompiling apk in debug-mode fails

Hi,
I'm trying to recompile an apk in debug mode (so no changes besides the one-liner in the manifest). But every time I execute "apktool b -d out" I get this error:
Code:
I: Using Apktool 2.0.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Me\AppData\Local\Temp\brut_util_Jar_7477717139219658502.tmp, p, --out-mode, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 19, --version-code, 26, --version-name, @string/versionname, -F, C:\Users\Me\AppData\Local\Temp\APKTOOL7991561937292063981.tmp, -0, arsc, -I, C:\Users\Me\apktool\framework\1.apk, -S, D:\out\res, -M, D:\out\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:458)
at brut.androlib.Androlib.buildResources(Androlib.java:396)
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\Me\AppData\Local\Temp\brut_util_Jar_7477717139219658502.tmp, p, --out-mode, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 19, --version-code, 26, --version-name, @string/versionname, -F, C:\Users\Me\AppData\Local\Temp\APKTOOL7991561937292063981.tmp, -0, arsc, -I, C:\Users\Me\apktool\framework\1.apk, -S, D:\out\res, -M, D:\out\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:419)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:444)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Me\AppData\Local\Temp\brut_util_Jar_7477717139219658502.tmp, p, --out-mode, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 19, --version-code, 26, --version-name, @string/versionname, -F, C:\Users\Me\AppData\Local\Temp\APKTOOL7991561937292063981.tmp, -0, arsc, -I, C:\Users\Me\apktool\framework\1.apk, -S, D:\out\res, -M, D:\out\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:413)
... 6 more
I tried this both on Windows and Ubuntu and I'm always getting this error. If I decode with -r (copy resources raw) everything recompiles just fine, but then I can't add the "android:debuggable"-value (for obvious reasons, I just wanted to test the recompiling). I googled this error and often there is a problem with "aapt" not beeing recognized, so I added the path to my PATH-variable, but I'm still getting the above output.
Anyone out there with a fix or am I doing something wrong?
Regards,
me113
I fixed it myself. There was a problem with the decompiling of the resources. Three images were exported as jpg instead of png. Re-saving them as png fixed everything. :victory:

Does apktool acts differently with different versions Java?

Hi,
I have this strange problem... I took a certain apk, decompiled it using apktools, but when I tried to recompile it back I got lots of errors like this one:
C:\apkto\test\res\layout\activity_wordfall.xml:46: error: No resource identifie
r found for attribute 'textAlignment' in package 'android'
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [C:\Users\johny\
AppData\Local\Temp\brut_util_Jar_3012068314543899025.tmp, p, --forced-package-id
, 127, --min-sdk-version, 9, --target-sdk-version, 19, --version-code, 34, --ver
sion-name, 1.2.2, -F, C:\Users\johny\AppData\Local\Temp\APKTOOL64664871173833496
10.tmp, -0, resources.arsc, -0, arsc, -I, C:\Users\johny\apktool\framework\1.apk
, -S, C:\apkto\test\res, -M, C:\apkto\testo\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:465)
at brut.androlib.Androlib.buildResources(Androlib.java:403)
at brut.androlib.Androlib.build(Androlib.java:291)
at brut.androlib.Androlib.build(Androlib.java:261)
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\johny\AppData\Local\Temp\brut_util_Jar_3012068314543899
025.tmp, p, --forced-package-id, 127, --min-sdk-version, 9, --target-sdk-version
, 19, --version-code, 34, --version-name, 1.2.2, -F, C:\Users\johny\AppData\Loca
l\Temp\APKTOOL6466487117383349610.tmp, -0, resources.arsc, -0, arsc, -I, C:\User
s\johny\apktool\framework\1.apk, -S, C:\apkto\testo\res, -M, C:\apkto\test\Andr
oidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:425)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:451)
... 5 more
Upon writing my question at XDA, I tried offhandedly to do the same thing in a virtual machine I own, not expecting much- but then BAM- apparently the process has ended just fine .
The only difference I see between my PC and my VM is that my PC has the latest Java update (1.8.0_66-b18) and the official android SDK, while my VM has only an older version of Java (1.8.0_31-b13).
So what's happening? and how can I fix it?
Thank you!

HELP modifying an APK's AndroidManifest.xml

I have little to no knowledge of modifying APKs and all attempts in doing so in the past have resulted me in giving up, except now I really need this to work! looks fairly simply according to this old post using apktool and java outlined here https://www.reddit.com/r/Android/comments/11852r/how_to_modify_an_apk/
only issue is I can't get it to rebuild the apk from the folder even if I make no changes. I'm getting a bunch of "Error parsing XML: not well-formed (invalid token)" messages before it spits out the following exception
Code:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException:could not exec (exit code = 1): [/tmp/brut_util_Jar_2053807626495926747.tmp, p, --forcedpackage-id, 127, --min-sdk-version, 14, --version-code, 708, --version-name, 3.1.3, -F, /tmp/APKTOOL6891156991859364727.tmp, -0, arsc, -0, arsc, -I, /home/nmok/.local/share/apktool/framework/1.apk, -S, /tmp/com.braksoftware.HumanJapanese-ca95c7eff15a41e99c94d68e5fe46a67/res, -M, /tmp/com.braksoftware.HumanJapanese-ca95c7eff15a41e99c94d68e5fe46a67/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478)
at brut.androlib.Androlib.buildResources(Androlib.java:412)
at brut.androlib.Androlib.build(Androlib.java:311)
at brut.androlib.Androlib.build(Androlib.java:264)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_2053807626495926747.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --version-code, 708, --version-name, 3.1.3, -F, /tmp/APKTOOL6891156991859364727.tmp, -0, arsc, -0, arsc, -I, /home/nmok/.local/share/apktool/framework/1.apk, -S, /tmp/com.braksoftware.HumanJapanese-ca95c7eff15a41e99c94d68e5fe46a67/res, -M, /tmp/com.braksoftware.HumanJapanese-ca95c7eff15a41e99c94d68e5fe46a67/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_2053807626495926747.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --version-code, 708, --version-name, 3.1.3, -F, /tmp/APKTOOL6891156991859364727.tmp, -0, arsc, -0, arsc, -I, /home/nmok/.local/share/apktool/framework/1.apk, -S, /tmp/com.braksoftware.HumanJapanese-ca95c7eff15a41e99c94d68e5fe46a67/res, -M, /tmp/com.braksoftware.HumanJapanese-ca95c7eff15a41e99c94d68e5fe46a67/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
... 6 more
any sort of help would be appreciated!

Error recompiling apk..

I'm trying to recompile my apk using apktool v4.2.0 once i decompile it i try to recompile it without touching anything then This is the error appears
PHP:
Log For : co.apk
Log Type : Recompiling
Log Recorded At : 02 2017-08- 16:30:32,42
Log Recorded By : Advanced ApkTool v4.2.0 By BDFreak
------------------------------------------------------
W: max res 24, skipping values-v25
W: C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\res\values\public.xml:1139: error: Public symbol style/Platform.V25.AppCompat declared here is not defined.
W: C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\res\values\public.xml:1140: error: Public symbol style/Platform.V25.AppCompat.Light declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ABDELM~1\AppData\Local\Temp\brut_util_Jar_2951543882709119069.tmp, p, --forced-package-id, 127, --min-sdk-version, 9, --target-sdk-version, 25, --max-sdk-version, 24, --max-res-version, 24, --version-code, 1, --version-name, 1.0, -F, C:\Users\ABDELM~1\AppData\Local\Temp\APKTOOL3839981288265792103.tmp, -0, arsc, -0, arsc, -I, C:\Users\zeekdp\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\res, -M, C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478)
at brut.androlib.Androlib.buildResources(Androlib.java:412)
at brut.androlib.Androlib.build(Androlib.java:311)
at brut.androlib.Androlib.build(Androlib.java:264)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ABDELM~1\AppData\Local\Temp\brut_util_Jar_2951543882709119069.tmp, p, --forced-package-id, 127, --min-sdk-version, 9, --target-sdk-version, 25, --max-sdk-version, 24, --max-res-version, 24, --version-code, 1, --version-name, 1.0, -F, C:\Users\ABDELM~1\AppData\Local\Temp\APKTOOL3839981288265792103.tmp, -0, arsc, -0, arsc, -I, C:\Users\zeekdp\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\res, -M, C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ABDELM~1\AppData\Local\Temp\brut_util_Jar_2951543882709119069.tmp, p, --forced-package-id, 127, --min-sdk-version, 9, --target-sdk-version, 25, --max-sdk-version, 24, --max-res-version, 24, --version-code, 1, --version-name, 1.0, -F, C:\Users\ABDELM~1\AppData\Local\Temp\APKTOOL3839981288265792103.tmp, -0, arsc, -0, arsc, -I, C:\Users\zeekdp\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\res, -M, C:\Users\zeekdp\Desktop\AdvancedApkTool\3-Out\co.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
... 6 more
------------------------------------------------------
Zeepdep said:
I'm trying to recompile my apk using apktool v4.2.0 once i decompile it i try to recompile it without touching anything then This is the error appears...
Click to expand...
Click to collapse
According to the header of the log, your using the Advanced Apktool by @BDFreak...
You should be posting this issue on that specific thread for the Advanced Apktool.
Please Note that it was just updated recently with the latest Apktool v2.2.4 release (a week +/- ago).
[Tool]Advanced ApkTool v4.2.0[Windows][10/02/2016] by BDFreak
I wish you the best of luck!
______________
PLEASE NOTE: I welcome any member to help with further valuable information/clarification for any of my posts.
×MY DEVELOPMENTS×
[APP][TOOL][4.2+]The SELinux Toggler
[ZIP][TOOL][AIO]BusyBox Stericson Binary Installer v1.26.2 {BB/TB Auto-Symlink}
×IN DEVELOPMENT×
[APP][TOOL][4.2+][OFFICIAL]The SELinux Switch
Will Supersede "The SELinux Toggler"
×IDEAS FOR DEVELOPMENT×
[APP][UNOFFICIAL][4.2+]XDA Forum {Classic}
[APP][UNOFFICIAL][4.2+]XDA Reader {Classic}

Categories

Resources