yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] ali3nfr3ak:
Resources not public....

Im trying to edit/mod HTC_IME.apk (deodexed) from desire z rom, and even without editing any files.. i get this same error...

I: Building resources...
D:\test\test\.\res\layout\preference_kb_settings.xml:6: error: Error: Resource i
s not public. (at 'textSize' with value '@com.htc:dimen/htc_text_appearance_smal
l').
D:\test\test\.\res\layout\preference_kb_title.xml:6: error: Error: Resource is n
ot public. (at 'textSize' with value '@com.htc:dimen/htc_text_appearance_small')
.
D:\test\test\.\res\layout\udb_entry.xml:2: error: Error: Resource is not public.
(at 'minHeight' with value '@com.htc:dimen/htc_list_item_height').
D:\test\test\.\res\layout\udb_entry.xml:4: error: Error: Resource is not public.
(at 'layout_marginLeft' with value '@com.htc:dimen/htc_list_item_margin_left').

D:\test\test\.\res\drawable\common_inputfield.xml:4: error: Error: Resource is n
ot public. (at 'drawable' with value '@com.htc:drawable/common_b_inputfield_pres
s').
D:\test\test\.\res\drawable\common_inputfield.xml:5: error: Error: Resource is n
ot public. (at 'drawable' with value '@com.htc:drawable/common_b_inputfield_sele
cted').
D:\test\test\.\res\drawable\common_inputfield.xml:6: error: Error: Resource is n
ot public. (at 'drawable' with value '@com.htc:drawable/common_b_inputfield').
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\ADMINI~1\AppData\Local\Tem
p\APKTOOL5707237859346862841.tmp, -I, C:\Users\Administrator\apktool\framework\1
.apk, -I, C:\Users\Administrator\apktool\framework\2.apk, -S, D:\test\test\.\res
, -M, D:\test\test\.\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\ADMINI~1\AppData\Local\Temp\APKTOOL5707237859346862841.tmp, -I, C:\Users\Ad
ministrator\apktool\framework\1.apk, -I, C:\Users\Administrator\apktool\framewor
k\2.apk, -S, D:\test\test\.\res, -M, D:\test\test\.\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more

Just wondering what causes this, and how to fix it. thanks
[G1 Android Development] pendo:
Did you install framework files?

apktool if com.htc.resources.apk
[G1 Android Development] ali3nfr3ak:
Firstly thanks for taking the time to respond. =). That did the trick, thank you very much. :D
[G1 Android Development] daniel60104:
hi all,

I am running a bit of problem in editing framework-res.apk

i was able to decompile it, and change the values in the xml (so I can add backlight). I then recompiled it and put it into the rom.

However, it only gives me bootloops... why is that?

I don't know if this will help clear up the question but:

1. I was trying to edit a framework-res.apk that's already themed. I think I might've heard somewhere that you can't do that... is that true?

2. I never did the apktool if com.htc.resources.apk

is that absolutely necessary?

Thanks.
[G1 Android Development] pendo:
np :)

No, you can absolutely work with themed frame-res files. It's just depending on how it was themed you may, or may not have decompiling errors.

Did you inject the META-INF and AndroidManifest.xml from the original frame-res into your new one?
[G1 Android Development] MontAlbert:
i found the files inside the xml folder (my laptop takes ages to DL the source due to it being VERY old- waiting for the msi GT680) and edited them- thanks for the help.

It appears that apktool when it is decompiling (correct word) finds the & in the code and decompiles the & as & so it makes a & come out as &mp; and the < which is < come out as &lt;

damn- should have come here earlier- spent countless hours googling and trying to fix myself.

Thanks mate.
[G1 Android Development] KBanause:
In most cases those errors are .9.pngs which actually are not nine-patch-files.
[G1 Android Development] he_stheone64:
@ brut - could you find a reason for the strange behaviour, that settings do not load after pushing the compiled com.htc.resources.apk?

Thx a ton
[G1 Android Development] TMartin:
I've tried it on a few different Evo ROM versions but not for another device. It's very strange because I'm not even swapping a 9patch for a normal png. It's all pretty much png for ong.
[G1 Android Development] daniel60104:
If by injecting you mean replacing the androidmanifest.xml, I did. They seemed to be the same, either way.

I realized the resource.arsc is significantly smaller afterwards... is that normal?
[G1 Android Development] Shauli20:
Hi all, I'm new to decoding APKs and Apktool. I attempted to make a small change to one XML in framework-res.apk for my EVO. After recompiling and pushing to my phone Iv'e experienced very strange things including long pressing the home button causing a hot restart. I was told by my ROM dev to try using Apktool v1.3.1 because of some known bug in v1.3.2. I looked on the Google Code pages but couldn't find a link to v1.3.1. Does anyone know where I could get it from?

Thanks a lot.
[G1 Android Development] djmcnz:
Check the filter on the download page, it is there.

http://code.google.com/p/android-ap...mmary+Uploaded+ReleaseDate+Size+DownloadCount
[G1 Android Development] pendo:
I'm sure you've tripple checked this, but are you 100% sure the spelling is the same?

As an experiment, swap out your one png, and recompile. When/if it throws the error, go back and delete that entry from public.xml. Then recompile. It should reassign the same id, but then again, it shouldn't be doing what you're experiencing to begin with.

There's gotta be something you're missing though. I've never heard of this error--not that that really means much coming from me :p

It's normal for the whole file to get smaller, sometimes significantly. And AndroidManifest is NOT the same. If you were to open it up in a hex or even just do a diff on the binary compiled forms, you'd see.

you have to go towards the top of the page and select the drop-down to search for all downloads. Link

edit-

djmcnz beat me to it :p
[G1 Android Development] Shauli20:
Thank you. Now maybe someone here can give me a tip to what I'm doing wrong. I used Apktool v1.3.2 to decompile, edit 2 XMLs and recompile the framework-res.apk from the HTC EVO. Upon pushing to the phone and rebooting, Iv'e been getting very strange results. The second time I tried I got stuck in a bootloop.

I haven't gotten any errors from Apktool. I dragged the META-INF folder from the original framework into the modified one instead of resigning.

Can someone please shed some light on what I may be doing wrong?
[G1 Android Development] pendo:
uh...did you mean to say v1.3.1?
[G1 Android Development] Shauli20:
No, I originally used v1.3.2, both the current version and the testing version. I've had similar problems with both.

I haven't had a chance to use v1.3.1 yet. I will try, but in the meantime I was wondering if anyone had any ideas.

Sent from my EVO rockin' MikFroYo!
[G1 Android Development] TMartin:
Yea...I even copied/pasted the filename lol

So you are saying apktool should repopulate the public.xml?? This is something I did not know. I have been doing way too much work than lol
[G1 Android Development] pendo:
Please try with 1.3.1. 1.3.2 has a couple problems with xml, which only shows itself when you put the apk back on the phone. No compilation errors during the build.

Yes, but you want to be careful about deleting stuff. If it's something you plan on keeping, then it's best just to leave it alone. I rarely go into public.xml for modification purposes. I visit it a lot if I'm trying to work in smali just to look up an id, but to actually delete things, very rarely.

For other mods (ie super circle) where you're just adding resources, aapt (I think it's what does it) will take care of all the new ids for you :)

