[TUTORIAL] How to add Autostarts Option in Settings

Search This thread

DaRk-L0rD

Senior Member
Sep 29, 2012
2,139
5,462
Isla Muerta


Hello everyone :)

Today i will teach you how to add Autostarts ;)



33vbzig.jpg


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)

<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

2h6g8eh.jpg


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:

<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
9jojkn.jpg


7. Save it and close it.

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

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

Screenshot

8xsr45.jpg


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\LewaManageAutostarts.smali

16. In public.xml find manage_autostarts

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


Screenshot

123wjuo.jpg



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:

Leo

Senior Member
Dec 18, 2012
551
188
32
greaaaaaat ! :victory::victory:
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
 

Attachments

  • change.jpg
    change.jpg
    41.2 KB · Views: 1,311
Last edited:
  • Like
Reactions: DaRk-L0rD

kagara

Senior Member
Sep 13, 2012
118
26
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
 

neXus PRIME

Senior Member
Nov 22, 2011
3,547
4,540
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?
 
  • Like
Reactions: DaRk-L0rD
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:

neXus PRIME

Senior Member
Nov 22, 2011
3,547
4,540
Lahore, Pakistan
@neXus PRIME
im not rude :/
i just ask it normal and nice if you can add that folder :(
Ok i see good mate :)

haha, i thought you were being sarcastic... :laugh::laugh:
No hard feelings.

Thanks OP for the mod. I recompiled and booted fine.
I see the Autostart option in Settings, but it force closes on launch. Any clues?
Btw, i have Xperia SP, 4.1.2.

Logcat:
Code:
W/dalvikvm( 3624): dvmFindClassByName rejecting 'com.android.settings.autostarts
. LewaManageAutostarts'
W/dalvikvm( 3624): threadid=1: thread exiting with uncaught exception (group=0x4
0db5650)
E/AndroidRuntime( 3624): FATAL EXCEPTION: main
E/AndroidRuntime( 3624): java.lang.RuntimeException: Unable to start activity Co
mponentInfo{com.android.settings/com.android.settings.SubSettings}: android.app.
Fragment$InstantiationException: Unable to instantiate fragment com.android.sett
ings.autostarts. LewaManageAutostarts: make sure class name exists, is public, a
nd has an empty constructor that is public
E/AndroidRuntime( 3624):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2070)
E/AndroidRuntime( 3624):        at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2095)
E/AndroidRuntime( 3624):        at android.app.ActivityThread.access$600(Activit
yThread.java:137)
E/AndroidRuntime( 3624):        at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1206)
E/AndroidRuntime( 3624):        at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 3624):        at android.os.Looper.loop(Looper.java:213)
E/AndroidRuntime( 3624):        at android.app.ActivityThread.main(ActivityThrea
d.java:4793)
E/AndroidRuntime( 3624):        at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 3624):        at java.lang.reflect.Method.invoke(Method.java:5
11)
E/AndroidRuntime( 3624):        at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:789)
E/AndroidRuntime( 3624):        at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:556)
E/AndroidRuntime( 3624):        at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime( 3624): Caused by: android.app.Fragment$InstantiationException:
 Unable to instantiate fragment com.android.settings.autostarts. LewaManageAutos
tarts: make sure class name exists, is public, and has an empty constructor that
 is public
E/AndroidRuntime( 3624):        at android.app.Fragment.instantiate(Fragment.jav
a:584)
E/AndroidRuntime( 3624):        at android.preference.PreferenceActivity.switchT
oHeaderInner(PreferenceActivity.java:1132)
E/AndroidRuntime( 3624):        at android.preference.PreferenceActivity.switchT
oHeader(PreferenceActivity.java:1148)
E/AndroidRuntime( 3624):        at android.preference.PreferenceActivity.onCreat
e(PreferenceActivity.java:539)
E/AndroidRuntime( 3624):        at com.android.settings.Settings.onCreate(Settin
gs.java:151)
E/AndroidRuntime( 3624):        at android.app.Activity.performCreate(Activity.j
ava:5008)
E/AndroidRuntime( 3624):        at android.app.Instrumentation.callActivityOnCre
ate(Instrumentation.java:1079)
E/AndroidRuntime( 3624):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2034)
E/AndroidRuntime( 3624):        ... 11 more
E/AndroidRuntime( 3624): Caused by: java.lang.ClassNotFoundException: com.androi
d.settings.autostarts. LewaManageAutostarts
E/AndroidRuntime( 3624):        at dalvik.system.BaseDexClassLoader.findClass(Ba
seDexClassLoader.java:61)
E/AndroidRuntime( 3624):        at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:501)
E/AndroidRuntime( 3624):        at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:461)
E/AndroidRuntime( 3624):        at android.app.Fragment.instantiate(Fragment.jav
a:574)
E/AndroidRuntime( 3624):        ... 18 more
W/ActivityManager(  678):   Force finishing activity com.android.settings/.SubSe
ttings
D/PowerManagerService(  678): acquireWakeLock flags=0x1 tag=ActivityManager-Laun
ch
W/ActivityManager(  678):   Force finishing activity com.android.settings/.Setti
ngs
I/CrashMonitor( 3263): CrashMonitorServiceBroadcastReceiver: Forwarding intent:
android.intent.action.DROPBOX_ENTRY_ADDED tag: system_app_crash
I/CrashMonitor( 3263): CrashMonitorService: Service started...
I/CrashMonitor( 3263): CrashMonitorService: onHandleIntent action: android.inten
t.action.DROPBOX_ENTRY_ADDED
 
