yashsingh1/xdaforums huggingface dataset:
[Android General] ejhay007:
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 15, --target-sdk-version, 15, -F, C:\Users\EDWILJ~1\AppData\Local\T
emp\APKTOOL6604583191257506242.tmp, -I, C:\Users\Edwil Jerome\apktool\framework\
1.apk, -S, C:\apktools\Settings\res, -M, C:\apktools\Settings\AndroidManifest.xm
l]
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, 15, --target-sdk-version, 15, -F, C:
\Users\EDWILJ~1\AppData\Local\Temp\APKTOOL6604583191257506242.tmp, -I, C:\Users\
Edwil Jerome\apktool\framework\1.apk, -S, C:\apktools\Settings\res, -M, C:\apkto
ols\Settings\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, 15, --target-sdk-version, 15, -F, C:\Users\EDWILJ~1\AppData\Local\Tem
p\APKTOOL6604583191257506242.tmp, -I, C:\Users\Edwil Jerome\apktool\framework\1.
apk, -S, C:\apktools\Settings\res, -M, C:\apktools\Settings\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:355)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2
, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more

what's the problem? :(
[Android General] Quinny899:
You don't have aapt in the same folder as apktool
[Android General] CosTuMe:
ERRORS :S

i get lots of this kind errors when i decompile the app

W: Could not decode attr value, using undecoded value instead: ns=android, name=widgetLayout, value=0x02030015W: Could not decode attr value, using unadecoded value instead: ns=android, name=widgetLayout, value=0x02030015

plz help :S
[Android General] Quinny899:
Install your device's framework-res to it
[Android General] CosTuMe:
it worked! but now when i recompile the error is:

C:\Users\Pinat-Avoda\Downloads\apktool1.5.2>java -jar apktool.jar b SecSettings
I: Copying classes.dex file...
I: Checking whether resources has changed...
I: Building resources...
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\PINAT-~1\AppData\Local\T
emp\APKTOOL4054981324411249649.tmp, -0, arsc, -I, C:\Users\Pinat-Avoda\apktool\f
ramework\1.apk, -I, C:\Users\Pinat-Avoda\apktool\framework\2.apk, -S, C:\Users\P
inat-Avoda\Downloads\apktool1.5.2\SecSettings\res, -M, C:\Users\Pinat-Avoda\Down
loads\apktool1.5.2\SecSettings\AndroidManifest.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\PINAT-~1\AppData\Local\Temp\APKTOOL4054981324411249649.tmp, -0, arsc, -I,
C:\Users\Pinat-Avoda\apktool\framework\1.apk, -I, C:\Users\Pinat-Avoda\apktool\
framework\2.apk, -S, C:\Users\Pinat-Avoda\Downloads\apktool1.5.2\SecSettings\res
, -M, C:\Users\Pinat-Avoda\Downloads\apktool1.5.2\SecSettings\AndroidManifest.xm
l]
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\PINAT-~1\AppData\Local\Tem
p\APKTOOL4054981324411249649.tmp, -0, arsc, -I, C:\Users\Pinat-Avoda\apktool\fra
mework\1.apk, -I, C:\Users\Pinat-Avoda\apktool\framework\2.apk, -S, C:\Users\Pin
at-Avoda\Downloads\apktool1.5.2\SecSettings\res, -M, C:\Users\Pinat-Avoda\Downlo
ads\apktool1.5.2\SecSettings\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:355)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2
, ???????? ??? ?????? ???? ?? ?║??? ?????
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, ???????? ??? ?????? ????
?? ?║??? ?????
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
[Android General] Quinny899:
There seems to be a problem with aapt. Try updating it with the latest version from your SDK install
[Android General] CosTuMe:
I only started dealing with apk's..

I moved the aapt.exe to the apktool folder and it fixed all the errors.

but when I opened cmd again and installed the frameworks, ran the recompile line againand then it just says:

I: Checking whether resources has changed...
I: Building resources...