Here's a quote from the master himself that I usually refer to when talking about editing public.xml:
[G1 Android Development] TMartin:
WOW...he should definitely add that to the wiki. Obviously some apk's do not have smali files in them so if I were to be removing things, could the resources be referenced in a framework smali file?? And do you know if that will cause apktool to throw an error??

Thanks for all the great information. I really appreciate it.
[G1 Android Development] pendo:
You're welcome. Brut.all is the man for sure.

Actually all (I think all) apks have smali, just not frame-res ;) If you remove a resource, apktool will compile it just fine (assuming you remove the resource, and it's entry in public.xml) But if something tries to call for it later in the rom, then it will FC.

Is there something in particular you're wanting to take out?
[G1 Android Development] TMartin:
Ok...I'm not trying to remove anything in particular. I didn't have an issue editing for the first few weeks I was using the tool but just recently starting going crazy trying to edit xml & images files and have been running into issues. So I'm just try to absorb as much as I can so I don't run into anything else.
[G1 Android Development] Michel82:
Ok newbie here:

I want to have my Google Navigation to be Fullscreen during tun-by-turn directions. I think that notification bar is just a waste of space while navigating.

What i did: I downloaded the tool, decoded Maps.apk from my /system/apps/Maps.apk

Changed the following in the AndroidManifest.xml (i have absolutely no idea if this is the right activity, but i thought i'd just give it try):

<activity android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/da_navigation"
android:icon="@drawable/da_ic_navigation"
android:name="com.google.android.maps.driveabout.app.NavigationActivity"
android:process=":driveabout" android:taskAffinity=":driveabout"
android:launchMode="singleTask"
android:configChanges="keyboardHidden|orientation">

To (mind the theme changed to Theme.NoTitleBar.Fullscreen"):

<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/da_navigation"
android:icon="@drawable/da_ic_navigation"
android:name="com.google.android.maps.driveabout.app.NavigationActivity"
android:process=":driveabout" android:taskAffinity=":driveabout"
android:launchMode="singleTask"
android:configChanges="keyboardHidden|orientation">

Next i rebuilded the Maps.apk and replaced the original one in /system/app/ it didn't just run automatically, so i thought maybe i should re-install? Tried that, but than i get an error that installation failed. Help? Anyone?
[G1 Android Development] Brut.all:
What do you mean by "it didn't just run automatically"? Try to remove apk from /system/app, run "adb uninstall com.google.android.apps.maps" and install modded apk normally.
[G1 Android Development] Anoniem100:
Having a little problem with version 1.3.2 recompiling zeam.

Works well using version 1.3.1, think it has something to do with Issue 100. Any progress on that one? looked at your source code trying to spot the issue to see if I could help, but realized that I'm far better in programming c# than java :(
[G1 Android Development] KBanause:
I already asked about an ETA here but I got no answer :(
[G1 Android Development] Anoniem100:
Hahaha, means he's busy I think...

Know the feeling of everyone pulling on your arms, asking when things are done.

For now I will fall back on the older version, while waiting eagerly for the new update.

Patience is a talent ;)
[G1 Android Development] kurniawan77:
Brut...

Having the same issue as he_stheone64 http://xdaforums.com/showpost.php?p=10442390&postcount=854

After compiling htc.com.resources for DesireHD 2.2.1 build i get these errors:

I: Building resources...
aapt: warning: string 'htc_day' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\darkcom.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_hour' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\darkcom.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_minute' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\darkcom.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_month' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\darkcom.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_year' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\darkcom.htc.resources.apk\res; found: zh_HK
I: Building apk file...

Mostly everything is fine, except...

I have also lost 'Settings'! No where to find and no way to acces it. Also i have an app installed LaunchKey by Appelflap, i had it mapped to settings and it just FC's! No further probs, only no more settings...
[G1 Android Development] max1919:
ok, I can unpack app, but when I try to repack it back I get empty file. How can I fix that?
[G1 Android Development] Funnyface19:
ive gotten that error too, i took a framework-res.apk from a working ROM, decompiled it and before removing anything do apktool build ......\framework-res.apk and i get several errors saying aapt: warning: string 'usb_storage_stop_button_unmount' has no default translation in C:\........\res; found: en_GB and alot more like that

however it produced a framework-res.apk but not correctly i dont think because when i put it back into my phone it bootloops
[G1 Android Development] bdemartino:
I believe the workaround for this is to use the previous version
[G1 Android Development] he_stheone64:
@brut - this might help you to find the reason, why the latest com.htc.resources on DHD 1.72 fails to load settings. I decompiled the apk and then recompiled without any changes. Then I compared the entire res folder. All is identical, except arrays.xml in values-vi folder

I compiled with apktool 1.31

apktool adds a few "amp" to some lines under htc weather conditions in that file

<item>Nhiều mây &amp; mưa rải rác</item>

<item>Nắng &amp; mưa rải rác</item>

<item>Bão có sấm chớp</item>

<item>Nhiều mây&amp;mưa với sấm chớp</item>

<item>Có nắng rải rác &amp; mưa với sấm chớp</item>

<item>Mưa</item>

<item>Mưa giông</item>

<item>Nhiều mây &amp; mưa giông</item>

<item>Nắng rải rác &amp; mưa giông</item>

changes to:

<item>Nhiều mây &amp;amp; mưa rải rác</item>

<item>Nắng &amp;amp; mưa rải rác</item>

<item>Bão có sấm chớp</item>

<item>Nhiều mây&amp;amp;mưa với sấm chớp</item>

<item>Có nắng rải rác &amp;amp; mưa với sấm chớp</item>

<item>Mưa</item>

<item>Mưa giông</item>

<item>Nhiều mây &amp;amp; mưa giông</item>

<item>Nắng rải rác &amp;amp; mưa giông</item>

this:

<item>Có mây rải rác &amp; mưa rào</item>

<item>Nhiều mây &amp; mưa rải rác</item>

<item>Có mây rải rác,mưa rào&amp;sấm chớp</item>

<item>Nhiều mây&amp;mưa với sấm chớp</item>

<item>Có mây rải rác &amp; mưa giông</item>

<item>Nhiều mây &amp; mưa giông</item>

changes to:

<item>Có mây rải rác &amp;amp; mưa rào</item>

<item>Nhiều mây &amp;amp; mưa rải rác</item>

<item>Có mây rải rác,mưa rào&amp;amp;sấm chớp</item>

<item>Nhiều mây&amp;amp;mưa với sấm chớp</item>

<item>Có mây rải rác &amp;amp; mưa giông</item>

<item>Nhiều mây &amp;amp; mưa giông</item>
[G1 Android Development] pendo:
Interesting....

So it looks like when apktool sees the special character "&" it sometimes is messing up the decoding, but not always. A good example is LatinIME...since we have easy access to the source files, I compared apktool output directly aosp. here's a few keyboard popup characters from /xml/kbd_symbols_black.xml:

aosp:

<Key
android:keyLabel="&" />
<Key
android:keyLabel="("
android:popupKeyboard="@xml/kbd_popup_template"
android:popupCharacters="[{<" />
<Key
android:keyLabel=")"
android:popupKeyboard="@xml/kbd_popup_template"
android:popupCharacters="]}>"
android:keyEdgeFlags="right" />

apktool 1.3.1:

<Key android:keyLabel="&amp;amp;" />
<Key android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="[{&amp;lt;" android:keyLabel="(" />
<Key android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="]}>" android:keyEdgeFlags="right" android:keyLabel=")" />

So it handled the ">" correctly, but not "<" or "&"
[G1 Android Development] Funnyface19:
ok i will try this today I've been getting so frustrated
[G1 Android Development] Aggie12:
I've been trying to recompile my framework-res.apk that I decompiled and changed the system colors to. I decompiled the file successfully into the 'out' folder. When I go to recompile the out folder I am in the directory that contains: out, aapt, apktool, apktool.jar. I run the command ./apktool b -f -d out This should compile the out folder and place it into ./dist/out.apk right? If needed here is my error log.

System: Mac OS X 10.6.6; Droid X; android sdk installed; no platforms added. I've been researching my problem on google and it has repeatedly led me back to this thread so hopefully you guys can help:confused:

W: Could not find sources
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /var/folders/GU/GUyVSEKEEPC-KDKfQfkudE+++TI/-Tmp-/APKTOOL6315766509460478931.tmp, -x, -S, /Users/michaelwilliams/androidsdk/tools/out/res, -M, /Users/michaelwilliams/androidsdk/tools/out/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /var/folders/GU/GUyVSEKEEPC-KDKfQfkudE+++TI/-Tmp-/APKTOOL6315766509460478931.tmp, -x, -S, /Users/michaelwilliams/androidsdk/tools/out/res, -M, /Users/michaelwilliams/androidsdk/tools/out/AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
Caused by: java.io.IOException: Cannot run program "aapt": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:466)
... 8 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:91)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 10 more
[G1 Android Development] KBanause:
aapt must be found in $PATH

And ./ normally isn't part of $PATH
[G1 Android Development] Aggie12:
Thanks for your speedy reply! Can you elaborate more either with text or a link for more information? It's just hard for me to figure all this out because most people it seems do this stuff on windows. :(
[G1 Android Development] KBanause:
Or Linux but then they know what they are doing ;)