Last edited:
haha, i thought you were being sarcastic... :laugh::laugh:
No hard feelings.

Hahaha no ofcourse not @neXus PRIME ]that was meant to myself ;)
ok then is it alright :)

does this mod work on 4.1.2?? maybe i am trying in vain?

Does it work on xperia sp?
Yes it works also on 4.1.2 and also on Xperia SP !
I was the 1st one that have autostart on my Xperia P (with 4.1.2) and my bro @DaRk-L0rD
posted this awesome tutorial with my permissions so everyone can have it :D
 

neXus PRIME

Senior Member
Nov 22, 2011
3,547
4,540
Lahore, Pakistan
Hahaha no ofcourse not @neXus PRIME ]that was meant to myself ;)
ok then is it alright :)


Yes it works also on 4.1.2 and also on Xperia SP !
I was the 1st one that have autostart on my Xperia P (with 4.1.2) and my bro @DaRk-L0rD
posted this awesome tutorial with my permissions so everyone can have it :D
So can you please check whats wrong at my end?

i posted the xml n smalis.... you can check whether i pasted the correct ids or not. Much appreciated.
 

neXus PRIME

Senior Member
Nov 22, 2011
3,547
4,540
Lahore, Pakistan
@Pandemic
I am unable to PM you so asking here:
If i have your permission, can i share the modded file of settings with autostarts as flashable zip on xperia sp forum? because not may users can do it on their own. Thanks in advance:good::good::good:

@ OP
It worked... i PMed it to you as well. Thanks.
 

Attachments

  • Screenshot_2014-01-30-10-00-08.jpg
    Screenshot_2014-01-30-10-00-08.jpg
    69.8 KB · Views: 329
  • Screenshot_2014-01-30-10-00-25.jpg
    Screenshot_2014-01-30-10-00-25.jpg
    60.9 KB · Views: 316
@Pandemic
I am unable to PM you so asking here:
If i have your permission, can i share the modded file of settings with autostarts as flashable zip on xperia sp forum? because not may users can do it on their own. Thanks in advance:good::good::good:

@ OP
It worked... i PMed it to you as well. Thanks.

@neXus PRIME
yes i disabled it because people pm me alot and it drives met nuts.
sure you may share it but give proper credits ;)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 94


    Hello everyone :)

    Today i will teach you how to add Autostarts ;)



    33vbzig.jpg


    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)

    <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

    2h6g8eh.jpg


    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:

    <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
    9jojkn.jpg


    7. Save it and close it.

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

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

    Screenshot

    8xsr45.jpg


    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\LewaManageAutostarts.smali

    16. In public.xml find manage_autostarts

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


    Screenshot

    123wjuo.jpg



    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!
    7
    Thanks @Pandemic for the icon :)
    5
    4.3 jelly bean
    xperi z1
    errors when the first compiling the settings.apk

    using apktool:
    Code:
    I: Using Apktool 2.0.0-Beta7 on settings
    I: Smaling...
    settings\smali\com\android\settings\autostarts\AppItem.smali[25,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[26,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[25,15] mismatched i
    nput '"context"' expecting END_METHOD_DIRECTIVE
    settings\smali\com\android\settings\autostarts\AppItem.smali[27,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[28,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[126,4] Error for in
    put '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[127,4] Error for in
    put '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[126,15] mismatched
    input '"context"' expecting END_METHOD_DIRECTIVE
    settings\smali\com\android\settings\autostarts\AppItem.smali[128,4] Error for in
    put '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[129,4] Error for in
    put '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[130,4] Error for in
    put '.parameter': Invalid directive
    Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
    : com/android/settings/autostarts/AppItem.smali
            at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
            at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
            at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
            at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:337)
            at brut.androlib.Androlib.buildSources(Androlib.java:298)
            at brut.androlib.Androlib.build(Androlib.java:284)
            at brut.androlib.Androlib.build(Androlib.java:258)
            at brut.apktool.Main.cmdBuild(Main.java:233)
            at brut.apktool.Main.main(Main.java:88)

    using android multitool:
    Code:
    ..\Decompiled_apk\Settings\smali\android\support\v4\view\PagerAdapter.smali[83,4] Invalid literal value: 16256. Low 16 bits must be zeroed out.
    Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/support/v4/view/PagerAdapter.smali
    	at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
    	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
    	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    	at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:337)
    	at brut.androlib.Androlib.buildSources(Androlib.java:298)
    	at brut.androlib.Androlib.build(Androlib.java:284)
    	at brut.androlib.Androlib.build(Androlib.java:258)
    	at brut.apktool.Main.cmdBuild(Main.java:236)
    	at brut.apktool.Main.main(Main.java:88)
    The system cannot find the file specified.
    The system cannot find the file specified.



    I am getting the following error when compiling settings . Can help me:

    settings\smali\com\android\settings\autostarts\AppItem.smali[25,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[26,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[25,15] mismatched i
    nput '"context"' expecting END_METHOD_DIRECTIVE
    settings\smali\com\android\settings\autostarts\AppItem.smali[27,4] Error for inp
    ut '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[28,4] Error for input '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[126,4] Error for input '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[127,4] Error for input '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[126,15] mismatched
    input '"context"' expecting END_METHOD_DIRECTIVE
    settings\smali\com\android\settings\autostarts\AppItem.smali[128,4] Error for in
    put '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[129,4] Error for in
    put '.parameter': Invalid directive
    settings\smali\com\android\settings\autostarts\AppItem.smali[130,4] Error for in
    put '.parameter': Invalid directive
    Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
    : com/android/settings/autostarts/AppItem.smali
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:337)
    at brut.androlib.Androlib.buildSources(Androlib.java:298)
    at brut.androlib.Androlib.build(Androlib.java:284)
    at brut.androlib.Androlib.build(Androlib.java:258)
    at brut.apktool.Main.cmdBuild(Main.java:233)
    at brut.apktool.Main.main(Main.java:88)



    A good guide.but I got the following error when I trying second compile.
    Code:
     ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[25,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[26,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[25,15] mismatched input '"context"' expecting END_METHOD_DIRECTIVE
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[27,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[28,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[126,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[127,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[126,15] mismatched input '"context"' expecting END_METHOD_DIRECTIVE
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[128,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[129,4] Error for input '.parameter': Invalid directive
    ../../../storage/sdcard0/Apk Works/Settings_src/smali/com/android/settings/autostarts/AppItem.smali[130,4] Error for input '.parameter': Invalid directive
    Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/autostarts/AppItem.smali
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:337)
    at brut.androlib.Androlib.buildSources(Androlib.java:298)
    at brut.androlib.Androlib.build(Androlib.java:284)
    at brut.androlib.Androlib.build(Androlib.java:258)
    at brut.apktool.Main.cmdBuild(Main.java:233)
    at brut.apktool.Main.main(Main.java:88)
    I: Using Apktool 2.0.0-Beta7 on Settings_src
    I: Smaling...


    i'm getting this error..

    13-02-2014
    18:53:23.96
    Re-compiling... "C:\Users\kiran\APK GUI\InProgress\Settings"

    I: Smaling...
    [70,4] Error for input '.param': Invalid directive
    [95,4] Error for input '.param': Invalid directive
    [55,15] no viable alternative at input '"this"'
    [56,15] no viable alternative at input '"callbacks"'
    [70,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
    [79,4] missing EOF at '.prologue'
    Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: java.io.FileInputStream@44331c
    at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
    at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:254)
    at brut.androlib.Androlib.buildSources(Androlib.java:211)
    at brut.androlib.Androlib.build(Androlib.java:202)
    at brut.androlib.Androlib.build(Androlib.java:176)
    at brut.apktool.Main.cmdBuild(Main.java:214)
    at brut.apktool.Main.main(Main.java:74)

    -----------------------------------------------------------------
    Xperia SL
    Existenz rom(4.1.2)

    Something in the smali folder is causing the error...

    I had this error too. "Error for input '.parameter': Invalid directive" happens because the smali files from the rar was creating using old tools and you're trying to compile using 2.x version. Download baksmali-1.4.2.jar and smali-1.4.2.jar and try with them. You can decompile with old tools and compile again with new tools and try now, or you can use these I've compiled like I said:

    Smali files for 2.x.x

    But the problem is that the references from 18 and 21 points aren't correct now but I think they're very close. Best use the last baksmali 2.0.0b9. I hope these can help all of you and improve this very good tutorial because I want this function in my phone :D

    I can compile the Settings file but it doesn't work to me, I'm using a Sony Xperia Z with stock ROM.
    Does not it work with odexes ROMs even decompile .odex file??? :confused:
    2


    Make sure that there is no space between autostarts and LewaManageAutostarts
    In Settings_header.XML

    Did you see if this is your problem?

    G.M.L.
    2
    Testing will report back

    ---------- Post added at 08:59 PM ---------- Previous post was at 08:01 PM ----------

    use autostart rar file 2.x.x..

    thanx a lot dud thanx a lot

    finally got it done