opens aapk

closing it and moving on. (there is no apk)
[Android General] Quinny899:
It's not finished building yet. Wait for it to finish and return to the command line, then check the "dist" folder
[Android General] CosTuMe:
after closing the aapt its returning to the cmd and writes:

C:\Users\Pinat-Avoda\Downloads\apktool1.5.2>

but nothing on the "dist" folder
[Android General] Quinny899:
aapt shouldn't open, what exactly are you running?
[Android General] CosTuMe:
opened cmd installed frameworks and the i write:

java -jar apktool.jar b Settings
[Android General] Quinny899:
That should build it fine, so does it say something like this:

I: Checking whether sources has changed...

I: Checking whether resources has changed...

I: Building resources...

I: Building apk file....

?
[Android General] CosTuMe:
only this two:

I: Checking whether resources has changed...

I: Building resources...
[Android General] Quinny899:
Then what? It jumps back to the command line?
[Android General] CosTuMe:
opens the aapt.exe in cmd like window and jumps back to the command line
[Android General] Quinny899:
That must be it building the resources then, is there any text in the aapt window?
[Android General] CosTuMe:
nop it just opens wait a minut or two and closes
[Android General] Quinny899:
Very weird. This sounds like an apktool issue, I recommend you go to the apktool google code site and look there, you can get better help that way
[Android General] beekay201:
[MENTION=3563640]Quinny899[/MENTION], nicely put together man, should be quite helpful, and quite a few pointers for source builders that are starting up.

:good::good:
[Android General] LuigiBull23:
Don't know how I missed this. Thanks a lot Quinny!
[Android General] brando56894:
Awesome tutorial! I've always wondered how this was done but never really cared to research it that much. I usually just let the rom chefs do what they do best!
[Android General] Quinny899:
Try decompiling with the --keep-broken-resources (or --keep-broken-res, can't remember) flag, might help
[Android General] codexc:
command synatx ?

java -jar apktool.jar d -t --keep-broken-resources Settings.apk
[Android General] Quinny899:
That but Settings.apk
[Android General] codexc:
yes i tried

same error my friend :(
[Android General] masteriori:
Will someone plz be kind enough to remove 4 items from settings? I have attached my Settings.apk and have highlighted options which I would like have removed. As shown, I want to remove Setup guide, Power Saver Option, Location-based WiFi, and Media server settings.

Thank you in advance. :good:
[Android General] codexc:
you need to attach your framework too , then see if anyone can help you
[Android General] anerik:
Amazing guide! Changed icons and added some stuff to settings, i think you should add this guide to OP:

http://xdaforums.com/showpost.php?p=40314833&postcount=2

If anybody adds something to settings it's more than useful ^^
[Android General] myn:
Great job documenting this. I know this may be trivial for experienced devs but it's these kinds of posts that gets newcomers into the game.

Thanks for sharing :)
[Android General] klacenas:
Just what i need. Thank you so much.
[Android General] Gertlily:
I can confirm that for me it doesn't work on Stock Samsung Galaxy s2 Touchwiz firmware... (odexed)

If I open the app (SecSettings.apk) I get the error that SystemUI stoppped working. And has closed. But even after placing back the old apk I still get the error. Hmm. Am I doing something wrong?
[Android General] Quinny899:
Can you post a Logcat?
[Android General] Quinny899:
There's some errors with arrays. Sort them and it should build
[Android General] masteriori:
I have attached my framework-res.apk too.
[Android General] codexc:
removed
[Android General] Zephyr!:
C:\Users\ashu\Desktop\apktool>apktool b Mms

I: Checking whether sources has changed...

I: Checking whether resources has changed...

I: Building resources...

C:\Users\ashu\Desktop\apktool\Mms\res\xml\widget_info.xml:2: error: No resour

ce identifier found for attribute 'widgetCategory' in package 'android'

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce

ption: could not exec command: [aapt, p, --min-sdk-version, 14, --target-sdk-ver

sion, 16, -F, C:\Users\ashu\AppData\Local\Temp\APKTOOL4794362550839636631.tmp

, -I, C:\Users\ashu\apktool\framework\1.apk, -S, C:\Users\ashu\Desktop\apk

tool\Mms\res, -M, C:\Users\ashu\Desktop\apktool\Mms\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:255)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)

at brut.androlib.Androlib.buildResources(Androlib.java:269)

at brut.androlib.Androlib.build(Androlib.java:192)

at brut.androlib.Androlib.build(Androlib.java:174)

at brut.apktool.Main.cmdBuild(Main.java:188)

at brut.apktool.Main.main(Main.java:70)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd

k-version, 14, --target-sdk-version, 16, -F, C:\Users\ashu\AppData\Local\Temp

\APKTOOL4794362550839636631.tmp, -I, C:\Users\ashu\apktool\framework\1.apk, -

S, C:\Users\ashu\Desktop\apktool\Mms\res, -M, C:\Users\ashu\Desktop\apktoo

l\Mms\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:253)

... 6 more

What's this?
[Android General] codexc:
[MENTION=3563640]Quinny899[/MENTION]

everythink working fine now after some help from Mr connor.tumbleson "APKTOOL DEV"

now the app not showing on list ,with sign our not

here my command:

java -jar signapk.jar -w testkey.x509.pem testkey.pk8 Settings-un.apk Settings-sign.apk

any suggest?
[Android General] Quinny899:
Use the platform key from zipsigner on the device, as in the OP
[Android General] codexc:
Zipsigner without align the apk ?

what the diffrent between Zipsigner and signapk.jar tool?
[Android General] Quinny899:
If you want to align it, sign it on the device, pull the signed apk, align that and then push it to the system
[Android General] codexc:
ok i will do now ...

---------- Post added at 09:24 PM ---------- Previous post was at 09:18 PM ----------

i want to tell you ..........................its works !!!!!!1
[Android General] Quinny899:
Awesome :cool:
[Android General] Envious_Data:
req

so i need some help

i typed this into my device_info_settings

<Preference android:title="@string/rom_header" android:key="rom_header" android:summary="@string/rom_name" style="?android:preferenceInformationStyle" />

<Preference android:title="@string/author_header" android:key="author_header" android:summary="@string/author_name" style="?android:preferenceInformationStyle" />

<preference android:title="@string/credit_header" android:key="credt_header" android:summary="@string/credit_name" style="?android:preferenceInformationStyle" />

and then this in my Strings

<string name="rom_header">Rom Name</string>

<string name="rom_name">Envi ROM S1 Alpha</string>

<string name="author_header">Developed By</string>

<string name="author_name">Envious_Data</string>

<string name="credit_header">Credits</string>

<string name="credit_name">EnviousDataswebsite.jimdo.com/credits</string>

everything compiles successfully but i get a FC when i try to open my About Device menu , am i doing something wrong?

ps ive tried signing the app as well (even with original signatures)

pps here is some useful info

Device Sony Xperia S

- latest Apktool installed (aapt and other stuff is also installed)

- using Ubuntu 12.04

- (unsure if this is neccisary) but i installd the APK via flashable

- yes i am new to this
[Android General] Primokorn:
Really beautiful work! :D

Thanks a lot for sharing. I'll try soon of course!!!
[Android General] iSaoHatake:
On CM10.1 on about we have a menu VIEW CHANGELOG when i click it take me to the CM changelog, how can i change this changelog to my rom?
[Android General] joshua.justice:
Any idea how to add an option to turn off the capacitive button lights?
[Android General] Quipper2008:
Hello,

i want to add Hardware-info in CM10.1 on my Nexus 4 located in About device / Hardware-info.

I click on Hardware-info and there i can see what Hardware the device have got.

E.g.

Processor

1.5 Ghz Quadcore

Display

4.7 inch 1280x768

