FORUMS
Remove All Ads from XDA

Add Wimax toggle to Power Widget

35 posts
Thanks Meter: 12
 
By iwantyourskulls, Member on 20th July 2012, 11:57 PM
Post Reply Email Thread
I have been helping Sinistertensai with his ShenduOS port for the HTC EVO 4G. I got Wimax to work and was wanting to see if anyone knows how to add a Wimax toggle to the power widget dropdown from the status bar. The port is CM7 based. In the SystemUI.apk I see there is WimaxButton.smali. I have tried adding the ids for it in public.xml and creating pngs for the toggle. I get no errors on compile but I get reboots or force closes when I try to bring up the power widget dropdown. I have very limited experience with editing smail code. I have also tried copying over the resources, classes, and xmls to the original apk with the same results. I have researched how to edit smali but I could just be doing it wrong or leaving something out. This has been driving me to madness. If anyone could help out that would be amazing!
 
 
21st July 2012, 12:43 AM |#2  
thewadegeek's Avatar
Senior Member
Flag Cedar Rapids
Thanks Meter: 890
 
More
Is there a reason you can't rebuild from source with Wimax enabled?

Sent from my SCH-R760 using Tapatalk 2
21st July 2012, 04:36 AM |#3  
iwantyourskulls's Avatar
OP Member
Flag Tulsa, OK
Thanks Meter: 12
 
More
The ShenduOS SystemUI has been changed drastically and I cannot find the source code. That would require me to completely redo what Shendu has done and is well beyond my capabilities. The functionality for the wimax is there, I just need to find a way to add the toggle button. The actual widget has a wimax toggle which works, just not the one in the status bar.

Sent from my EVO using xda premium
21st July 2012, 04:52 AM |#4  
lithid-cm's Avatar
Inactive Recognized Developer
Flag Cleveland
Thanks Meter: 2,980
 
More
I have only done smali a few times. How I did it was for example get a cm build going. Remove all wimax toggle related noti widget elements. Compile. Now you have a systemui base. Now build with the wimax toggle. You have a wimax toggle systemui.

Then use a program like beyond compare and after apktooling both systemui in their own folders. Compare the smali differences. Should get you pretty close. Of course there will be some trial and error if the systemui is different then that of cm.

Sent from my Galaxy Nexus using xda premium
21st July 2012, 10:13 AM |#5  
iwantyourskulls's Avatar
OP Member
Flag Tulsa, OK
Thanks Meter: 12
 
More
The code is quite different that the CM7 code. I have found what needs to be edited, it just results in reboots upon clicking on the status bar to open the powerwidget dropdown. Here are the steps I take:
  • Decompile SystemUI.apk
  • In PowerWidget.smali -> replace both instances of toggleNetworkMode with toggleWimax
  • In WimaxButton.smali -> write down ids from method updateState (0x7f0200ca is off, 0x7f0200cb is on)
  • In public.xml -> Removed bad APKTOOL_DUMMYs for above ids. Add the following lines:
    • <public type="drawable" name="stat_wimax_off" id="0x7f0200ca" />
    • <public type="drawable" name="stat_wimax_on" id="0x7f0200cb" />
  • In res/drawable-hdpi -> Created on/off images and placed them there
  • In drawables.xml -> Removed bad APKTOOL_DUMMYs for above ids that were set to false. Add the following lines:
    • <item type="drawable" name="stat_wimax_off">true</item>
    • <item type="drawable" name="stat_wimax_on">true</item>
  • Recompiled
  • Pushed to phone with adb and cleared dalvik cache
  • Reboot

I have also tried pushing the changes and overwriting the ones in the original using Archive Manager(Ubuntu) with the same issues. If someone could point out what I am doing wrong that would help alot! I could have broken my tools(Android Utility/apktool). Feel free to give it a shot if you want. Once I/someone gets it right I will write up a tutorial.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes