yashsingh1/xdaforums huggingface dataset:
[Android Software Development] PhilDX:
removing "google" from the manifest file was mentioned a long time ago in this thread, and it will allow recompile, but have you tried to install the apk (after signing)? for me, installation (4.2.2 AOKP) fails with a parse error...
[Android Software Development] :
yeah,, it happens also to me on 4.3... i'm able to recompile back but apk is damaged... i have latest apktool 1.5.2 .. can't understand why
[Android Software Development] hotdog125:
I tried decompiling SystemUI.apk to mod it. I have a Motorola Defy+. I got errors decompiling only on CM10 and CM10.1 quarx (our main dev) build. Unofficial builds and other ROMs based on CM could decompile with no problem. What could be wrong?

The log-
[Android Software Development] DSA:
Edit

Nevermind
[Android Software Development] Shaftamle:
Me too. God this is so annoying! I wish someone had an answer. I can Dec/rec the android keyboard (aosp)with no problem. So what the h*ll causes the Google keyboard to crap out?? Ahhhhhhhhhhhhh!!!!!!!!

Sent from a Shaftamle Galaxy S4

"Thanks Button" is always appreciated!

http://mycolorscreen.com/Shaftamle/
[Android Software Development] pele78:
K

Sent from my Galaxy Nexus
[Android Software Development] :
i'm still waiting a dev reply on how to solve this problem... i have latest apktool, latest api 18... will try tomorrow to get latinime compile properly... if will try a solution, i will share with You
[Android Software Development] metalfan78:
Which version of Android are you working with? That will determine the api level you need.
[Android Software Development] :
Android 4.3 jwr66y maguro
[Android Software Development] metalfan78:
That should be correct, and you have the framework you need installed correctly? Does it give any line numbers for the errors?
[Android Software Development] Shaftamle:
I'm using 4.2.2. So I should use api 17? Does the app determine what api level should be used or is it something else? Like Min/target sdk. There are a lot of conflicting answers in the web.

Sent from a Shaftamle Galaxy S4

"Thanks Button" is always appreciated!

http://mycolorscreen.com/Shaftamle/
[Android Software Development] :
here is the log posted days ago (Windows 7 32-bit)

http://dl.xda-developers.com/attach...aaaae78ca22/5239f641/2/2/4/1/8/9/0/new__2.txt

i solved all my problems using apktool under lubuntu 64bits.. and installing missing ia32 libs needed for aapt...(because i had errors 2) .. thank You
[Android Software Development] metalfan78:
Yeah, 4.2 is api 17
[Android Software Development] Lanchon:
bundled aapt binary

ive been searching for a long time and i couldn't find a definitive answer. it must be somewhere though im sure, please dont bash me for not finding it.

the apktool-install-* bundles contain a version of aapt. this is undocumented and unexpected, since i guess most users will already have an aapt in their paths. is this aapt modified in some way to work with apktool? can i delete it or do i need to create a wrapper script for apktool that will transiently add it to the beginning of my path on each invocation? i don't want it to globally step over my adk binary.

thank you!
[Android Software Development] m4570d0n:
@iBotPeaches

Any chance you might be able to churn out a windows aapt.exe binary that allows upper case letters in file names? This is specific to compiling Theme Chooser themes, but there are some apps that use upper case letters in their package names (ex. com.keramidas.TitaniumBackup, or mobi.mgeek.TunnyBrowser) which causes problems with the default version of aapt. The asset redirection manager will not pick up the redirections from the theme if you use all lower case letters for the package name in the xml files, but if you try to use upper case letters, the apk will not compile because aapt will not allow the upper case letters in the file names. You can change it with a tweak to one line in frameworks_base.

Using cm-10.2's frameworks_base as an example, you would only need to make this change to frameworks/base/tools/aapt/Recource.cpp.

https://github.com/CyanogenMod/android_frameworks_base/blob/cm-10.2/tools/aapt/Resource.cpp#L287

lines # 286-295 (change is in red):

while (str < end) {
if (!((*str >= 'a' && *str <= 'z')
[B][COLOR=Red]|| (*str >= 'A' && *str <= 'Z')[/COLOR][/B]
|| (*str >= '0' && *str <= '9')
|| *str == '_' || *str == '.')) {
fprintf(stderr, "%s: Invalid file name: must contain only [a-z[B][COLOR=Red]A-Z[/COLOR][/B]0-9_.]\n",
it.getPath().string());
hasErrors = true;
}
str++;
}

I've included that change in my sources and have been building aapt (for linux) whenever I do my ROM builds since Android 4.1 and this change has never given me any issues. I suppose I could possibly be able to build this myself, but I'm not sure if I have enough space left on my Linux partition anymore to accommodate all the gigs of windows-specific stuff that would be generated during the build on top of all of the normal build output stuffs when I'm building for my phone. It would be super awesome though if someone that is already set up to build for a windows target could push out a copy of aapt.exe with this change. :) That, and if I built it, it would not include any of the other changes/optimizations you have made to aapt for Apktool.
[Android Software Development] iBotPeaches:
Let me do some research of why this change was implemented, because it appears app developers continue to use and older aapt to allow things like this. I can sure pump out an aapt on mac,unix and win for this, but give me a few days to figure out why it was implemented and any dangers that might surface by removing the check. I'll need to write some unit tests and test some things out.

Thanks for bringing this to my attention.
[Android Software Development] iBotPeaches:
It appears it was merged to prevent file collisions on case insensitive filesystems. I guess its a double edge sword, we loose an ounce of stability by introducing errors if uses have A.xml and a.xml, but also fix a problem for developers that use CamelCase.xml, knowing that aapt rebuilds will fail.

I think I'll merge it.

All those errors are the same. Integer value not allowed at layoutDirection. According to the docs, int value of 3 corresponds to "locale" as shown here: http://developer.android.com/reference/android/view/View.html#attr_android:layoutDirection

Will look into it.
[Android Software Development] Daniel D.:
Yes, I changed many lines to match the API 15 regulations, but after 45 min. there were still new code glitches and I stopped. I asked Pranav Pandey for help, let's see how he did it. Thanks!
[Android Software Development] brolee93:
Hi Devs "iBotPeaches" and other i mod a lot of app without pb with your best apktool1.5.2 it is work well but with new apk google (gmail, search , flipboard,and other ) i mod and compile without error but when i want install to my phone i have error of apk . if i decompile and recompile without modify same error , if i take stock app it is work ,if i sign stock app it is work . Have you one idea ?

If i take my app recompile and i put ressources.asrc from stock apk and i sign it is work . i think we have need new version of your apktool for news apk 4.3 ? i think no ?
[Android Software Development] Ticklefish:
I've got a problem decompiling a SystemUI.apk for an un-official rom.

The rom's here: http://xdaforums.com/showthread.php?t=1757125 and I get this error:
[Android Software Development] ManuMu:
Hi,

I've the same problem. I think to recompile apk break the resources.arsc. Have you any idea to recompile apk without problem ?

Thanks !
[Android Software Development] iBotPeaches:
By removing the directories you left all the resources in the public.xml, so that won't work. You could delete the public.xml and let aapt re-generate it, but all ID's will change and if there is any reference in the framework to a specific ID. You will have broken that functionality. Your best bet is to just use the modified aapt/apktool that SlimROM made for this "inverted" change.

Don't sign apks. Just move modified contents back into the original apk (to retain signature). Apktool utilizes frameworks so it doesn't matter if your running the passed around 2.0.0b6 build or 1.5.2. You still need newer frameworks.

The problem is actually in that framework-res.apk. Its missing a lot of resources. You can use the framework here: https://github.com/iBotPeaches/Apkt...resources/brut/androlib/android-framework.jar

(apktool if android-framework.jar), and then decode the apk and it should work.
[Android Software Development] brolee93:
if i delete flipboard/public.xml i can install apk GOOD but i have white screen i confirme i can recompile without error new flipboard or Gmail . and i havn't problem with previous version .

i have test your new apktool2.0.0b6 but i cant decompile this dont work. my other folder are untouched . can you explain me how to use correctly your new apktool2.0.0b6 , have you one Tutorial ?

thanks for your previous reply
[Android Software Development] Ticklefish:
Many thanks! And thanks for replying so quickly!

As previously mentioned, you really shouldn't delete public.xml. If you're recompiling without any errors, then the problem may lie in what you're doing with the recompiled apk afterwards.
[Android Software Development] m1trand1r:
Hey guys....I don't know where to ask....but....I decompiled framework-res.apk and did some modifications to values/styles.xml...mainly text color.....then I recompiled/signed it back and pushed to system/framework ....I got cought in bootloop:p...I fetched logcat during loop:

06:42:31.656 Error Zygote 18551 Error preloading android.database.CursorWindow.

06:42:31.656 Error Zygote 18551 java.lang.ExceptionInInitializerError

06:42:31.656 Error Zygote 18551 at java.lang.Class.classForName(Native Method)

06:42:31.656 Error Zygote 18551 at java.lang.Class.forName(Class.java:204)

06:42:31.656 Error Zygote 18551 at java.lang.Class.forName(Class.java:169)

06:42:31.656 Error Zygote 18551 at com.android.internal.os.ZygoteInit.preloadClasses(ZygoteInit.java:280)

06:42:31.656 Error Zygote 18551 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:227)

06:42:31.656 Error Zygote 18551 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:523)

06:42:31.656 Error Zygote 18551 at dalvik.system.NativeStart.main(Native Method)

06:42:31.656 Error Zygote 18551 Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x10e0037 type #0x5 is not valid

06:42:31.656 Error Zygote 18551 at android.content.res.Resources.getInteger(Resources.java:907)

06:42:31.656 Error Zygote 18551 at android.database.CursorWindow.<clinit>(CursorWindow.java:47)

06:42:31.656 Error Zygote 18551 ... 7 more

^^^this is relevant part only....

can someone give me advice on where I missed?...

I used Slimroms apktool.jar and APK-multitool shell....if that matters;)

Thanks in advance;)

Sent from /SlimBean//Android 4.3:p//
[Android Software Development] core720:
I tested inverted apktool slim and dont work

Enviado desde mi LG-E975 usando Tapatalk 4
[Android Software Development] ManuMu:
Hy,

Framework, don't need to be signed....
[Android Software Development] cowsquad:
How do you sign apk
[Android Software Development] brenopapito:
I've got this error:

C:\Users\Breno\Desktop\apktool1.5.2>apktool b SemcPhone
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\r
es/values-mcc454-mnc1000
invalid resource directory name: C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\r
es/values-mcc454-mnc1000-zh-rCN
invalid resource directory name: C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\r
es/values-mcc454-mnc1000-zh-rHK
invalid resource directory name: C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\r
es/values-mcc454-mnc1000-zh-rTW
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 17, --target-sdk-version, 17, -F, C:\Users\Breno\AppData\Local\Temp
\APKTOOL537406889366410384.tmp, -0, arsc, -I, C:\Users\Breno\apktool\framework\1
.apk, -I, C:\Users\Breno\apktool\framework\2.apk, -S, C:\Users\Breno\Desktop\apk
tool1.5.2\SemcPhone\res, -M, C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\Andro
idManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 17, --target-sdk-version, 17, -F, C:
\Users\Breno\AppData\Local\Temp\APKTOOL537406889366410384.tmp, -0, arsc, -I, C:\
Users\Breno\apktool\framework\1.apk, -I, C:\Users\Breno\apktool\framework\2.apk,
-S, C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\res, -M, C:\Users\Breno\Deskt
op\apktool1.5.2\SemcPhone\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 17, --target-sdk-version, 17, -F, C:\Users\Breno\AppData\Local\Temp\A
PKTOOL537406889366410384.tmp, -0, arsc, -I, C:\Users\Breno\apktool\framework\1.a
pk, -I, C:\Users\Breno\apktool\framework\2.apk, -S, C:\Users\Breno\Desktop\apkto
ol1.5.2\SemcPhone\res, -M, C:\Users\Breno\Desktop\apktool1.5.2\SemcPhone\Android
Manifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:355)
... 6 more

Can someone help me?
[Android Software Development] metalfan78:
I think you need to have apktool on the root of your c drive, not in your user folder. I had errors like that until I moved it to my c drive.
[Android Software Development] iBotPeaches:
A new beta version has been released!

Proud to release a public beta of Apktool 2.0 Beta 7

*Java 7 still required!*

Details, downloads, FAQ, etc: http://connortumbleson.com/2013/10/apktool-2-0-0-beta-7-released/

(I wrote it in my blog to track it easier then loosing it in pages of this thread in a matter of minutes)
[Android Software Development] bgcngm:
Just tested the new beta and it seems that there's still a problem with com.htc.resources:

D:\HTC\system\app>apktool if ..\framework\com.htc.resources.apk
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x0205004d dimen/title_primary_xs, config=-hdpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:199)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:168)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:134)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:109)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:40)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:686)
at brut.androlib.Androlib.installFramework(Androlib.java:640)
at brut.apktool.Main.cmdInstallFramework(Main.java:249)
at brut.apktool.Main.main(Main.java:91)
[Android Software Development] iBotPeaches:
Brut helped me investigate this and we choose to remove the fix as it was hacky and could have side effects on other APKs. In came down to the fact that it was one APK causing us so much trouble and when we finally fixed it, we introduced errors into our test suite apks. We then added tons of checks looking at the package name to only run the code on that type of APK. At that point, our code was getting so ugly on a key part of Apktool that we reverted.

https://github.com/iBotPeaches/Apktool/commit/3a5530e67ba7fb7e03cdb93751c5668e3aceffc2

I reverted it about 6 months ago lol. You can take the current source and just "re-revert" this and hopefully it'll merge cleanly. This should fix it, but we never had a stock HTC device to actually test that. I'm open to ideas of how to implement some of these changes into Apktool without making the code difficult to read.

EX

1. A plugin based system where people can load specific config files that are maps of the Res Specs? EX ones for complicated roms like that inverted feature of SlimROM and ZTE / This com.htc.resources.apk

2. A custom parameter flag --custom HTC (which throws a corresponding HTC flag for this type of apk).

Sorry for removing that when it was promised. It just came down to stability and stuff like that.

EDIT: I'll see what I can do, since that apk is a major part of theming.
[Android Software Development] Phone_Guru:
Gmail 4.6

Everyone is having trouble with the new gmail. I can decompile, edit and recompile fine but when I flash the new resources.arsc file the app stops running. Is this something that you could fix with Apktool 2.0 or does the issue lie elsewhere?
[Android Software Development] claude96:
apktool 2.0.7b

[MENTION=3924617]iBotPeaches[/MENTION] I tried apktool 2.0.7beta with a leaked version of android 4.3 for note 2, and I get tons of errors recompiling systemui.apk and framework-res.apk and all other system apps, here are the errors, hope it'll help with next beta, or maybe, you can help ( I used aapt.exe from sdk api 18.0.1 )

Error log : https://dl.dropboxusercontent.com/u/11755936/error_log_2.0.7b.txt

thanks a ton.
[Android Software Development] iBotPeaches:
Delete the framework at $HOME/apktool/frameworks/1.apk and reissue the decompile. On 2.0b7. That looks like a missing framework problem. Try the default included framework.

Sent from my Xperia Z running ChaOS
[Android Software Development] claude96:
[MENTION=3924617]iBotPeaches[/MENTION] : that was done with the default included framework, here are the errors I get when recompiling framework ( without any changes ).

framework error log : https://dl.dropboxusercontent.com/u/11755936/framework-res.apk_error_log_2.0.7b.txt