Where i have to add the 4.7 inch / 1.5 Ghz Quadcore ....... text ?

Thanks for your help.
[Android General] soulyoghi:
Can i use this guide to ExMIUI setting

Can i use this guide to ExMIUI setting, i want to add My Xperia in ExMIUI setting//
[Android General] leyton01:
Could this method be used to restore the lock screen shortcut option that is missing on some Galaxy S4 firmwares?

http://xdaforums.com/showthread.php?t=2260677

I take it the option would have to be found on a phone that has it enabled and then transplanted to the settings of ones with it missing?
[Android General] as9333:
settings icon missing

problem with adding apps in settings. apk of galaxy ace s5830i

changed xml, values and add icon and signed. Replaced original settings with my settings after a reboot setting icon is missing

please help
[Android General] engkozhe:
I want to edit settings in .13 stock and remove some item , which one do i have to edit first?
[Android General] Quinny899:
Did you sign it correctly?
[Android General] as9333:
settings icon missing

signed with easy script

when exploring settings. apk it shows META-INF. when checking logcat while installing new settings it shows no activity found for '.......'
[Android General] Quinny899:
Read the OP, you can't sign with that, you must use the platform key
[Android General] as9333:
no settings icon in ace s5830i

can I use zipsigner. should I edit someting in public. xml
[Android General] Quinny899:
Use zipsigner as in the OP
[Android General] sinistersands:
I'm running into the same issue, only difference is, I'm getting this on my Mac. Out of curiosity, are you trying to change max mms resolution?
[Android General] as9333:
where is op?
[Android General] WindGhost:
Greetings,

First of all thank you for the nice and useful thread, everything is clear. I'm currently working on 2.3.1 Android version (need for my work), everything is working fine with me, but I just need to know how to work with sub menus. I need to add my_menu.xml and my_menu.java, how to do this in a way that will Settings.apk will work fine?!

Regards,,,

---------- Post added at 04:09 PM ---------- Previous post was at 04:08 PM ----------

OP is the first post of the thread :)
[Android General] as9333:
no settings icon

recompiled the settings again and signed with zipsigner in OP selected key platform

signed. no icon appearing in menu. In logcat it shows

PackageManager(1544): Signature mismatch for shared user : SharedUserSetting{405643d0 android.uid.system/1000}

07-09 17:12:15.459: E/PackageManager(1544): Package com.android.settings has no signatures that match those in shared user android.uid.system; ignoring!
[Android General] Kerns_JW:
In your current settings.apk is there a sub menu? Just reverse engineer what was done previously. "Header" tags denote your main settings screen where "preferencescreen" tags are used to denote your sub pages. To open a menu within settings and not separately like an app, you would enter in the reference as an android:fragment with an action vs using android:target classes like he outlined.
[Android General] WindGhost:
You did not notice that I'm working on 2.3.1 Android version not 4.0 +
[Android General] Kerns_JW:
No sorry to early the am
[Android General] Canute:
I'm running 4.1.2 on an S3 and it doesn't have a Settings.apk?
[Android General] WindGhost:
May be another name, I got a device that Settings.apk renamed into Settings_Malai.apk. So you need to search.
[Android General] arpitkh96:
can u tell me how to edit background of particularly settings.apk
[Android General] SuppsDev:
Hi, i'm working here with an Xperia Pro here on 4.0.4 ICS,

Everything works fine, decompiling, modding, compiling back and signing, but when i push the signed apk in /system/app and reboot, the settings disappears from the app drawer, and if i try to get into settings using the status bar shortcut then System UI force closes and restarts a couple seconds later. I have to say that i've noticed that a modded apk and signed is significantly smaller in size than the original apk. The original is 8.46 MB and the modded and signed one is 7.90 MB and this is not because of me removing resources and stuff because i've tested that, i've decompiled the original Settings.apk and then compiled and signed it back and it was still 7.90 MB in size although nothing was changed. Also i have to specify that i've signed it with ZipSigner in platform mode as told in the first post.