easy way (within a terminal window):

$ cd PATH/TO/AAPT
$ export PATH=$PATH:`pwd`
$ cd PATH/TO/DECOMPILED/APK
$ java -jar PATH/TO/apktool.jar b DECOMPILED_APK new.apk
[G1 Android Development] tommytomatoe:
Hey everybody,

I am on a Mac and have apktool in its correct place. I've read through the the thread and cannot find the answer to this. I get this error:

Tommy-Nguyens-iMac:~ Tommy$ apktool if /Users/Tommy/Desktop/Rosie_MOD/com.htc.resources.apk evo

I: Framework installed to: /Users/Tommy/apktool/framework/2-evo.apk

Tommy-Nguyens-iMac:~ Tommy$ apktool d /Users/Tommy/Desktop/Rosie_MOD/Rosie.apk I: Baksmaling...

Exception in thread "main" java.lang.NoSuchFieldError: dontLoadClassPath

at brut.androlib.mod.BaksmaliMod.disassembleDexFile(Unknown Source)

at brut.androlib.src.SmaliDecoder.decode(Unknown Source)

at brut.androlib.src.SmaliDecoder.decode(Unknown Source)

at brut.androlib.Androlib.decodeSourcesSmali(Unknown Source)

at brut.androlib.ApkDecoder.decode(Unknown Source)

