yashsingh1/xdaforums huggingface dataset:
[Android Software Development] sagementor:
plurals.xml when compiling framework-res.apk

I saw this post from a chinese website.

To fix plurals.xml error

Edit framework-res.apk/res/values/plurals.xml

framework-res.apk/res/values-zh-rCN/plurals.xml

framework-res.apk/res/values-*/plurals.xml e.g. all plurals.xml files (painful!!)

From

<plurals name="matches_found">
<item quantity="other">[color=Red]%d of %d[/color]</item>
<item quantity="one">1 match</item>
</plurals>

To

<plurals name="matches_found">
<item quantity="other">[color=Red]%1$d of %2$d[/color]</item>
<item quantity="one">1 match</item>
</plurals>

Another post I found say changing to the following.

<plurals name="matches_found">

<item quantity="other">%d of %%d</item>

<item quantity="one">1 match</item>

</plurals>
[Android Software Development] Arya_3RDNumber:
Can this method works on MIUIv4 ROM?
[Android Software Development] rashid.fairus:
yup,all ics,including jb..
[Android Software Development] omnomnomkimiiee:
Would anyone mind doing this for me ?

I don't have a computer ...

Running CM9 RC1 on a HTC Wildfire S.
[Android Software Development] gaetanolip:
Anyone tried it on samsung galaxy s3 with success?

Inviato dal mio GT-I9300 con Tapatalk 2
[Android Software Development] Arya_3RDNumber:
But,,if I view framework-res.apk with root explorer,"values" folder doesnt visible,,is it normal?
[Android Software Development] bswann:
You have to decompile it to see the values folder.
[Android Software Development] Arya_3RDNumber:
Thanks,,now I not doubt to do experiment :)
[Android Software Development] RL77LUC:
I've this error :

W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/drawable-sw600dp-hdpi
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/layout-sw600dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/layout-w600dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-h720dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-sw600dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-sw600dp-land
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-sw600dp-w1024dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-sw600dp-w1280dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-w360dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-w480dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-w500dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-w600dp
invalid resource directory name: C:\Users\Romain\Desktop\Onscreenbtns\framework-
res\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Romain\AppData\Local\Temp\
APKTOOL5960158090676818728.tmp, -x, -S, C:\Users\Romain\Desktop\Onscreenbtns\fra
mework-res\res, -M, C:\Users\Romain\Desktop\Onscreenbtns\framework-res\AndroidMa
nifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Romain\AppData\Local\Temp\APKTOOL5960158090676818728.tmp, -x, -S, C:\Users\
Romain\Desktop\Onscreenbtns\framework-res\res, -M, C:\Users\Romain\Desktop\Onscr
eenbtns\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more

I have Apktools 1.4.2 ... Please help me.
[Android Software Development] mattmanwrx:
Have u installed the framework?
[Android Software Development] asp2010:
How have you done it? I've tried all combinations of compile - decompile with 1.4.3 and 1.4.2, this is what I get (looks like your error from above):

W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\android-sdk\apktool\work\res/drawable-sw600d
p-hdpi
invalid resource directory name: C:\android-sdk\apktool\work\res/layout-sw600dp
invalid resource directory name: C:\android-sdk\apktool\work\res/layout-w600dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-h720dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-sw600dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-sw600dp-
land
invalid resource directory name: C:\android-sdk\apktool\work\res/values-sw600dp-
w1024dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-sw600dp-
w1280dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-w360dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-w480dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-w500dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-w600dp
invalid resource directory name: C:\android-sdk\apktool\work\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\andrei\AppData\Local\Temp\
APKTOOL4738884523625011341.tmp, -x, -S, C:\android-sdk\apktool\work\res, -M, C:\
android-sdk\apktool\work\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\andrei\AppData\Local\Temp\APKTOOL4738884523625011341.tmp, -x, -S, C:\androi
d-sdk\apktool\work\res, -M, C:\android-sdk\apktool\work\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more

EDIT: I have found the solution here and managed to recompile the framework. I wiped the dalvik cache, but now I'm stuck at the boot animation. Any help is greatly appreciated! Thanks!
[Android Software Development] RL77LUC:
If you stuck at bootanims, your framework-res is buggy. And, it's recommanded to decompile with 1.4.2 and recompile with 1.4.3 ;).

For framework-res, take the original file, and put "resources.arsc" of the custom one in the original.