Thanks..
[Android General] Jamison904:
For the S3 and newer firmware for most Samsung devices they renamed it to SecSettings.apk
[Android General] as9333:
cannot compile

I decompiled settings.apk and modded

When compiling settings it shows no resources found

What should i install .already installed framework-res.apk and twframework-res.apk

Stock rom 2.3.6

Samsung galaxy ace s5830i
[Android General] Sami Kabir:
Does anyone know how to add (current) RAM and CPU to About Phone section - just like CyanogenMOD has..?
[Android General] draganz:
woow. thanks a lot for guide. I did this. But Settings apk not appear in Home because of permission problem. Otherwise it worked for me
[Android General] Nicene Nerd:
How can I add a toggle like the Wi-Fi and Bluetooth settings items have?
[Android General] Adizzzle:
I couldn't figure out how to change one of the battery icon style names in my ROM. Would appreciate any help at all.
[Android General] Quinny899:
You can't without rebuilding from source

Check the strings for your language
[Android General] madquack:
Try adding this to res/xml/device_info_settings.xml

<Preference android:title="@string/cpu_info" android:key="device_cpu" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/mem_info" android:key="device_memory" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />

and this to res/values/strings.xml

<string name="cpu_info">CPU</string>
<string name="mem_info">Memory</string>

Recompile and see if that works.
[Android General] parkhajoon:
Nice guide thanks.
[Android General] Sami Kabir:
Hey mate, I just tried what you told me to do... unfortunately it didn't work... Under CPU and RAM, it simply says "Unknown" :eek:
[Android General] drew1ind:
Error when recompiling

C:\apktool>java -jar apktool.jar b Settings
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\apktool\Settings\res/layout-sw600dp
invalid resource directory name: C:\apktool\Settings\res/layout-sw600dp-land
invalid resource directory name: C:\apktool\Settings\res/layout-sw720dp
invalid resource directory name: C:\apktool\Settings\res/values-sw600dp
invalid resource directory name: C:\apktool\Settings\res/values-sw600dp-land
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\drew1ind\AppData\Local\Tem
p\APKTOOL6221948004575233215.tmp, -I, C:\Users\drew1ind\apktool\framework\1.apk,
-S, C:\apktool\Settings\res, -M, C:\apktool\Settings\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\drew1ind\AppData\Local\Temp\APKTOOL6221948004575233215.tmp, -I, C:\Users\dr
ew1ind\apktool\framework\1.apk, -S, C:\apktool\Settings\res, -M, C:\apktool\Sett
ings\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more

Help?
[Android General] Quinny899:
Update your apktool
[Android General] RafaelPSouto:
What about removing System Update Entry? Tried to temove those lines but after that, i cant enter on the About menu, giving FC.

<PreferenceScreen android:title="@string/system_update_settings_list_item_title" android:key="system_update_settings" android:summary="@string/system_update_settings_list_item_summary">
<intent android:action="android.settings.SYSTEM_UPDATE_SETTINGS" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/software_update" android:key="software_update" />
<PreferenceScreen android:key="mota_system_update" android:summary="@string/mota_system_update_summary">
<intent android:action="com.mediatek.intent.GoogleOtaClient" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/scomo_settings_title" android:key="scomo" android:summary="@string/software_updates_scomo_summary">
<intent android:targetPackage="com.mediatek.dm" android:action="android.intent.action.MAIN" android:targetClass="com.mediatek.dm.scomo.DmScomoActivity" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/additional_system_update_settings_list_item_title" android:key="additional_system_update_settings">
<intent android:targetPackage="@string/additional_system_update" android:action="android.intent.action.MAIN" android:targetClass="@string/additional_system_update_menu" />
</PreferenceScreen>
[Android General] drew1ind:
Thanks.

Sorry if late response, I had to go.

I tried it as soon as I read it.

It built fine, but it took around 5 minutes.