[Galaxy Y Duos S6102 Android Development] arbayong:
Step by step guide

METHOD

make sure you keep copies of the apks you are about to modify... just in case

[*]setup your apk-tool of choice

i am assuming, for the rest of this guide, that each of your apks is decompiled into a folder called 'working'

[*]

Place the LidroidSystemUI.apk into the 'in' or 'original-apk' folder of your apk-tool/manager

Decompile the LidroidSystemUI.apk and rename the created 'working' folder to say 'LidroidSystemUI'

Now place your SystemUI.apk into the 'in' or 'original-apk' folder of your apk-tool/manager and decompile it

do not rename the 'working' folder created for SystemUI.apk since we will recompile it later

Now open/browse the folder(directory) LidroidSystemUI/smali/com and copy the folder called lidroid

browse to working folder for SystemUI.apk, open working/smali/com and paste the lidroid folder from the previous step into this folder (com).

you should now have two folders (directories) called 'android' and 'lidroid' within working/smali/com of your decompiled SystemUI.apk folder(directory)

take a five-minute break if you are getting nervous

open the working folder of your decompiled SystemUI.apk from above and browse to working/smali/com/android/systemui/statusbar

you should find a bunch of smali files and two folders called 'policy' and 'quickpanel'

locate the file called 'StatusBarService.smali' and open it with the linux text editor of your choice.

if you are on windows OS, then you should use notepad++ for this.

repeat, you should use notepad++ and not notepad or wordpad etc

hit Ctrl+F on your keyboard to open the search window in your text editor.

type the following, of course without quotes, '.line 405' and hit enter key on keyboard

or instead, you may just read through the entire document until you come to .line 405

replace the following block of text (Galaxy y pro duos and ace duos only) if you use galaxy y duos, see post 8. flashlight code is same for all phones

.line 405
const/4 v12, 0x0

.line 409
.local v12, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
const v26, 0x7f030002

const/16 v27, 0x0

move-object/from16 v0, p1

move/from16 v1, v26

move-object/from16 v2, v27

invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

move-result-object v12

.end local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
check-cast v12, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;

.line 411
.restart local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
move-object/from16 v0, p0

with

.line 405
const/4 v12, 0x0

.line 409
const v26, 0x3030003

const/16 v27, 0x0

move-object/from16 v0, p1

move/from16 v1, v26

move-object/from16 v2, v27

invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

move-result-object v12

check-cast v12, Lcom/lidroid/systemui/quickpanel/PowerWidget;

.line 411
.local v12, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v12}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V

move-object/from16 v0, p0

FLASHLIGHT

if your phone does not have flashlight and you want to turn your normal screen into flashlight, then modify the manifest.xml file in the root of your decompiled working folder ie working/manifest.xml to look like this

<?xml version="1.0" encoding="utf-8"?>
<manifest android:sharedUserId="android.uid.system" android:process="system" android:versionCode="10" android:versionName="2.3.6" package="com.android.systemui"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.STATUS_BAR_SERVICE" />
<uses-permission android:name="android.permission.MANAGE_USB" />
<application android:label="@string/app_label" android:icon="@drawable/ic_launcher_settings" android:allowClearUserData="false" android:persistent="true">
<service android:name=".statusbar.StatusBarService" android:exported="false" />
<activity android:name=".usb.UsbStorageActivity" android:excludeFromRecents="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name="com.android.internal.app.ExternalMediaFormatActivity" android:excludeFromRecents="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbConfirmActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbPermissionActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbResolverActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbAccessoryUriActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.lidroid.systemui.quickpanel.FlashlightActivity" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation" />
</application>
</manifest>

Notice i merely added the following line

<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.lidroid.systemui.quickpanel.FlashlightActivity" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation" />
</application>

just before the line starting with </application>.

ensure that in your modified manifest.xml that the start of all the lines with <activity android:............. /> are all in a straight line since the spacing at the beggining of lines is very important.

if the phone has no flashlight and you fail to modify manifest.xml, then you will have a force close problem anytime you tap on flashlight toggle in your statusbar.

Now compile your modded working folder, sign it and push it into your /system/app folder of your phone.

Don't forget to also push lidroid-res.apk into /system/framework directory of your phone.

you may optionally push QuickpanelSettings.apk you downloaded earlier into your /system/app folder.

if you are not sure, how to push them into the appropriate directories on your phone, read the original thread by Lidroid

Reboot your phone and enjoy your modding.

SIGNING YOUR COMPILED APKS

you can use the signing facility that comes with your apk-tool or manager. in my case signing with my apk-tool make my SystemUI.apk to become too big and it also did not work. i had to resign using dsixda's kitchen.

in Dsixda's kitchen menu, choose the advanced option, select option to sign apks and then choose option to sign apks outside working folder

place you compiled SystemUI.apk inside the signed files folder created for you, go back to kitchen's menu and hit enter on our keyboard to sign your file.