It worked for me ...
[Android Software Development] asp2010:
I did decompile with 1.4.2 and recompile with 1.4.3, it's the only way I got it to recompile in the end. Don't you mean take the resources.asrc from the original (unmodified) file and put in the recompiled one? Or do you mean take the one from the recompiled file, put it in the original file, and use the original file on the phone? :confused: Btw, adding it with 7-zip works (no need to decompile), right? Thanks!

EDIT: After I submitted the post I realized there was no point in using the original resources.arsc :D So I copied the one from the modded apk just like you said and I now it booted and everything's working fine. Thanks a bunch!
[Android Software Development] TopDroid:
Can somebody please help me with editing framework-res.apk?

Please PM me and I will send you my framework-res.apk file!
[Android Software Development] mattmanwrx:
Upload your framework-res.apk here and I will take a look when I get a chance...
[Android Software Development] l.m.prowse:
:S

I've been trying to do this to the framework-res in jellybean, it decompiles but won't recompile, i tried decompiling with 1.4.2 and recompiling with 1.4.3 had no effect :( any ideas? :)
[Android Software Development] mattmanwrx:
Have u installed jellybean frameworks?

Also, there is a newer apktool - http://xdaforums.com/showthread.php?t=1755243 - 1.4.7, that should work with jellybean, well, it does with my jellybean apk's...
[Android Software Development] TopDroid:
Here's my framework-res apk:

http://www.mediafire.com/?emhv71me735g3br

Thanks!

Sent From My Galaxy SL Running CM9
[Android Software Development] mattmanwrx:
Sorry for delay! I actually forgot about this! :)

Try using this apk... You may have to either make a flashable.zip (use someone elses maybe?) or copy over with adb while the phone is in recovery!

Obviously, untested by me... Don't know the outcome!
[Android Software Development] TopDroid:
Thanks a lot!

Can i replace it with the original in system using root explorer?
[Android Software Development] mattmanwrx:
Ummm, I would of said its worth a try... someone posted on this thread that you shouldn't, as it will most likely boot loop... worth a try I guess...
[Android Software Development] asp2010:
Backup first. Try swapping the apk's, but your phone might reboot at some point after removing the original one and go into a bootloop. If you do manage to get the new one in as well, boot to recovery and wipe the dalvik-cache, then boot to Android. If it doesn't work, reboot to recovery, restore the backup and replace the files with adb.
[Android Software Development] TopDroid:
Replacing the apk rebooted the device and was stuck in bootloop . I am gonna try the other way and tell you ...

Sent From My Galaxy SL Running CM9
[Android Software Development] mattmanwrx:
OK, as I say, there are no guarantees that it will work, I just done the mod...
[Android Software Development] mattmanwrx:
Please put in

tags next, will make it a lot neater! :)

I think it is safe to delete public.xml, as it is recreated when building... try that maybe?

failing that, can you upload your framework-res?
[Android Software Development] mattmanwrx:
It built fine for me... However, my xda has really messed up so I cannot upload it (using phone to post this)...

Will also link to the apktool I used, it is in this thread, which gave me no errors... Will upload as soon as possible..
[Android Software Development] l.m.prowse:
Thanks :) My xda's been messing up too, could you write a few steps as to how you did it? just so I can check I'm actually doing it correctly :P

(I never had a problem with ics but you never know :P)

like, switching apktools for compiling/decompiling :)

Many thanks :)
[Android Software Development] mattmanwrx:
I logged out and logged in again and it now looks ok!! :)

anyway, Attached to the post is the .rar that contains your framework-res.apk, you will need to replace this yourself. Either create a flashable zip, or adb it over. You can try root explorer, but some people (see last post yesterday) say it can cause issues! Obviously untested by me, so please do take a backup (either nandroid or of your framework-res.apk)...

I just decompiled and recompiled (without any modification) using this apktool attached to this post... I then made the changes and compiled again, with no errors (again!)

Try with that apktool I linked to...!
[Android Software Development] l.m.prowse:
Thanks :D it worked! and the apktool worked as well :)
[Android Software Development] mattmanwrx:
No problem, glad it worked for you...

Am here to help! :cowboy:
[Android Software Development] santoshsadani009:
Hello,

I followed this guide and successfully added the on screen buttons to my CM9 build. However, i just want to ask, if there is a way i just get the Menu key, home key and the back key?

Thanks. Also, thanks for the amazing guide.
[Android Software Development] mattmanwrx:
So you want to remove the "Recent Apps" key - or replace it with a Menu button that is there full time?