Again, thanks a ton.
[Android Software Development] iBotPeaches:
Send me the decompiled /res/values/*.xml files. Thanks

[MENTION=2736274]Phone_Guru[/MENTION]

No logs, no logcat, no link to apk. Being a student takes most of my time, I can't chase down anything. You have to meet me halfway with anything for me to investigate. EX: What you changed, steps to reproduce.
[Android Software Development] claude96:
here, values decomp link : https://dl.dropboxusercontent.com/u/11755936/values.zip

Tons of thanks.
[Android Software Development] iBotPeaches:
Strange, all the SystemBar styles are missing. Maybe there is another in a file ("find . -name 'styles.xml'). You could try a hacky solution. Append this onto the res/values/styles.xml.

http://pastebin.com/2Ts8F7qw
[Android Software Development] claude96:
done, styles errors gone, but the strings errors remain, also tried do decompile/recompile systemiui.apk with the new recompiled framework, but the errors are somehow the same!

framework error link : https://dl.dropboxusercontent.com/u/11755936/V2_framework-res.apk_error_log_2.0.7b.txt
[Android Software Development] iBotPeaches:
Those are warnings. AAPT became more restrictive and warns if there are extra strings in a values-xx folder that aren't in the main /values folder. This is not a problem, glad the actual error is fixed now.
[Android Software Development] claude96:
OK, but still no success with decompiling/recompiling systemui.apk, sorry to bother you again, but is there any way to be able to work over systemui.apk ?, thanks a bunch.

PS: apologies, I forgot to paste the missing styles b4 recompiling ( in systemui ).

PPS : systemui.apk recompiles with no errors ( without any changes ), but fc, any ideas !

Again, thanks a ton.
[Android Software Development] jl154:
Just starting to learn about decompiling and compiling. When i try to compile my mms,apk i get error messages from public xml. I get the same error msg when trying to compile the same apk with no changes. Why would there be errors if i haven't changed anything. Is there a way i can correct the problem.
[Android Software Development] Phone_Guru:
The apk is the new gmail 4.6. I only changed a few colour values in color.xml like I normally do and it compiled fine just caused gmail to not work when flashing in the new resources file. It said app not installed when I tap the icon, disappeared from the app drawer and in the data/app folder the icon changed from the gmail icon to the generic android icon. I've attacheed the log and the recompiled apk. Hope this helps. This is a general problem. Nobody has been able to theme the new gmail.

Thanks and good luck with your studies.
[Android Software Development] vmancini3:
Were you ever able to successfully install this app after you compiled it? I'm also trying to compile the Newest Google Keyboard and no matter what I try it just won't work! I also tried the same fix you describe here, taking the "google" out of "com.google.android.inputmethod.latin", which allows apktool to build the apk, but when I go to install, it says Error Parsing Package, or something similar...can't remember exactly...

This is what I see though, when trying to compile (immediately after decompiling, without touching anything), and it's the first of MANY!!!

"APK DIRECTORY"\res\layout\more_suggestions.xml:4: error: No resource identifier found for attribute 'keyLetterSize' in package 'com.android.inputmethod.latin'
[Android Software Development] plegdroid:
Would the apk require signing? :)

ⓐⓝⓓⓡⓞⓒⓛⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] vmancini3:
I tried to sign the apk and still get a very similar error....unfortunately I'm not in front of the computer right now...but the error is still something related to parsing the package...

Sent from my SCH-I535 NOT using that garbage called TapaTalk 4!
[Android Software Development] plegdroid:
After signing did the apk name change? If it did try renaming it back to the original un modded apk name (if that makes sence ) . :)

ⓐⓝⓓⓡⓞⓒⓛⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] iBotPeaches:
As we get close to a new AOSP drop, these errors become more frequent. This means that the included framework(s) do not have a reference to that identifier. Usually instead of a framework reference, one can use a namespace equivalent to prevent this problem. Though, I just noticed that Apktool seems to strip namespaces or maybe they aren't built into final apk. (I'll need to do some research). Much like in some strings.xml file there are `translatable="false"`, these attributes are not built into the apk. So decoding them doesn't reveal them.

I don't know if the namespace is required once the APK is in binary form and on a device. Will do some investigating.
[Android Software Development] vmancini3:
I actually feel blessed that you chimed in on this! Thank you very much for that! Also, if I may add, I did try every single version of apktool that exists and I also tried MULTIPLE sets of frameworks as well as renaming the namespaces in every single xml file before posting here! Figured it was the right thing to do to try every possible thing I could think of before asking for some help/insight!

Also, thank you too [MENTION=4259944]plegdroid[/MENTION] for trying to be of some assistance! I appreciate it!

Sent from my SCH-I535 NOT using that garbage called TapaTalk 4!
[Android Software Development] lovejoy777:
Hi

I have downloaded the version beta7 how do i use as when i type apktool i get file dosent exist returned. I have unpacked it to /usr/local/bin, is this correct? i used the older versions fine but i cant find any info on how to setup. im running ubuntu 13.10 and have jre 1.7. any help would be great. cheers Steve
[Android Software Development] MattBooth:
Any further hints on the new GMail problems? It also affects Email 6.0 too (unsurprising, since they're VERY similar).