jetx2x
Android Expert
Hello fellow Warpers.... and welcome to my first ever tut... I have tried my hardest to make it as noob friendly as possible for newbies...
Before attempting this it is recommended that you download and install notepad++... know how to decompile apks... and also know how to count in hexadecimal
1. So first things first... download the zip that I put together to help along the way of this tut found here... after downloading unzip the file to a remote location
2. Next you must use apktool tool to decompile your systemui.apk which can be found in /system/app/... if you do not know how to do this then I dont think you should be following this tutorial ... but anyway google is your friend...
3. Navigate to your now decompiled systemui and go into \SystemUI.apk\smali\com\android\systemui\ and replace both R$layout.xml and R$id.xml with the ones found in my zip
4.Now go into the statusbar folder and open StatusbarService.smali with notepad++... and search for
Replace the entire method with this one
Save the file and close it
5. Now go up into /systemui/smali/... drag and drop the file labeled "lidroid_1" into this location and remove the "_1" at the end of the file name...
Now go into com and place the file labeled "lidroid_2" place it into this location... like before erase the "_2" found at the end of the file name
Now we are pretty much done with the smali coding... there is still more to do but not quite yet...
6. Now back out and go into the res folder and go into the folder labeled "layout"... grab the three power widget xmls out of my zip and move them here
7. Back out of "layout and go into the folder labeled "Values"... and first open the ids.xml... copy and paste the below code in between the last entry and </resources> and save the file
8. This step by far is the longest and most interactive... go into public.xml and scroll down to the last entry labeled like this <public type="drawable"... go under it and copy and paste these entries directly under it
Here goes the time consuming part... do you see where it says id="0x********"? This a unique identifier that is used to identify the entries in the smali code... and the id must be unique or you will not be able to compile properly... so you must change all of the above ids to ones that arent specified yet in the xml... you must find the last hexadecimal number already under use in the "drawable" section... mine was 0x7f020173... so I started numbering mine at 0x7f020174... not all of the entries in the xml are in order so you will have to manually find the last number used...
After you have correctly labeled each entry scroll down to the last entry labeled like this <public type="layout" and go under it and copy and paste this
Once again... make sure the new entries have unique ids... there should only be a few entries in the layout section so it should be easier this go around..
Once you are done scroll down to the last entry labeled like this <public type="string" and copy and past this code directly under it
Again... give each new entry a unique id
Scroll down to the bottom of the xml and look at the last entry labeled <public type="id" and copy and paste this code
Now... you still there? guess what... YOU FINISHED STEP 8!!!!!!!! XDXDXDXDXD Ready for step 9? Yes(scroll down) No(Press the big red X on the top right of your screen) Maybe (Save all of your work... take a nap and come back later) lol...
9. Keep the public.xml open and back out of the res folder and go into /systemui/smali/com/lidroid/systemui/quickpanel/ and keep the folder open...
This step involves telling the code which icons to use for the notification toggles... if you dont do this step you will probably end up with battery icons for the toggles the same way I did... =/
Inside of the zip that you downloaded earlier you will see a file named "ID_Values"... open it... In an attempt to make this as noob friendly I have replaced all of the hexadecimal ids in the smali with text which corresponds to which id you should use and specified which smali file they are located in... look at the first part of the xml... you should see
AirplaneButton.smali
stat_airplane_off = Airplane_off
stat_airplane_on = Airplane_on
What this means is that inside of the AirplaneButton.smali file I have inserted Airplane_off and Airplane_on and that they correspond to stat_airplane_off and stat_airplane_on in the public.xml.
What you must do is search for the text on the right of the equal sign in the smali file... once found go into the public.xml and search for the text on the left of the equal sign and copy its hexadecimal id into the smali file over the text... if you didnt understand I will show you what I mean...
If in my public.xml I had this
then I would copy 0x00000000 and paste it over Airplane_on...
your end result should now look like this
Instead of
Now... got that? you must do this for every entry that I specified in "ID_Values" after you are done you may move on to the next step
10.Now hang in there... you're almost there... open strings.xml and copy and paste this code under the last entry
save and exit the file
11. Welcome to the last step... which should be simple enough... extract the zip file named icons located inside of the zip I created and place each png into /systemui/res/drawable-hdpi... and VOILA!!! compile your now modified apk... for any compile errors you receive please notify me in this thread so I can assist you.
Before attempting this it is recommended that you download and install notepad++... know how to decompile apks... and also know how to count in hexadecimal
1. So first things first... download the zip that I put together to help along the way of this tut found here... after downloading unzip the file to a remote location
2. Next you must use apktool tool to decompile your systemui.apk which can be found in /system/app/... if you do not know how to do this then I dont think you should be following this tutorial ... but anyway google is your friend...
3. Navigate to your now decompiled systemui and go into \SystemUI.apk\smali\com\android\systemui\ and replace both R$layout.xml and R$id.xml with the ones found in my zip
4.Now go into the statusbar folder and open StatusbarService.smali with notepad++... and search for
Code:
.method private makeStatusBarView(Landroid/content/Context;)V
.locals 11
.parameter "context"
.prologue
const v10, 0x7f090011
const/4 v9, 0x0
const/16 v8, 0x8
.line 263
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
.line 265
.local v3, res:Landroid/content/res/Resources;
const v6, 0x1050005
invoke-virtual {v3, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v6
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mIconSize:I
.line 267
const v6, 0x7f030003
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v1
check-cast v1, Lcom/android/systemui/statusbar/ExpandedView;
.line 269
.local v1, expanded:Lcom/android/systemui/statusbar/ExpandedView;
iput-object p0, v1, Lcom/android/systemui/statusbar/ExpandedView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 271
const v6, 0x7f030002
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v4
check-cast v4, Lcom/android/systemui/statusbar/StatusBarView;
.line 272
.local v4, sb:Lcom/android/systemui/statusbar/StatusBarView;
iput-object p0, v4, Lcom/android/systemui/statusbar/StatusBarView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 275
const/4 v6, -0x3
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPixelFormat:I
.line 276
invoke-virtual {v4}, Lcom/android/systemui/statusbar/StatusBarView;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 277
.local v0, bg:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_0
.line 278
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getOpacity()I
move-result v6
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPixelFormat:I
.line 281
:cond_0
iput-object v4, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusBarView:Lcom/android/systemui/statusbar/StatusBarView;
.line 282
const v6, 0x7f09000a
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusIcons:Landroid/widget/LinearLayout;
.line 283
const v6, 0x7f090009
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/IconMerger;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mNotificationIcons:Lcom/android/systemui/statusbar/IconMerger;
.line 284
const v6, 0x7f090008
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mIcons:Landroid/widget/LinearLayout;
.line 285
const v6, 0x7f09000b
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTickerView:Landroid/view/View;
.line 286
const v6, 0x7f09000e
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/DateView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mDateView:Lcom/android/systemui/statusbar/DateView;
.line 288
new-instance v6, Lcom/android/systemui/statusbar/StatusBarService$ExpandedDialog;
invoke-direct {v6, p0, p1}, Lcom/android/systemui/statusbar/StatusBarService$ExpandedDialog;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/content/Context;)V
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedDialog:Landroid/app/Dialog;
.line 289
iput-object v1, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
.line 290
invoke-virtual {v1, v10}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedContents:Landroid/view/View;
.line 291
const v6, 0x7f090013
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mOngoingTitle:Landroid/widget/TextView;
.line 292
const v6, 0x7f090014
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mOngoingItems:Landroid/widget/LinearLayout;
.line 293
const v6, 0x7f090015
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mLatestTitle:Landroid/widget/TextView;
.line 294
const v6, 0x7f090016
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mLatestItems:Landroid/widget/LinearLayout;
.line 295
const v6, 0x7f090012
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mNoNotificationsTitle:Landroid/widget/TextView;
.line 296
const v6, 0x7f09000f
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mClearButton:Landroid/widget/TextView;
.line 297
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mClearButton:Landroid/widget/TextView;
iget-object v7, p0, Lcom/android/systemui/statusbar/StatusBarService;->mClearButtonListener:Landroid/view/View$OnClickListener;
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 298
const v6, 0x7f090010
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/ScrollView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mScrollView:Landroid/widget/ScrollView;
.line 299
invoke-virtual {v1, v10}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mNotificationLinearLayout:Landroid/view/View;
.line 301
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
invoke-virtual {v6, v8}, Lcom/android/systemui/statusbar/ExpandedView;->setVisibility(I)V
.line 302
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mOngoingTitle:Landroid/widget/TextView;
invoke-virtual {v6, v8}, Landroid/widget/TextView;->setVisibility(I)V
.line 303
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mLatestTitle:Landroid/widget/TextView;
invoke-virtual {v6, v8}, Landroid/widget/TextView;->setVisibility(I)V
.line 305
new-instance v6, Lcom/android/systemui/statusbar/StatusBarService$MyTicker;
invoke-direct {v6, p0, p1, v4}, Lcom/android/systemui/statusbar/StatusBarService$MyTicker;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/content/Context;Lcom/android/systemui/statusbar/StatusBarView;)V
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTicker:Lcom/android/systemui/statusbar/Ticker;
.line 307
const v6, 0x7f09000d
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/android/systemui/statusbar/TickerView;
.line 308
.local v5, tickerView:Lcom/android/systemui/statusbar/TickerView;
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTicker:Lcom/android/systemui/statusbar/Ticker;
iput-object v6, v5, Lcom/android/systemui/statusbar/TickerView;->mTicker:Lcom/android/systemui/statusbar/Ticker;
.line 310
const v6, 0x7f030006
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/TrackingView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTrackingView:Lcom/android/systemui/statusbar/TrackingView;
.line 311
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTrackingView:Lcom/android/systemui/statusbar/TrackingView;
iput-object p0, v6, Lcom/android/systemui/statusbar/TrackingView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 312
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTrackingView:Lcom/android/systemui/statusbar/TrackingView;
const v7, 0x7f090019
invoke-virtual {v6, v7}, Lcom/android/systemui/statusbar/TrackingView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/CloseDragHandle;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mCloseView:Lcom/android/systemui/statusbar/CloseDragHandle;
.line 313
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mCloseView:Lcom/android/systemui/statusbar/CloseDragHandle;
iput-object p0, v6, Lcom/android/systemui/statusbar/CloseDragHandle;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 315
const/high16 v6, 0x7f06
invoke-virtual {v3, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v6
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mEdgeBorder:I
.line 318
invoke-direct {p0}, Lcom/android/systemui/statusbar/StatusBarService;->setAreThereNotifications()V
.line 319
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mDateView:Lcom/android/systemui/statusbar/DateView;
const/4 v7, 0x4
invoke-virtual {v6, v7}, Lcom/android/systemui/statusbar/DateView;->setVisibility(I)V
.line 322
new-instance v2, Landroid/content/IntentFilter;
invoke-direct {v2}, Landroid/content/IntentFilter;-><init>()V
.line 323
.local v2, filter:Landroid/content/IntentFilter;
const-string v6, "android.intent.action.CONFIGURATION_CHANGED"
invoke-virtual {v2, v6}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 324
const-string v6, "android.intent.action.CLOSE_SYSTEM_DIALOGS"
invoke-virtual {v2, v6}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 325
const-string v6, "android.intent.action.SCREEN_OFF"
invoke-virtual {v2, v6}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 326
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p1, v6, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
const v6, 0x7f030008
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.local v5, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v5}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
invoke-virtual {v6, v5, v11}, Lcom/android/systemui/statusbar/ExpandedView;->addView(Landroid/view/View;I)V
.line 327
return-void
.end method
Replace the entire method with this one
Code:
.method private makeStatusBarView(Landroid/content/Context;)V
.locals 12
.parameter "context"
.prologue
const/4 v11, 0x0
const v10, 0x7f090011
const/4 v9, 0x0
const/16 v8, 0x8
.line 263
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
.line 265
.local v3, res:Landroid/content/res/Resources;
const v6, 0x1050005
invoke-virtual {v3, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v6
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mIconSize:I
.line 267
const v6, 0x7f030003
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v1
check-cast v1, Lcom/android/systemui/statusbar/ExpandedView;
.line 269
.local v1, expanded:Lcom/android/systemui/statusbar/ExpandedView;
iput-object p0, v1, Lcom/android/systemui/statusbar/ExpandedView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 271
const v6, 0x7f030002
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v4
check-cast v4, Lcom/android/systemui/statusbar/StatusBarView;
.line 272
.local v4, sb:Lcom/android/systemui/statusbar/StatusBarView;
iput-object p0, v4, Lcom/android/systemui/statusbar/StatusBarView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 275
const/4 v6, -0x3
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPixelFormat:I
.line 276
invoke-virtual {v4}, Lcom/android/systemui/statusbar/StatusBarView;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 277
.local v0, bg:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_0
.line 278
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getOpacity()I
move-result v6
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPixelFormat:I
.line 281
:cond_0
iput-object v4, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusBarView:Lcom/android/systemui/statusbar/StatusBarView;
.line 282
const v6, 0x7f09000a
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusIcons:Landroid/widget/LinearLayout;
.line 283
const v6, 0x7f090009
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/IconMerger;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mNotificationIcons:Lcom/android/systemui/statusbar/IconMerger;
.line 284
const v6, 0x7f090008
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mIcons:Landroid/widget/LinearLayout;
.line 285
const v6, 0x7f09000b
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTickerView:Landroid/view/View;
.line 286
const v6, 0x7f09000e
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/DateView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mDateView:Lcom/android/systemui/statusbar/DateView;
.line 288
new-instance v6, Lcom/android/systemui/statusbar/StatusBarService$ExpandedDialog;
invoke-direct {v6, p0, p1}, Lcom/android/systemui/statusbar/StatusBarService$ExpandedDialog;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/content/Context;)V
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedDialog:Landroid/app/Dialog;
.line 289
iput-object v1, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
.line 290
invoke-virtual {v1, v10}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedContents:Landroid/view/View;
.line 291
const v6, 0x7f090013
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mOngoingTitle:Landroid/widget/TextView;
.line 292
const v6, 0x7f090014
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mOngoingItems:Landroid/widget/LinearLayout;
.line 293
const v6, 0x7f090015
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mLatestTitle:Landroid/widget/TextView;
.line 294
const v6, 0x7f090016
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/LinearLayout;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mLatestItems:Landroid/widget/LinearLayout;
.line 295
const v6, 0x7f090012
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mNoNotificationsTitle:Landroid/widget/TextView;
.line 296
const v6, 0x7f09000f
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mClearButton:Landroid/widget/TextView;
.line 297
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mClearButton:Landroid/widget/TextView;
iget-object v7, p0, Lcom/android/systemui/statusbar/StatusBarService;->mClearButtonListener:Landroid/view/View$OnClickListener;
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 298
const v6, 0x7f090010
invoke-virtual {v1, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/ScrollView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mScrollView:Landroid/widget/ScrollView;
.line 299
invoke-virtual {v1, v10}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v6
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mNotificationLinearLayout:Landroid/view/View;
.line 301
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
invoke-virtual {v6, v8}, Lcom/android/systemui/statusbar/ExpandedView;->setVisibility(I)V
.line 302
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mOngoingTitle:Landroid/widget/TextView;
invoke-virtual {v6, v8}, Landroid/widget/TextView;->setVisibility(I)V
.line 303
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mLatestTitle:Landroid/widget/TextView;
invoke-virtual {v6, v8}, Landroid/widget/TextView;->setVisibility(I)V
.line 305
new-instance v6, Lcom/android/systemui/statusbar/StatusBarService$MyTicker;
invoke-direct {v6, p0, p1, v4}, Lcom/android/systemui/statusbar/StatusBarService$MyTicker;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/content/Context;Lcom/android/systemui/statusbar/StatusBarView;)V
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTicker:Lcom/android/systemui/statusbar/Ticker;
.line 307
const v6, 0x7f09000d
invoke-virtual {v4, v6}, Lcom/android/systemui/statusbar/StatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/android/systemui/statusbar/TickerView;
.line 308
.local v5, tickerView:Lcom/android/systemui/statusbar/TickerView;
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTicker:Lcom/android/systemui/statusbar/Ticker;
iput-object v6, v5, Lcom/android/systemui/statusbar/TickerView;->mTicker:Lcom/android/systemui/statusbar/Ticker;
.line 310
const v6, 0x7f030006
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/TrackingView;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTrackingView:Lcom/android/systemui/statusbar/TrackingView;
.line 311
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTrackingView:Lcom/android/systemui/statusbar/TrackingView;
iput-object p0, v6, Lcom/android/systemui/statusbar/TrackingView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 312
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTrackingView:Lcom/android/systemui/statusbar/TrackingView;
const v7, 0x7f090019
invoke-virtual {v6, v7}, Lcom/android/systemui/statusbar/TrackingView;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Lcom/android/systemui/statusbar/CloseDragHandle;
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mCloseView:Lcom/android/systemui/statusbar/CloseDragHandle;
.line 313
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mCloseView:Lcom/android/systemui/statusbar/CloseDragHandle;
iput-object p0, v6, Lcom/android/systemui/statusbar/CloseDragHandle;->mService:Lcom/android/systemui/statusbar/StatusBarService;
.line 315
const/high16 v6, 0x7f06
invoke-virtual {v3, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v6
iput v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mEdgeBorder:I
.line 318
invoke-direct {p0}, Lcom/android/systemui/statusbar/StatusBarService;->setAreThereNotifications()V
.line 319
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mDateView:Lcom/android/systemui/statusbar/DateView;
const/4 v7, 0x4
invoke-virtual {v6, v7}, Lcom/android/systemui/statusbar/DateView;->setVisibility(I)V
.line 322
new-instance v2, Landroid/content/IntentFilter;
invoke-direct {v2}, Landroid/content/IntentFilter;-><init>()V
.line 323
.local v2, filter:Landroid/content/IntentFilter;
const-string v6, "android.intent.action.CONFIGURATION_CHANGED"
invoke-virtual {v2, v6}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 324
const-string v6, "android.intent.action.CLOSE_SYSTEM_DIALOGS"
invoke-virtual {v2, v6}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 325
const-string v6, "android.intent.action.SCREEN_OFF"
invoke-virtual {v2, v6}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 326
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p1, v6, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
const v6, 0x7f030008
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.local v5, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v5}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
invoke-virtual {v6, v5, v11}, Lcom/android/systemui/statusbar/ExpandedView;->addView(Landroid/view/View;I)V
.line 327
return-void
.end method
Save the file and close it
5. Now go up into /systemui/smali/... drag and drop the file labeled "lidroid_1" into this location and remove the "_1" at the end of the file name...
Now go into com and place the file labeled "lidroid_2" place it into this location... like before erase the "_2" found at the end of the file name
Now we are pretty much done with the smali coding... there is still more to do but not quite yet...
6. Now back out and go into the res folder and go into the folder labeled "layout"... grab the three power widget xmls out of my zip and move them here
7. Back out of "layout and go into the folder labeled "Values"... and first open the ids.xml... copy and paste the below code in between the last entry and </resources> and save the file
Code:
<item type="id" name="power_widget_button">false</item>
<item type="id" name="power_widget_button_image">false</item>
<item type="id" name="power_widget_button_text">false</item>
<item type="id" name="power_widget_button_indic">false</item>
8. This step by far is the longest and most interactive... go into public.xml and scroll down to the last entry labeled like this <public type="drawable"... go under it and copy and paste these entries directly under it
Code:
<public type="drawable" name="stat_2g3g_off" id="0x7f020174" />
<public type="drawable" name="stat_2g3g_on" id="0x7f020175" />
<public type="drawable" name="stat_3g_on" id="0x7f020176" />
<public type="drawable" name="stat_airplane_off" id="0x7f020177" />
<public type="drawable" name="stat_airplane_on" id="0x7f020178" />
<public type="drawable" name="stat_bluetooth_off" id="0x7f020179" />
<public type="drawable" name="stat_bluetooth_on" id="0x7f02017a" />
<public type="drawable" name="stat_brightness_auto" id="0x7f02017b" />
<public type="drawable" name="stat_brightness_mid" id="0x7f02017c" />
<public type="drawable" name="stat_brightness_off" id="0x7f02017d" />
<public type="drawable" name="stat_brightness_on" id="0x7f02017e" />
<public type="drawable" name="stat_data_off" id="0x7f02017f" />
<public type="drawable" name="stat_data_on" id="0x7f020180" />
<public type="drawable" name="stat_flashlight_off" id="0x7f020181" />
<public type="drawable" name="stat_flashlight_on" id="0x7f020182" />
<public type="drawable" name="stat_gps_off" id="0x7f020183" />
<public type="drawable" name="stat_gps_on" id="0x7f020184" />
<public type="drawable" name="stat_ing_off" id="0x7f020185" />
<public type="drawable" name="stat_lock_screen_off" id="0x7f020186" />
<public type="drawable" name="stat_lock_screen_on" id="0x7f020187" />
<public type="drawable" name="stat_orientation_off" id="0x7f020188" />
<public type="drawable" name="stat_orientation_on" id="0x7f020189" />
<public type="drawable" name="stat_ring_on" id="0x7f02018a" />
<public type="drawable" name="stat_screen_timeout_off" id="0x7f02018b" />
<public type="drawable" name="stat_screen_timeout_on" id="0x7f02018c" />
<public type="drawable" name="stat_silent" id="0x7f02018d" />
<public type="drawable" name="stat_sleep" id="0x7f02018e" />
<public type="drawable" name="stat_sync_off" id="0x7f02018f" />
<public type="drawable" name="stat_sync_on" id="0x7f020190" />
<public type="drawable" name="stat_vibrate_off" id="0x7f020196" />
<public type="drawable" name="stat_vibrate_on" id="0x7f020197" />
<public type="drawable" name="stat_wifi_ap_off" id="0x7f020198" />
<public type="drawable" name="stat_wifi_ap_on" id="0x7f020199" />
<public type="drawable" name="stat_wifi_off" id="0x7f02019a" />
<public type="drawable" name="stat_wifi_on" id="0x7f02019b" />
<public type="drawable" name="stat_bg_ing" id="0x7f020191" />
<public type="drawable" name="stat_bg_off" id="0x7f020192" />
<public type="drawable" name="stat_bg_on" id="0x7f020193" />
<public type="drawable" name="stat_power_bg" id="0x7f020194" />
<public type="drawable" name="stat_ring_vibrate_on" id="0x7f020195" />
Here goes the time consuming part... do you see where it says id="0x********"? This a unique identifier that is used to identify the entries in the smali code... and the id must be unique or you will not be able to compile properly... so you must change all of the above ids to ones that arent specified yet in the xml... you must find the last hexadecimal number already under use in the "drawable" section... mine was 0x7f020173... so I started numbering mine at 0x7f020174... not all of the entries in the xml are in order so you will have to manually find the last number used...
After you have correctly labeled each entry scroll down to the last entry labeled like this <public type="layout" and go under it and copy and paste this
Code:
<public type="layout" name="power_widget_button" id="0x7f030007" />
<public type="layout" name="power_widget_layout" id="0x7f030008" />
<public type="layout" name="power_widget_scrollview" id="0x7f030009" />
Once again... make sure the new entries have unique ids... there should only be a few entries in the layout section so it should be easier this go around..
Once you are done scroll down to the last entry labeled like this <public type="string" and copy and past this code directly under it
Code:
<public type="string" name="quickpanel_wifi_text" id="0x7f070013" />
<public type="string" name="quickpanel_dc_text" id="0x7f070014" />
<public type="string" name="quickpanel_network_mode_text" id="0x7f070015" />
<public type="string" name="quickpanel_sound_text" id="0x7f070016" />
<public type="string" name="quickpanel_sound_vibration_text" id="0x7f070017" />
<public type="string" name="quickpanel_silent_text" id="0x7f070018" />
<public type="string" name="quickpanel_vibration_text" id="0x7f070019" />
<public type="string" name="quickpanel_rotation_text" id="0x7f07001a" />
<public type="string" name="quickpanel_bluetooth_text" id="0x7f07001b" />
<public type="string" name="quickpanel_gps_text" id="0x7f07001c" />
<public type="string" name="quickpanel_autosync_text" id="0x7f07001d" />
<public type="string" name="quickpanel_brightness_text" id="0x7f07001e" />
<public type="string" name="quickpanel_airplane_text" id="0x7f07001f" />
Again... give each new entry a unique id
Scroll down to the bottom of the xml and look at the last entry labeled <public type="id" and copy and paste this code
Code:
<public type="id" name="power_widget_button" id="0x7f09001a" />
<public type="id" name="power_widget_button_image" id="0x7f09001b" />
<public type="id" name="power_widget_button_text" id="0x7f09001c" />
<public type="id" name="power_widget_button_indic" id="0x7f09001d" />
Now... you still there? guess what... YOU FINISHED STEP 8!!!!!!!! XDXDXDXDXD Ready for step 9? Yes(scroll down) No(Press the big red X on the top right of your screen) Maybe (Save all of your work... take a nap and come back later) lol...
9. Keep the public.xml open and back out of the res folder and go into /systemui/smali/com/lidroid/systemui/quickpanel/ and keep the folder open...
This step involves telling the code which icons to use for the notification toggles... if you dont do this step you will probably end up with battery icons for the toggles the same way I did... =/
Inside of the zip that you downloaded earlier you will see a file named "ID_Values"... open it... In an attempt to make this as noob friendly I have replaced all of the hexadecimal ids in the smali with text which corresponds to which id you should use and specified which smali file they are located in... look at the first part of the xml... you should see
AirplaneButton.smali
stat_airplane_off = Airplane_off
stat_airplane_on = Airplane_on
What this means is that inside of the AirplaneButton.smali file I have inserted Airplane_off and Airplane_on and that they correspond to stat_airplane_off and stat_airplane_on in the public.xml.
What you must do is search for the text on the right of the equal sign in the smali file... once found go into the public.xml and search for the text on the left of the equal sign and copy its hexadecimal id into the smali file over the text... if you didnt understand I will show you what I mean...
If in my public.xml I had this
Code:
<public type="drawable" name="stat_airplane_on" id="0x00000000" />
then I would copy 0x00000000 and paste it over Airplane_on...
your end result should now look like this
Code:
.line 24
const v0, 0x00000000
Instead of
Code:
.line 24
const v0, Airplane_on
Now... got that? you must do this for every entry that I specified in "ID_Values" after you are done you may move on to the next step
10.Now hang in there... you're almost there... open strings.xml and copy and paste this code under the last entry
Code:
<string name="quickpanel_wifi_text" />
<string name="quickpanel_dc_text" />
<string name="quickpanel_network_mode_text" />
<string name="quickpanel_sound_text" />
<string name="quickpanel_sound_vibration_text" />
<string name="quickpanel_silent_text" />
<string name="quickpanel_vibration_text" />
<string name="quickpanel_rotation_text" />
<string name="quickpanel_bluetooth_text" />
<string name="quickpanel_gps_text" />
<string name="quickpanel_autosync_text" />
<string name="quickpanel_brightness_text" />
<string name="quickpanel_airplane_text" />
save and exit the file
11. Welcome to the last step... which should be simple enough... extract the zip file named icons located inside of the zip I created and place each png into /systemui/res/drawable-hdpi... and VOILA!!! compile your now modified apk... for any compile errors you receive please notify me in this thread so I can assist you.