New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
kedai
Old
(Last edited by kedai; 18th February 2012 at 12:08 AM.)
#1  
Senior Member - OP
Thanks Meter 52
Posts: 132
Join Date: Mar 2011
Default modding 14 toggles for ics (legendk95/lidroid)?

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
Code:
--- 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
Code:
 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
 
TheATHEiST
Old
#2  
TheATHEiST's Avatar
Senior Member
Thanks Meter 789
Posts: 3,818
Join Date: Sep 2008
Location: Hull
Quote:
Originally Posted by kedai View Post
If this does not belong here..

It doesn't. This is the development forum, you're not posting a development or reference.

Common sense would dictate that if you want support for a mod you should post in that mods topic not create a new topic for support for another.
Phone:
SGS2 I9100: CM10.1 Nightly

Tablet
Nexus 7: CM 10.1

Smartphone History:
HTC Touch > HTC Universal > HTC Touch HD > HTC HD2 > iPhone 4S > Samsung Galaxy S2/iPhone 4S

Tablet History:
Galaxy Tab 7.0 > iPad3 > Nexus 7

 
locomain
Old
#3  
Senior Member
Thanks Meter 225
Posts: 267
Join Date: Jul 2011
Location: Vorden

 
DONATE TO ME
theres a thread on xda somewhere from lidroid how its done
but i think u need a framework file to let it work and a permission

one question
how did you get the system ui compiled? i tried everything! thnx