[Galaxy S II Android Development] kedai:
Edit: please delete

If this does not belong here, please feel free to move it where appropriate.

I've spent a few hours trying to do the 14 toggles lidroid/legendk95 mod for the latest ics build; just to learn how stuff is done, to no avail.

So, i'm trying to think out loud so experts can help where i go wrong. With your help, we can turn this into a how to.

Here's what i did

- apktool if lph/system/framework/framework-res.apk

- apktool d lph/system/app/SystemUI.apk

- cd SystemUI; edit ids.xml add false

- cd ../;apktool d SystemUI sysui.apk

- apktool d sysui.apk

- cd sysui; check res/values/public.xml for exp_power_stat (the id is 0x7f0e00b4)

- edit smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali with this diff

--- SystemUIlpbdef/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali 2012-02-06 23:55:27.700989933 +0800
+++ SystemUI/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali 2012-02-06 23:46:12.244052196 +0800
@@ -151,6 +151,8 @@

.field mPostCollapseCleanup:Ljava/lang/Runnable;

+.field mPowerWidget:Lcom/android/legendk/systemui/StBar/PowerWidget;
+
.field private mPropFactor:Ljava/lang/Float;

.field mQueueLock:Ljava/lang/Object;
@@ -2653,6 +2655,10 @@

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

+ iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/android/legendk/systemui/StBar/PowerWidget;
+
+ invoke-virtual {v1}, Lcom/android/legendk/systemui/StBar/PowerWidget;->updateWidget()V
+
.line 742
return-void
.end method
@@ -6505,6 +6511,18 @@

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

+ const v21, 0x7f0e00b4
+
+ move/from16 v0, v21
+
+ invoke-virtual {v5, v0}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
+
+ move-result-object v21
+
+ check-cast v21, Lcom/android/legendk/systemui/StBar/PowerWidget;
+
+ iput-object/jumbo v21, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/android/legendk/systemui/StBar/PowerWidget;
+
.line 450
move-object/from16 v0, p0

@@ -7338,6 +7356,12 @@

iput-boolean v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mUseStatusBarMarquee:Z

+ iget-object/jumbo v21, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/android/legendk/systemui/StBar/PowerWidget;
+
+ move-object/from16 v0, v21
+
+ invoke-virtual {v0}, Lcom/android/legendk/systemui/StBar/PowerWidget;->setupWidget()V
+
.line 595
return-object v17

- edit res/layout/tw_status_bar_expanded.xml

diff -aNur ../SystemUIlph/res/layout/tw_status_bar_expanded.xml sysui/res/layout/tw_status_bar_expanded.xml
--- ../SystemUIlph/res/layout/tw_status_bar_expanded.xml	2012-02-17 22:02:47.507607874 +0800
+++ sysui/res/layout/tw_status_bar_expanded.xml	2012-02-18 00:35:17.295609383 +0800
@@ -5,7 +5,8 @@

-
+
+

- cp the necessary legendk directories to sysui/smali/com and sysui/smali/com/android

- apktool b sysui new-SystemUI.apk

- adb remount;adb push new-SystemUI.apk /system/app;adb reboot

did i miss a step? a few steps? i'm running out of ideas. help/pointers appreciated.

thanks