If you want menu key there all the time, it will show on lockscreen too, all the time!!
[Android Software Development] santoshsadani009:
Yeah i wish i could get only those three keys (Used to samsung's key layout) . I guess i will have to stick with AOKP then. Anyways, thanks for the amazing guide. Very easy to understand for a guy (like me) who never tried modding!
[Android Software Development] mattmanwrx:
No no, you cando it... just the menu key will always show (unless you built from source, and can modifiy it yourself)...

Decompile SystemUI.apk - navigate to res/layout/navigation_bar.xml, and then you'll see all the xml writing...

The first linear layout is the first set of keys...

Highlighted below - Blue is Back, Red is Home, Sky Blue is Recent Apps, Magenta is Menu... The ones inbetwwen are spacing...

Obiously below is not a smiley, it is just that it is easier to view in quote tags than code tags!

You will need to play around with and make it all look how you want, you can delete, add or change how you want it!!

See the below screen shots I had of my old desire, with added buttons in too!

​

Need any help, feel free to post, I'll see if I can help!!
[Android Software Development] santoshsadani009:
Hey man, thanks for your help. appreciate it a lot!

I will modify the script as per you told me in your last post but first, i gotta solve the problems i have been having after compiling. I made edits to framework, compiled, and signed (it's not needed i guess) the apk.

After this, i booted to recovery, cleared dalvik cache, clear system data, and then pushed the Apk via Adb. And after it boots up, i can see the nav bar and even use it. but the trebuchet and android keyboard got FC. Did push and install nova via adb so i can work it, but nothing works. Everything FCs. Any solution?

Also, I read in this thread that the framework-res could be buggy. How can i know if it's buggy or not? I have attached the apk in this post below. Thanks for your help!
[Android Software Development] mattmanwrx:
Do you know if the permissions are correct? Maybe fix permissions in recovery?

Also, I have never ever signed any system app, just alway leave the signatures in place.. that could be it..? Maybe try again with signing?
[Android Software Development] santoshsadani009:
Thanks for your help so far man!! It looks promising! I'll try It as soon as i reach home.

Cheers.
[Android Software Development] santoshsadani009:
After looking for errors and compiling the framework again and again for nearly 6 hours restlessly, I finally managed to get it working without errors!! Works well and finally i can use the most stable ROM for my device easily (Capacitive keys are broken). I was pushing the framework-res to ROM zip and setting compression mode to normal, instead of store mode. Silly me!

And for the most amazing part, i asked how can i mod them to show menu keys at all times. Well, now, I don't need it anymore. As soon as i enable the navbar, CM9 gives me an option in system settings to customize what keys would i like to have in navbar. Awesome stuff!

Thanks mattmanwrx for your help! Thanks evilisto for this amazing guide.
[Android Software Development] mattmanwrx:
Glad it is working for you... Happy to help.. :)

Hopefully those features make it to cm10.. I haven't seen them yet...
[Android Software Development] neimovirne:
I did everything exactly as it was written in the instructions, but the virtual buttons are not there.

I use Galaxy Tab 7.7 . I wanted change DPI from 160 to 230, and use telephone interface on tablet like Nexus 7 with in-screen buttons but its not work((

anyone can help me?
[Android Software Development] mattmanwrx:
I have never been able to get the navigation bar to work on ANY Samsung touchwizz ROM... sorry...
[Android Software Development] neimovirne:
noo i use CM9 Rom
[Android Software Development] mattmanwrx:
Well as it is a tablet, I'm not sure how to get it working...

It could be to do with the density... not too sure...
[Android Software Development] asp2010:
What about Sense 4.0? Did you try and get it to work?
[Android Software Development] mattmanwrx:
Same thing, different files altogether.. would need a proper dev to look into it... sorry...
[Android Software Development] Brian_SGW_CM9:
how do you use the "apktool.jar 1.4.3"? and what is a jar file? How do i use it? btw i am a galaxy w user on cm9.
[Android Software Development] mattmanwrx:
clicky
[Android Software Development] Brian_SGW_CM9:
so i use them on the computer?
[Android Software Development] mattmanwrx:
Yes...

http://code.google.com/p/android-apktool/
[Android Software Development] Brian_SGW_CM9:
idk how to make it. but nvm i am using paranoid android with soft key. thanks :)
[Android Software Development] milence92:
somebody tried enabling buttons on galaxy 3 (not s3)? i tried but i get bootloop...don't know where is the problem
[Android Software Development] alen1901:
Search in your thread. I think i saw that mod there, but maybe its related to some ics rom. And what for you need that, screen is too small and without that. :P

Sent from SpeedMachine i9023
[Android Software Development] maxxie85:
how to add signature after recompiling?

I am using APK mulit tool and it says that it would copy over the signature from original apk but it doesn't

I'am trying to add sof-keys to this framework-res.apk https://docs.google.com/open?id=0B3aClDSb7ROsMEZDSHRYa3ZkNlU

Its a jelly bean framework but i cant add signature so its stuck at bootani
[Android Software Development] mattmanwrx:
Copy over the META-INF folder and contents to the new framework... See if that works...
[Android Software Development] maxxie85:
No didnt work stil stuck at bootanimation.
[Android Software Development] maxxie85:
okey I got signature, but it looks like when compiling it doesn't compile values. The size is also half as big as the original one. And I know that with better compressing the file can be a little smaller but 4.5 mb is a lot.
[Android Software Development] mattmanwrx:
How did u get the signature to copy over? The META-INF folder?

I have always had the file size smaller, and have just put it down.to different compression bales.. it has always worked for me...

Also, you say it doesn't include values, is that because you can't see in the .apk once built? If so values becomes resources.arsc which is why you can't see it... In the original .apk there is also no values folders, which is why you need to decompile it...
[Android Software Development] maxxie85:
apk mulit tool autmoticly copies over the meta inf folder from the original apk if you say it is a system apk.

YEAHH!!! it worked :D:D:D thanks for the help

softkeys on nikez-lente-Evervolv-Turba-3.0.0p6

Edit: the return key is bigger than the rest, anyone suggestions?
[Android Software Development] mattmanwrx:
Thanks for the info, I shall have to try that next time!!

I have also compiled Evervol from source for the bravo. I'm by no means a developer, but want to learn, and maybe, eventually, add a toggle for softkeys in the EV Toolbox...

Trying to compile it for one of my tablets first though, and then might try the HOX too...! Got a week off so will learn then, hopefully!! lol!
[Android Software Development] maxxie85:
Yes I know, I always used your mods for sandvold beta. Me neighter, I know a little bit of coding but that's it.

Do you know maybe why my back key is bigger than the rest of the buttons?

I also noticed that it change when keyboard is open. (See attachements)
[Android Software Development] mattmanwrx:
Well, at least they now have the keyboard error fixed - or did you make the dimentions of the navigation bar smaller? I used to half them (on Sandvolds rom). Can you also upload your SystemUI.apk for me to take a look at please?

The change when keyboard is open is a JellyBean feature, in stead of showing the back button (as youre not going back), it shows an arrow pointing down, to bring the keyboard down...!
[Android Software Development] maxxie85:
No the keybord error is fixed, Even with keyboard hight at 37. DIP the keyboard didn't overlap.

That the arrow down if a future of jelly bean i assumed. But maybe that is also the problem why its bigger

framework-res.apk

https://docs.google.com/open?id=0B3aClDSb7ROsZG9aUkJnclpwNU0

SystemUI.apk

https://docs.google.com/open?id=0B3aClDSb7ROsbFNSMXhxYWhSaGM
[Android Software Development] mattmanwrx:
Right then, in SystemUI.apk /res/layout/navigation_bar.xml is where the controlling of the navigation bar is...

The first Linear Layout is below. The only thing that shoots out to me is that I have not seen android:scaleType="center" (in red below) in there before. So it could be that! You could try taking that out I have taken that out and built the apk, see if that helps at all? It is still in the lights-out (when watching a video and the buttons change to a small dot), so you may need to take them out too...

<LinearLayout android:orientation="horizontal" android:id="@id/nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animateLayoutChanges="true">
<View android:visibility="invisible" android:layout_width="40.0dip" android:layout_height="fill_parent" android:layout_weight="0.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_back" [COLOR="Red"]android:scaleType="center"[/COLOR] android:layout_weight="0.0" android:contentDescription="@string/accessibility_back" systemui:keyCode="4" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/home" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_home" android:layout_weight="0.0" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:keyRepeat="false" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_weight="0.0" android:contentDescription="@string/accessibility_recent" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:visibility="invisible" android:layout_width="@dimen/navigation_menu_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_menu" android:layout_weight="0.0" android:contentDescription="@string/accessibility_menu" systemui:keyCode="82" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
</LinearLayout>

Attached is two pakages, one with the META-INF folder copied voer (I done it manually), and another that doesnt! As I said before, I have never copied over the signature, but made both for you!!
[Android Software Development] maxxie85:
Thanks, I have pushed the signed SystemUI.apk but it have made no difference. The back is still bigger than home and recent.