at brut.apktool.Main.cmdDecode(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Thank you for your help in advance. Do I need to set java in my class path?

Edit: It's been taken care of! Woot woot. I just added smali, baksmali, and the latest aapt to /usr/local/bin. I am so happy!
[G1 Android Development] Aggie12:
ok I keep AAPT in my /Users/myname/androidsdk/tools/aapt.

I cd to my tools directory and then executed "export PATH=$PATH:./aapt"

then ran the java line to build my apk and I got the following errors.

W: Could not find sources
I: Building resources...

(skipping hidden file '/Users/michaelwilliams/androidsdk/tools/out/res/.DS_Store')
(skipping hidden file '/Users/michaelwilliams/androidsdk/tools/out/res/drawable-hdpi/.DS_Store')
aapt: warning: string 'daily' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'debug' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'every_weekday' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'googlewebcontenthelper_loading' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'grant_credentials_permission_message_desc' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'grant_credentials_permission_message_with_authtokenlabel_desc' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'monthly' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'permdesc_backup_data' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'permdesc_restartPackages' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'permlab_backup_data' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'permlab_restartPackages' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'usb_storage_button_unmount' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'usb_storage_stop_button_unmount' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'weekly' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
aapt: warning: string 'yearly' has no default translation in /Users/michaelwilliams/androidsdk/tools/out/res; found: en_GB
I: Building apk file...

What's all this mean. And thanks for your help. I'm trying to learn and I want to learn. I feel like this is the stuff that should be taught in high schools lol
[G1 Android Development] pendo:
It means exactly what it says :) The first couple errors are caused by mac leaving it's crap (.DS_Store) where ever it goes (I'm on a mac, too, and it gets real annoying). Then the rest is saying that you have strings in whatever that "en_GB" folder is that don't have the the translation to them in the default folder.
[G1 Android Development] chrisexv6:
Im able to decompile an APK but when I go to sign it its ending up larger than the original and then package installer complains about a parser error.

Looking at the reassembled APK in WinZip, I see an extra folder at the root called "assets", with the contents of the original APK inside that directory. Checking aLogCat on the phone, the parser fails because it cant find AndroidManifest.xml at the root of the APK.

Is there a command line switch that I need to use for aapt to get the files to end up at the root instead of under the assets folder?

Thanks

-Chris