Does anyone know how to edit Settings.apk? [Solved!]

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
I've been trying to do this for some time, but I've hit a wall. I want to take the Settings.apk from my current rom (which ever one it happens to be). Decompile it. Edit some entries. Then recompile and sign it, so that I can use it with said rom.

I've tried using apktool (and a few automated versions of it). It works great to decompile and recompile. I then use signapk.jar to sign the apk using a test key. But when I copy Settings.apk over to my /system/app folder, change the permissions, and reboot, the settings menu fails to load and my wallpaper disappears.

I thought that it might be edits I am making. So I tried decompiling, recompiling, and signing with no edits and I still get the same problem where the settings menu fails to load.

I even tried following this crazy guide: [HOW-TO] Modify the Keyboard and Screen Timeouts Settings
But I had the same problem.

I have successfully used apktool and my signing tool to edit and use other apk files. So I know that they work. Can anyone (probably a dev) explain what I'm doing wrong?

Thanks!

Update: Solution
 
Last edited:

JerryScript

Daydream Believer
Mar 8, 2011
2,055
1,559
0
Visit site
Have you tried apk_manager, which I believe uses akptool? It has an option to decompile with dependencies. Perhaps you can track down which other files you need with it?
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
I tried signing all the system apps and clearing the dalvik cache but the system refuses to boot. I'll give apk_manager a try thanks!
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
I figured out the problem! Oddly enough, it was the signing that broke it. When I didn't sign the Settings.apk it worked fine. I used apk manager 4.9. I then decompiled the apk. Did my edits. Compiled it and told the program it was a system apk. I deleted the files I changed from the keep folder along with resources.arsc. I then DIDN'T sign it, and pushed it to my /system/app folder. Rebooted and everything worked.

If anyone is interested in it, here is my Settings.apk from the Nameless rom v1: Settings.apk

It has the privacy menu removed and it has the tether settings added to the wireless menu. No need to have a tether app or launcher pro, and no chance of accidentally doing a factory reset.

Thanks guys!
 
Last edited:
  • Like
Reactions: 00damedash

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
Make a cm7 one without privacy<3

Sent from my Optimus V

Here is how you can do it yourself:
  1. Download: Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux) - xda-developers
  2. Get your Settings.apk off of your phone either with root explorer or adb:
    Code:
    adb pull /system/app/Settings.apk
  3. Keep a copy of Settings.apk somewhere safe.
  4. Place one copy into the "place-apk-here-for-modding" folder in apk manager.
  5. Run Script.bat.
  6. Enter option 22.
  7. Select the Settings.apk
  8. Enter option 9.
  9. Open folder projects\Settings.apk\res\xml\
  10. Open settings.xml in notepad or any other simple text editor.
  11. Remove these lines:
    Code:
       <com.android.settings.IconPreferenceScreen android:title="@string/privacy_settings" android:key="privacy_settings" settings:icon="@drawable/ic_settings_privacy">
            <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.PrivacySettings" />
      </com.android.settings.IconPreferenceScreen>
  12. Save the file.
  13. Enter option 11 in app manager.
  14. Enter "y" (yes) for if this is a system apk.
  15. Enter "y" for the next option too.
  16. Open the newly created "keep" folder inside of your app manager folder.
  17. Delete resources.arsc
  18. Then delete keep\res\xml\settings.xml
  19. Go back to app manager and hit enter to continue.
  20. Look inside "place-apk-here-for-modding" and find your newly created "unsignedSettings.apk"
  21. I used this file and it worked great. Signing it broke it for some reason.
  22. Copy "unsignedSettings.apk" to the folder that contains adb.exe and rename it to "Settings.apk"
  23. Open command prompt and enter:
    Code:
    adb remount
    adb push Settings.apk /system/app/Settings.apk
    adb shell chmod 644 /system/app/Settings.apk
    adb reboot

If everything went right, your settings should load like normal but privacy should be gone now. If something went wrong, your wallpaper will be gone and settings will not load. Retrace your steps in that event. Maybe try signing the apk. Who knows why only the unsigned version works for me?
 
Last edited:

JerryScript

Daydream Believer
Mar 8, 2011
2,055
1,559
0
Visit site
Hmmm, I've been trying to mod the Swype keyboard with no luck, and I always signed it too. Maybe leaving it unsigned will work for Swype as well. Thanks!
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
im not sure where 2 point u to but im sure its in the stock optimus t roms

That camera app is actually not created by lge. It is a proprietary program made by Olaworks.

I've gotten it to load and open on my phone, but it's not made to work with our camera drivers. I can't get any sort of image to load. It'll require the work of one of the devs to make it work. It is not a simple task.


on a side note, their official camera looks interesting: https://market.android.com/details?id=com.olaworks.scansearch&feature=search_result
 
  • Like
Reactions: 00damedash

00damedash

Well-known member
Feb 9, 2011
48
0
0
Visit site
That camera app is actually not created by lge. It is a proprietary program made by Olaworks.

I've gotten it to load and open on my phone, but it's not made to work with our camera drivers. I can't get any sort of image to load. It'll require the work of one of the devs to make it work. It is not a simple task.


on a side note, their official camera looks interesting: https://market.android.com/details?id=com.olaworks.scansearch&feature=search_result

:'( PLEASE I HOPE HIS EFFORT ENCOURAGES A DEV 2 PORT THIS .APK


p.s thanks 4 trying :cool:
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
Here is an Engrish translation of that Olaworks app I found: com.olaworks.scansearcheng.apk

It's kind of interesting. It is a location based camera app. You can take pictures of books, buildings, people..etc. and then search through your pictures using names. It'll also scan barcodes, locate businesses around you, and show you online prices for items you are looking at.
 

dburg

Well-known member
Feb 19, 2011
92
58
0
Visit site
is there ANYWAY 2 port the lg Camera.apk? that is WAYYYYYYYYYYYYY better than the 1's that come in most roms



EXCEPT CM7 lol
You can try the MIUI camera. This apk installs fine along side the other camera.
Here: MIUI Camera

Also Camera 360 has a few cool options.

There is a way to mod the camera to use a higher resolution i.e. 480x320. You'd have to mess with the internals but it should be able to be done. As it was done on the HTC Hero CDMA.

If VM/LG drops GB source updated libs should help.
 
  • Like
Reactions: mmarz

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
You can try the MIUI camera. This apk installs fine along side the other camera.
Here: MIUI Camera

Also Camera 360 has a few cool options.

There is a way to mod the camera to use a higher resolution i.e. 480x320. You'd have to mess with the internals but it should be able to be done. As it was done on the HTC Hero CDMA.

If VM/LG drops GB source updated libs should help.

Thanks! That is a nice camera app, and it does video too. Is there any native way to make the camera button launch it?

I figured out a work around by using Tasker, but this is not ideal.
 

00damedash

Well-known member
Feb 9, 2011
48
0
0
Visit site
You can try the MIUI camera. This apk installs fine along side the other camera.
Here: MIUI Camera

Also Camera 360 has a few cool options.

There is a way to mod the camera to use a higher resolution i.e. 480x320. You'd have to mess with the internals but it should be able to be done. As it was done on the HTC Hero CDMA.

If VM/LG drops GB source updated libs should help.

THANKS!!!! its fire
 
Last edited:

deaver_92

