[Samsung Galaxy Young S6310] dugeriss:
keep supporting sir :good:

---------- Post added at 06:15 PM ---------- Previous post was at 05:30 PM ----------

[GT-S6312][GUIDE] how to add lidroid 23toggles [wanam way]

Hy .. i'll share guide how to add lidroid toggles to GT-S6312 dual-sim phone

Decompile SystemUI.apk

Open ids.xml

open tw_status_bar_expanded_dual.xml

paste this code wherever u want!!

<com.wanam.systemui.quickpanel.PowerWidget android:id="@id/exp_power_stat" android:layout_width="fill_parent" android:layout_height="wrap_content" />

Done,save

Recompile SystemUI.apk

Decompile SystemUI.apk again

open PhoneStatusBar.smali

add code red code

.field mPostCollapseCleanup:Ljava/lang/Runnable;
[COLOR="Red"].field mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;[/COLOR]

.field private mPreviousConfigFontScale:F

find:

# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
.locals 5

add red code

# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
.locals 5

new-instance v0, Lcom/android/systemui/statusbar/StatusBarIconView;

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

const/4 v2, 0x0

invoke-direct {v0, v1, p1, v2}, Lcom/android/systemui/statusbar/StatusBarIconView;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/app/Notification;)V

invoke-virtual {v0, p4}, Lcom/android/systemui/statusbar/StatusBarIconView;->set(Lcom/android/internal/statusbar/StatusBarIcon;)Z

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusIcons:Landroid/widget/LinearLayout;

new-instance v2, Landroid/widget/LinearLayout$LayoutParams;

iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconSize:I

iget v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconSize:I

invoke-direct {v2, v3, v4}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

[COLOR="Red"] iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

invoke-virtual {v1}, Lcom/wanam/systemui/quickpanel/PowerWidget;->updateWidget()V
[/COLOR]
return-void
.end method

open Public.xml

find :

put hex public exp_power_stat

<public type="id" name="exp_power_stat" id="[COLOR="Red"]0x7f0d013f[/COLOR]" />

find method

.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

Scroll down and find this code

new-instance v18, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

move-object/from16 v19, v0

move-object/from16 v0, v18

move-object/from16 v1, p0

move-object/from16 v2, v19

invoke-direct {v0, v1, v3, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V

move-object/from16 v0, v18

move-object/from16 v1, p0

iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;

the above code

paste this,

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

move-object/from16 v18, v0

const v19, [COLOR="Red"]0x7f0d013f <<<< type="id" name="exp_power_stat" [/COLOR]

invoke-virtual/range {v18 .. v19}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v18

check-cast v18, Lcom/wanam/systemui/quickpanel/PowerWidget;

move-object/from16 v0, v18

move-object/from16 v1, p0

iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

like this

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

move-object/from16 v18, v0

const v19, 0x7f0d004e

invoke-virtual/range {v18 .. v19}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v18

check-cast v18, Landroid/widget/ScrollView;

move-object/from16 v0, v18

move-object/from16 v1, p0

iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

move-object/from16 v18, v0

const/16 v19, 0x0

invoke-virtual/range {v18 .. v19}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V

move-object/from16 v0, p0

[COLOR="Red"] iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

move-object/from16 v18, v0

const v19, 0x7f0d013f

invoke-virtual/range {v18 .. v19}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v18

check-cast v18, Lcom/wanam/systemui/quickpanel/PowerWidget;

move-object/from16 v0, v18

move-object/from16 v1, p0

iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;
[/COLOR]
new-instance v18, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

move-object/from16 v19, v0

move-object/from16 v0, v18

move-object/from16 v1, p0

move-object/from16 v2, v19

invoke-direct {v0, v1, v3, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V

next, find :

if-ne v0, v1, :cond_1c

const-string v18, "android.intent.action.SCREEN_ON"

move-object/from16 v0, v18

invoke-virtual {v6, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

:cond_1c
move-object/from16 v0, p0

add red code

if-ne v0, v1, :cond_1c

const-string v18, "android.intent.action.SCREEN_ON"

move-object/from16 v0, v18

invoke-virtual {v6, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

:cond_1c
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;

move-object/from16 v18, v0

move-object/from16 v0, v18

invoke-virtual {v3, v0, v6}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

move-object/from16 v0, p0

[COLOR="Red"] iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

move-object/from16 v18, v0

move-object/from16 v0, v18

invoke-virtual {v0}, Lcom/wanam/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]

sget-boolean v18, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useTouchWizGUI:Z

if-eqz v18, :cond_1d

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

Save,

open "AndroidManifest.xml"

find

<manifest android:versioncode=16 android:versionname="4.1.2-blablabla.."

add code

android:sharedUserId="android.uid.system" android:process="system"

between

<manifest android:versioncode=16

like this :

<manifest [COLOR="Red"]android:sharedUserId="android.uid.system" android:process="system"[/COLOR] android:versionCode="16" android:versionName="4.1.2-blablabla.."

find

<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />

below code

add this,

<uses-permission android:name="android.permission.CAMERA" />

SAVE,RECOMPILE,SIGN,PUSH TO SYSTEM

NEED SIGN, OR DISABLE CHECK SIGNATURE APPS [SERVICE.JAR]

READ HERE :

http://xdaforums.com/showthread.php?t=1621289

http://xdaforums.com/showpost.php?p=51517852&postcount=67

Download file :

smali :

http://d-h.st/45p

lidroid-res & lidroidsettings:

http://d-h.st/HIa

Credit :

LIDROID

WANAM

Adi Aisiteru Reborn

#sorry for google translate