Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,696 Members 38,064 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL] How to add Autostarts Option in Settings

Tip us?
 
DaRk-L0rD
Old
(Last edited by DaRk-L0rD; 26th April 2014 at 10:17 AM.)
#1  
DaRk-L0rD's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 4570
Posts: 1,922
Join Date: Sep 2012
Location: Isla de Muerta

 
DONATE TO ME
Angry [TUTORIAL] How to add Autostarts Option in Settings


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

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!

If you like my work, please consider buying me a beer! Thanks in advance!
SONY XPERIA Z1 & T

MY CONTRIBUTIONS
The Following 52 Users Say Thank You to DaRk-L0rD For This Useful Post: [ Click to Expand ]
 
DaRk-L0rD
Old
(Last edited by DaRk-L0rD; 27th January 2014 at 02:20 PM.)
#2  
DaRk-L0rD's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 4570
Posts: 1,922
Join Date: Sep 2012
Location: Isla de Muerta

 
DONATE TO ME
Thanks @Pandemic bro

If you like my work, please consider buying me a beer! Thanks in advance!
SONY XPERIA Z1 & T

MY CONTRIBUTIONS
The Following 4 Users Say Thank You to DaRk-L0rD For This Useful Post: [ Click to Expand ]
 
tOrNadO™
Old
#3  
tOrNadO™'s Avatar
Senior Member
Thanks Meter 832
Posts: 1,904
Join Date: Oct 2012
Location: Bangalore
Cool tutorial.. Nice job..


"A friend in need is a friend indeed.." So press THANKS if someone helps u. They deserve it..
 
Rajeev
Old
#4  
Rajeev's Avatar
Senior Member
Thanks Meter 7349
Posts: 6,760
Join Date: Nov 2012
Location: Chennai , I N D I A

 
DONATE TO ME
Awsommmmm.. Like Always...
If You Like My Work Please Consider A Small Donation

For Donating Click Below

 
Please Do The Following:
Sign In To Your PayPal Account Page
Go To 'Send Payment'
Enter My Email ID "dipesh.febrius@gmail.com"
Option "Personal Payment" Doesn't Work For India, So Kindly Set "Online Purchases". And Check Goods or Service (Preferably Service)
Make The Payment of The Desired Amount of Donation You Want To Send.
Thank You For Your Kind Donations!
 
Leo
Old
(Last edited by Leo; 27th January 2014 at 05:57 PM.)
#5  
Leo's Avatar
Senior Member
Thanks Meter 170
Posts: 531
Join Date: 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:	457
Size:	41.2 KB
ID:	2542639  
Sony Xperia TX [LT29i] ,
Jelly Bean 4.3,
9.2.A.1.205, Stock, deodex,
1266-3320_R2J,
Relocked BootLoader.
The Following User Says Thank You to Leo For This Useful Post: [ Click to Expand ]
 
Pandemic
Old
#6  
Pandemic's Avatar
Senior Member
Thanks Meter 11059
Posts: 14,845
Join Date: Aug 2010
Location: MePpEl

 
DONATE TO ME
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



... My Projects & Work ...
 

... Latest ...
>> [XZ]MoonWalker SuperB V2 <<
>> [XZL]MoonWalker SuperB V2 <<
-----------------------
||> All My Work <||


 
kagara
Old
#7  
kagara's Avatar
Senior Member
Thanks Meter 26
Posts: 110
Join Date: Sep 2012
error on first compiling, xperia TX

Code:
Select 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
 
neXus PRIME
Old
#8  
neXus PRIME's Avatar
Recognized Contributor
Thanks Meter 3010
Posts: 2,967
Join Date: Nov 2011
Location: Lahore, Pakistan
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: [ Click to Expand ]
 
Pandemic
Old
(Last edited by Pandemic; 29th January 2014 at 10:18 AM.)
#9  
Pandemic's Avatar
Senior Member
Thanks Meter 11059
Posts: 14,845
Join Date: Aug 2010
Location: MePpEl

 
DONATE TO ME
Quote:
Originally Posted by neXus PRIME View Post
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



... My Projects & Work ...
 

... Latest ...
>> [XZ]MoonWalker SuperB V2 <<
>> [XZL]MoonWalker SuperB V2 <<
-----------------------
||> All My Work <||


 
neXus PRIME
Old
#10  
neXus PRIME's Avatar
Recognized Contributor
Thanks Meter 3010
Posts: 2,967
Join Date: Nov 2011
Location: Lahore, Pakistan
Quote:
Originally Posted by Pandemic View Post
@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.

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

Advanced Search
Display Modes