Member
Mar 17, 2011
12
2
0
Visit site
Here is how you can do it yourself:
  1. Download: Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux) - xda-developers
  2. Get your Settings.apk off of your phone either with root explorer or adb:
    Code:
    adb pull /system/app/Settings.apk
  3. Keep a copy of Settings.apk somewhere safe.
  4. Place one copy into the "place-apk-here-for-modding" folder in apk manager.
  5. Run Script.bat.
  6. Enter option 22.
  7. Select the Settings.apk
  8. Enter option 9.
  9. Open folder projects\Settings.apk\res\xml\
  10. Open settings.xml in notepad or any other simple text editor.
  11. Remove these lines:
    Code:
       <com.android.settings.IconPreferenceScreen android:title="@string/privacy_settings" android:key="privacy_settings" settings:icon="@drawable/ic_settings_privacy">
            <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.PrivacySettings" />
      </com.android.settings.IconPreferenceScreen>
  12. Save the file.
  13. Enter option 11 in app manager.
  14. Enter "y" (yes) for if this is a system apk.
  15. Enter "y" for the next option too.
  16. Open the newly created "keep" folder inside of your app manager folder.
  17. Delete resources.arsc
  18. Then delete keep\res\xml\settings.xml
  19. Go back to app manager and hit enter to continue.
  20. Look inside "place-apk-here-for-modding" and find your newly created "unsignedSettings.apk"
  21. I used this file and it worked great. Signing it broke it for some reason.
  22. Copy "unsignedSettings.apk" to the folder that contains adb.exe and rename it to "Settings.apk"
  23. Open command prompt and enter:
    Code:
    adb remount
    adb push Settings.apk /system/app/Settings.apk
    adb shell chmod 644 /system/app/Settings.apk
    adb reboot

If everything went right, your settings should load like normal but privacy should be gone now. If something went wrong, your wallpaper will be gone and settings will not load. Retrace your steps in that event. Maybe try signing the apk. Who knows why only the unsigned version works for me?

Thank you so much for posting this walk-through. I was trying to change the icons in the settings menu to the ICS icons and for some reason it wasn't working. After reading the walk-through (and testing) I realized it was because I was entering "n" on the second question after compiling. Now my settings menu looks awesome! :D
 

tuxfamily

New member
Jun 6, 2012
2
0
0
Visit site
Hello.

Thanks you for this walk-through but the procedure seems to be different on linux, with apk manager 5.0

The Apk Mananger menu look like this:
Code:
****************************** Apk Manager *******************************
------------------Simple Tasks Such As Image Editing----------------------
  0    Adb pull
  1    Extract apk
  2    Optimize images inside (Only if "Extract Apk" was selected)
  3    Zip apk
  4    Sign apk (Dont do this if its a system apk)
  5    Zipalign apk (Do once apk is created/signed)
  6    Install apk (Dont do this if system apk, do adb push)
  7    Zip / Sign / Install apk (All in one step)
  8    Adb push (Only for system apk)
-----------------Advanced Tasks Such As Code Editing-----------------------
  9    Decompile apk
  10   Compile apk
  11   Sign apk
  12   Install apk
  13   Compile apk / Sign apk / Install apk (All in one step)
---------------------------------------------------------------------------
  14   Batch Optimize Apk (inside place-apk-here-to-batch-optimize only)
  15   Sign an apk        (inside place-apk-here-for-signing folder only)
  16   Batch optimize ogg files (inside place-ogg-here only)
  17   Quit
****************************************************************************

So, I've tried to modify my Settings.apk (to include french translations removed in my chinese roms ...), simply with options 9 and 10 but it doesn't work.

In my android log I've this:
Code:
06-06 11:36:44.083: W/PackageManager(1249): Failed verifying certificates for package:com.android.settings
06-06 11:36:46.504: E/PackageManager(1249): Package com.google.android.backup has no signatures that match those in shared user android.uid.system; ignoring!
06-06 11:36:48.590: E/PackageManager(1249): Package com.google.android.location has no signatures that match those in shared user android.uid.system; ignoring!
06-06 11:36:50.700: W/PackageManager(1249): System package com.android.settings no longer exists; wiping its data

If you've any idea of what I can do, I take :)
Thanks.

EDIT: Got it working with apktool and 7z
I've followed (a good part of) this tuto:
http://forum.xda-developers.com/showthread.php?t=1576565
Now my settings are in french ... awesome ;)
 
Last edited:

nouhaghribi

New member
Sep 12, 2012
2
0
0
Visit site
Please i need to remove the Item " Bluetooth " from settings => wireless & networks . please can someone help me . i edit wirelesssettings.xml and wirelesssettings.smali but when i install the application i found an error " application not installed " .i try to sign my application but also the same error . Thanks :'(