Post Reply

[TUTORIAL] How to add Autostarts Option in Settings

OP DaRk-L0rD

27th January 2014, 01:56 PM   |  #1  
DaRk-L0rD's Avatar
OP Recognized Contributor / Themer
Isla de Muerta
Thanks Meter: 4,934
 
2,009 posts
Join Date:Joined: Sep 2012
Donate to Me
More

Hello everyone

Today i will teach you how to add Autostarts





REQUIREMENTS:


STEPS:

1. Download the attachment.

2. Decompile your Settings.apk.

3. Navigate to res\xml\settings_headers.xml


Now add the following line (Make sure that there is no space between autostarts and LewaManageAutostarts)

Quote:

<header android:icon="@drawable/ic_settings_autostarts" android:id="@id/autostarts_settings" android:title="@string/autostarts_title" android:fragment="com.android.settings.autostarts. LewaManageAutostarts" />

Screenshot



4. Save it and close it.

5. In the xml folder, paste from the downloaded folder the autostarts_settings_header.

6. Now navigate to \res\values\ strings.xml. Add the following lines:

Quote:

<string name="autostarts_title">Autostarts</string>
<string name="autostarts_allowed">Has allowed</string>
<string name="autostarts_prohibited">Has Prohibited</string>
<string name="autostarts_allow_progress_msg">Being Boot restored, Please wait ...</string>
<string name="autostarts_prohibit_progress_msg">Prohibit Boot, Please wait ...</string>
<string name="autostarts_empty_msg">No Installation Boot applications</string>
<string name = "autostarts_optimize_empty_msg">No optimize the Startup Items</string>
<string name="autostarts_optimize_btn_title">Optimize the Startup Items</string>
<string name="autostarts_all_btn_title">Autostarts All Items</string>

Screenshot


7. Save it and close it.

8. Now navigate to \res\values\ids.xml. Add the following lines:

Quote:

<item type="id" name="autostarts_settings">false</item>
<item type="id" name="appName">false</item>

Screenshot



9. Now paste from the folder your downloaded the ic_settings_autostarts icon in drawable-xdpi folder.

10. Now paste from the downloaded folder the manage_autostarts and the manage_autostarts_item in the layout folder.

12. Now copy from the attachment the whole autostarts folder to: smali/com/android/settings/

13.Now compile your Settings.apk

14. Now decompile the Settings.apk you just compiled.




NOW IT'S THE HARD PART, SO BE CAREFUL! ALSO THE IDS PROBABLY WILL BE DIFFERENT FOR YOU, SO DON'T COPY THE ONE YOU SEE



14. Navigate to res\values\public.xml and open it.

15. Navigate to smali\com\android\settings\autostarts\LewaManageAu tostarts.smali

16. In public.xml find manage_autostarts

17. Copy the id and paste it in LewaManageAutostarts.smali line 632


Screenshot




18. You have to follow this procedure for the next lines:

In public.xml we look for: manage_autostarts
In LewaManageAutostarts.smali we register the id in the line 632
In public.xml we look for: autostarts_allowed
In LewaManageAutostarts.smali we register the id in the line 305
In public.xml we look for: autostarts_prohibited
In LewaManageAutostarts.smali we register the id in the line 401
In public.xml we look for: autostarts_allow_progress_msg
In LewaManageAutostarts.smali we register the id in the line 831
In public.xml we look for: autostarts_prohibit_progress_msg
In LewaManageAutostarts.smali we register the id in the line 190
In public.xml we look for: autostarts_empty_msg
In LewaManageAutostarts.smali we register the id in the line 688 and 772
In public.xml we look for: autostarts_optimize_empty_msg
In LewaManageAutostarts.smali we register the id in the line 799
In public.xml we look for: autostarts_optimize_btn_title
In LewaManageAutostarts.smali we register the id in the line 612 and 765
In public.xml we look for: autostarts_all_btn_title
In LewaManageAutostarts.smali we register the id in the line 792 and 584

19. Now save the LewaManageAutostarts.smali and close it.

20. Now open the
LewaManageAutostarts$AppAdapter.smali

21. As before
:

In public.xml we look for: <public type="layout" name="manage_autostarts_item"
In LewaManageAutostarts$AppAdapter.smali we restiger the id in the line 164
In public.xml we look for: <public type="id" name="icon"
In LewaManageAutostarts$AppAdapter.smali we restiger the id in the line 174
In public.xml we look for: <public type="id" name="appName"
In LewaManageAutostarts$AppAdapter.smali we restiger the id in the line 195
In public.xml we look for: <public type="id" name="status"
In LewaManageAutostarts$AppAdapter.smali we restiger the id in the line 217
In public.xml we look for: <public type="id" name="app_on_sdcard"
In LewaManageAutostarts$AppAdapter.smali we restiger the id in the line 236


22. Save the file and close it.

23. Now recompile your Settings.apk and sign it.

24. Enjoy!
Last edited by DaRk-L0rD; 21st September 2014 at 10:46 AM.
The Following 62 Users Say Thank You to DaRk-L0rD For This Useful Post: [ View ]
27th January 2014, 01:56 PM   |  #2  
DaRk-L0rD's Avatar
OP Recognized Contributor / Themer
Isla de Muerta
Thanks Meter: 4,934
 
2,009 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Thanks @Pandemic for the icon
Last edited by DaRk-L0rD; 21st September 2014 at 10:47 AM.
The Following 5 Users Say Thank You to DaRk-L0rD For This Useful Post: [ View ]
27th January 2014, 02:47 PM   |  #3  
tOrNadO™'s Avatar
Recognized Contributor
Flag Bangalore
Thanks Meter: 925
 
1,990 posts
Join Date:Joined: Oct 2012
More
Cool tutorial.. Nice job..
27th January 2014, 03:39 PM   |  #4  
Rajeev's Avatar
Senior Member
Flag Chennai , I N D I A
Thanks Meter: 10,361
 
8,011 posts
Join Date:Joined: Nov 2012
Donate to Me
More
Awsommmmm.. Like Always...
27th January 2014, 03:47 PM   |  #5  
Leo's Avatar
Senior Member
Thanks Meter: 189
 
547 posts
Join Date:Joined: Dec 2012
greaaaaaat !
ill try to make it into chinese
--------------------------------------------------
eh..step 6 should be
<string name="autostarts_allowed">Has allowed</string>
--------------------------------------------------
for chinese it must delete the following item [in "res\layout\manage_autostarts_item.xml" line 8 "id/status"]
othervise ull see weird status
Attached Thumbnails
Click image for larger version

Name:	change.jpg
Views:	582
Size:	41.2 KB
ID:	2542639  
Last edited by Leo; 27th January 2014 at 05:57 PM.
The Following User Says Thank You to Leo For This Useful Post: [ View ]
27th January 2014, 04:01 PM   |  #6  
Pandemic's Avatar
Senior Member
Flag MePpEl
Thanks Meter: 11,922
 
15,698 posts
Join Date:Joined: Aug 2010
Donate to Me
More
Nice tutorial bro @DaRk-L0rD
Keep up the good work !!
What we always do as a team: Recognized MoonBreakers

Sent From Cybertron With My Powerfull Xperia P
28th January 2014, 11:55 AM   |  #7  
kagara's Avatar
Senior Member
Thanks Meter: 26
 
110 posts
Join Date:Joined: Sep 2012
error on first compiling, xperia TX

Code:
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: F:\AndroidAppsEditor\.\Applications\Temp\Settin
gs.apk-Decompiled\res/mipmap-xxhdpi
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\sigit\AppData\Local\Temp\A
PKTOOL20589.tmp, -I, C:\Users\sigit\apktool\framework\1.apk, -S, F:\AndroidAppsE
ditor\.\Applications\Temp\Settings.apk-Decompiled\res, -M, F:\AndroidAppsEditor\
.\Applications\Temp\Settings.apk-Decompiled\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:251)
        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:185)
        at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\sigit\AppData\Local\Temp\APKTOOL20589.tmp, -I, C:\Users\sigit\apktool\frame
work\1.apk, -S, F:\AndroidAppsEditor\.\Applications\Temp\Settings.apk-Decompiled
\res, -M, F:\AndroidAppsEditor\.\Applications\Temp\Settings.apk-Decompiled\Andro
idManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:249)
        ... 6 more
29th January 2014, 10:14 AM   |  #8  
neXus PRIME's Avatar
Recognized Contributor
Flag Lahore, Pakistan
Thanks Meter: 3,878
 
3,227 posts
Join Date:Joined: Nov 2011
More
Hi,
I followed the instructions to the letter.
I got to compiling and decompiling, then went to public.xml and against "Manage_autostarts", the value was "0x7f04008b" in my case,
however, when i went to smali/com/android/settings there was no folder named "autostarts\LewaManageAu tostarts.smali"

What to do about that?
The Following User Says Thank You to neXus PRIME For This Useful Post: [ View ]
29th January 2014, 10:15 AM   |  #9  
Pandemic's Avatar
Senior Member
Flag MePpEl
Thanks Meter: 11,922
 
15,698 posts
Join Date:Joined: Aug 2010
Donate to Me
More
Quote:
Originally Posted by neXus PRIME

Hi,
I followed the instructions to the letter.
I got to compiling and decompiling, then went to public.xml and against "Manage_autostarts", the value was "0x7f04008b" in my case,
however, when i went to smali/com/android/settings there was no folder named "autostarts\LewaManageAu tostarts.smali"

What to do about that?

@neXus PRIME
cant you add that folder then ?
Correct me if im wrong, im not always an einstein xD
Last edited by Pandemic; 29th January 2014 at 10:18 AM.
29th January 2014, 10:24 AM   |  #10  
neXus PRIME's Avatar
Recognized Contributor
Flag Lahore, Pakistan
Thanks Meter: 3,878
 
3,227 posts
Join Date:Joined: Nov 2011
More
Wink
Quote:
Originally Posted by Pandemic

@neXus PRIME
cant you add that folder then ?
Correct me if im wrong, im not always an einstein xD

Dont be rude. I figured that out and was going to edit my comment. THanks anyways.

Post Reply Subscribe to Thread

Tags
autostarts, jb 4.1.2, jb 4.3, settings, xperia
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Sony Cross-Device Development General by ThreadRank