This mod has been done by the lidroid and i am writing the guide here, so that it can be used in custom ROMS
What it does?
All the applications which are installed in app drawer are available in flashbar! Even if new apps are installed, then those apps are also available in flashbar...hence you dont need any apk to control or add the applications in flashbar!
Must Have
1. Apktool
2. Some knowledge about compiling and decompiling
3. 7zip
4. notepad++
5. backsmali
How to
1. Decompile the flashbarservice.apk which is available in system/app
Go to flashbarservice\smali\com\sec\android\app\FlashBarService\FlashBarInfo.smali
Open the file FlashBarInfo.smali using notepad++
search for method .method public generateFlashBarList()V
and change the following code from
PHP:
const-string v8, "android.intent.category.MULTIWINDOW_LAUNCHER"
to
PHP:
const-string v8, "android.intent.category.LAUNCHER"
Now Save and recompile it and the first part is done!
2. Decompile services.jar which is available in system/framework folder
and go to services.jar.out\smali\com\android\server\am\MultiWindowManagerService.smali
Open the file MultiWindowManagerService.smali using notepad++ and search for following method .method public isSupportApp(Ljava/lang/StringZ
Change the code from
PHP:
.method public isSupportApp(Ljava/lang/String;)Z
.locals 1
iget-object v0, p0, Lcom/android/server/am/MultiWindowManagerService;->mSupportAppList:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
to. or insert the code ++ before iget-object v0, p0
PHP:
.method public isSupportApp(Ljava/lang/String;)Z
.locals 1
++const/4 v0, 0x1
++goto :goto_0 (goto_0 will change based on the diif services.jar. Just scroll down in the code and you will see goto_X and replace with this one or else follow the easiset code given below)
iget-object v0, p0, Lcom/android/server/am/MultiWindowManagerService;->mSupportAppList:Ljava/util/ArrayList;
easiest one! Replace the entire second part code with this one - Thanks to LegendK95 for tip!
PHP:
.method public isSupportApp(Ljava/lang/String;)Z
.registers 2
.prologue
const/4 v0, 0x1
return v0
.end method
Make the above said changes and save it. Recompile and flash the same!
After flashing, you will see all apps in app drawer will be listed in multiwindow / flashbar...Search for flashbar in data/data and then delete the folder. Now reboot...You will have all the apps in flashbar in sorted order!
UPDATE: TO REMOVE THE LAGY WHEN YOU HAVE MORE APPLICATIONS IN FLASHBAR
As i said abover make all necessary changes and also make changes in the following files in order to remove the laginess when you have more apps installed!
Decompile flashbarservice.apk and go to
flashbarservice/smali/com/sec/android/app/FlashBarService/AppListEditWindow.smali and open the file
enter all the codes which is mentioned in ++ and remove the codes which is mentioned in --
PHP:
# direct methods
+.method static constructor <clinit>()V
+ .locals 1
+
+ const-string v0, "lidroid-flashbar"
+
+ invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
+
+ return-void
+.end method
+
.method public constructor <init>(Landroid/content/Context;Lcom/sec/android/app/FlashBarService/AppListWindow;Lcom/sec/android/app/FlashBarService/FlashBarInfo;)V
.locals 3
return-object v0
.end method
+.method private native getIndexByViewPosition(I)I
+.end method
+
+.method private native getViewPositionByIndex(I)I
+.end method
+
.method private makeAppListEditLayout()V
.locals 4
.method public getImageViewByIndex(I)Landroid/view/View;
.locals 2
+ invoke-direct {p0, p1}, Lcom/sec/android/app/FlashBarService/AppListEditWindow;->getViewPositionByIndex(I)I
+
+ move-result v0
+
iget-object v1, p0, Lcom/sec/android/app/FlashBarService/AppListEditWindow;->mEditGridView:Landroid/widget/GridView;
- invoke-virtual {v1, p1}, Landroid/widget/GridView;->getChildAt(I)Landroid/view/View;
+ invoke-virtual {v1, v0}, Landroid/widget/GridView;->getChildAt(I)Landroid/view/View;
move-result-object v0
:cond_0
:goto_1
+ invoke-direct {p0, v0}, Lcom/sec/android/app/FlashBarService/AppListEditWindow;->getIndexByViewPosition(I)I
+
+ move-result v0
+
return v0
:cond_1
then copy the Myapplication.smali at flashbarservice_lidroid\smali\com\sec\android\app\FlashBarService
Compile back and done!
Note: Before flashing make sure to include the liblidroid-flashbar.so file in lib folder without fail!
Attached the lib file along with smali file! Extract and flash according to instructions given above!
Credits
Lidroid
Thanks mate. This will be a great help
Nice Guide ...Thanks for sharing knowledge..
does that work with ODEX roms ????
The mod by goddamnit is simplest. Just flash in recovery
vkghadge said:
The mod by goddamnit is simplest. Just flash in recovery
Click to expand...
Click to collapse
I use same method to do that
But I get no reply from lidroid that if I can post how to mod
so I think I post mod file only
And this post is for developer only I think ,no details ,just how to
---------- Post added at 12:15 AM ---------- Previous post was at 12:13 AM ----------
KBJ911 said:
does that work with ODEX roms ????
Click to expand...
Click to collapse
It do not work on ODEX rom right now
Previously I only changed the framework-res.apk array values and seems there's a known bug where apps other than in the main window will be randomly added.
Is the bug affected with this method by changing the flashbarservice.apk and services.jar? And do we need to revert back the framework-res.apk array?
Thanks...
Nazar78 said:
Previously I only changed the framework-res.apk array values and seems there's a known bug where apps other than in the main window will be randomly added.
Is the bug affected with this method by changing the flashbarservice.apk and services.jar? And do we need to revert back the framework-res.apk array?
Thanks...
Click to expand...
Click to collapse
i can see the codes given is bypassing the array list in framework-res so doesnt matter u revert or not. but better revert to avoid any issue due to bad apk recompiling.
ok noted, thanks alot broe...
LJ7 is slightly different, goto_0 need to change to goto_9.
PHP:
.method public isSupportApp(Ljava/lang/String;)Z
.registers 3
.parameter "packageName"
.prologue
.line 391
++const/4 v0, 0x1
++goto :goto_9
iget-object v0, p0, Lcom/android/server/am/MultiWindowManagerService;->mSupportAppList:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_a
.line 392
const/4 v0, 0x1
.line 395
:goto_9
return v0
:cond_a
const/4 v0, 0x0
goto :goto_9
.end method
Or keep it very simple and use this:
Code:
.method public isSupportApp(Ljava/lang/String;)Z
.registers 2
.prologue
const/4 v0, 0x1
return v0
.end method
+1 ..... but another thing I noticed on LJ7, there's no need to modify the services.jar (not sure about other rom), just the FlashBarService.apk will do.
I tested on stock LJ7 odex rom with services.jar/odex & framework-res.apk unmodified... Decompiled and edited the FlashBarService.apk, recompiled, reodexed.
Maybe someone with odex rom wanna try? The attached rar contains the original LJ7 and patched FlashBarService.odex from OP. Backup the original /system/app/FlashBarService.odex before replacing...
-----EDITED----
ignore above... it still needs the services.jar to be edited
And reattached again are both the FlashBarService/services LJ7 original & patched odex:
/system/app/FlashBarService.odex
/system/framework/services.odex
tried your files on stock LJ3 and failed (of course)
then i try to modify myself with your guide and combined with odex tutorial here
but still faled the system wont boot, stuck at boot logo.
when i odexing the FlashBarService.apk which services.jar should i use? the modified one? or the original?
**EDIT:
my fault, didnt follow the instruction correctly
I just copied deodex(backsmali) command from the thread without getting BOOTCLASSPATH from init.rc
its work now
Can someone post video review? Will this work for LJ1 Indian version?
Sent from Samsung Galaxy Note 2 using Tapatalk 2
RakeshRaja said:
Can someone post video review? Will this work for LJ1 Indian version?
Sent from Samsung Galaxy Note 2 using Tapatalk 2
Click to expand...
Click to collapse
It will work mate! I am also from india and i am using on LJ1...give me flasharbarservice.apk and services.jar and i iwll upload the modded one for you!
Nazar78 said:
+1 ..... but another thing I noticed on LJ7, there's no need to modify the services.jar (not sure about other rom), just the FlashBarService.apk will do.
I tested on stock LJ7 odex rom with services.jar/odex & framework-res.apk unmodified... Decompiled and edited the FlashBarService.apk, recompiled, reodexed.
Maybe someone with odex rom wanna try? The attached rar contains the original LJ7 and patched FlashBarService.odex from OP. Backup the original /system/app/FlashBarService.odex before replacing...
-----EDITED----
ignore above... it still needs the services.jar to be edited
And reattached again are both the FlashBarService/services LJ7 original & patched odex:
/system/app/FlashBarService.odex
/system/framework/services.odex
Click to expand...
Click to collapse
After replaced two "modified" odex files,
All installed application that appear, but not all application that can be load as multi windows
e.g, poweramp , line , whatsapp etc
ROY10 said:
After replaced two "modified" odex files,
All installed application that appear, but not all application that can be load as multi windows
e.g, poweramp , line , whatsapp etc
Click to expand...
Click to collapse
Hmm I'm not sure, I just tested on another rom LJA, seems ok... also I replaced the pngs from this thread, Transparent MultiWindow.
ROY10 said:
After replaced two "modified" odex files,
All installed application that appear, but not all application that can be load as multi windows
e.g, poweramp , line , whatsapp etc
Click to expand...
Click to collapse
to remove the lagy of apps...go to data/data using root explorer and search for flashbar and then delete the flashbar folder and reboot...now you will have all the apps sorted in flashbar instead of in edit!
It worked perfectly for me. Flashed both zip files in cwm, plus MW transparency and work like a charm. I was able to add/remove all apps.
Sent from my GT-N7100 using xda premium
on lj3...interesting issue...everything shows in multiwindow draw....but if i scroll down and try dragging a new app from the bottom of the list to the side bar, it added the one from the top...
Related
For ROM developers, themers and advanced users!
This guide is a reference for the smali code changed that must be made inside of services.jar to hide certain status bar icons. This reference assumes that you already know how to recompile a framework file using smali/baksmali.
Warning: As always, you assume all responsibility for any changes that you make to your phone. Always backup your phone before making any changes.
All code is within services.jar under com/android/server/status
Location
HtcCdmaStatusBar.smali
LINES: 679 & 724
VISIBLE (Default)
Line 679
Code:
invoke-virtual {v0, v1, v4}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Line 724
Code:
invoke-virtual {v0, v1, v4}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
HIDDEN
Changes: v4 to v6
Line 679
Code:
invoke-virtual {v0, v1, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Line 724
Code:
invoke-virtual {v0, v1, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Clock
StatusBarPolicy.smali
LINE: 656
VISIBLE (Default)
Code:
.line 574
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
HIDDEN
Changes: Add line underneath line 656
Code:
.line 574
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Battery
StatusBarPolicy.smali
LINE: 696
VISIBLE (Default)
Code:
iput-object v3, p0, Lcom/android/server/status/StatusBarPolicy;->mBatteryIcon:Landroid/os/IBinder;
HIDDEN
Changes: Add line underneath line 696
Code:
iput-object v3, p0, Lcom/android/server/status/StatusBarPolicy;->mBatteryIcon:Landroid/os/IBinder;
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Alarm
StatusBarPolicy.smali
LINE: 3440
VISIBLE (Default)
Code:
.line 944
const-string v1, "alarmSet"
const/4 v2, 0x0
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
HIDDEN
Thanks to rmk40 for collaboration and testing.
This one is a little tricky. Follow the steps below:
Step 1: Delete lines 3446 through 3449 (shown below).
Code:
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
Step 2: Add line below line 3442 (shown below).
Code:
.line 944
const/4 v0, 0x0
const-string v1, "alarmSet"
const/4 v2, 0x0
is this just for Sense or can I do this with an AOSP ROM too?
nothing to see here...
TylerD004 said:
is this just for Sense or can I do this with an AOSP ROM too?
Click to expand...
Click to collapse
All of these except the location should work for AOSP, but the line numbers might be different.
Most AOSP ROMs like CM6 have built in utilities to do this for you however.
Noob question !
How do i edit the services.jar file ?
Can you put the finished product for removing the Alarm clock so I can match it with what I have? Our line counts differ.
Thanks.
EDIT: What does line 3442 say? I'm counting the lines and pretending they are 344x lines and pasting there but it doesn't seem to be working. Thanks for the help.
EDIT#2 Okay, I figured it out by downloading someone elses work and matching mine with theirs. Thanks for the references, this **** makes my phone looks so sexy! On to my next task!
drgopoos said:
Noob question !
How do i edit the services.jar file ?
Click to expand...
Click to collapse
Decompile it using apktool.
i am trying to modify Lou's Redemptive rEVOloution rom to have a no battery. I have been on it for 2 days. I am a noob on this part of it but very whiling to learn. He told me to pull the services.jar file and modify it. I have pulled the file.... i read on here to decompile it with apktool.... well i have apktool, but need a push start from here. The rom thread has been no help. Any help or direction would be great, thank you.
kmcrane said:
i am trying to modify Lou's Redemptive rEVOloution rom to have a no battery. I have been on it for 2 days. I am a noob on this part of it but very whiling to learn. He told me to pull the services.jar file and modify it. I have pulled the file.... i read on here to decompile it with apktool.... well i have apktool, but need a push start from here. The rom thread has been no help. Any help or direction would be great, thank you.
Click to expand...
Click to collapse
Assuming your using windows:
Extract the two apktool .tar files to your /windows root directory. Make a directory for the services.jar file and copy it in. Open a command prompt and change to that directory you just created. Command line to decompile is apktool d services.jar
Thats as far as i can get you.. I just started learning last night. hope that helps.
normg said:
Assuming your using windows:
Extract the two apktool .tar files to your /windows root directory. Make a directory for the services.jar file and copy it in. Open a command prompt and change to that directory you just created. Command line to decompile is apktool d services.jar
Thats as far as i can get you.. I just started learning last night. hope that helps.
Click to expand...
Click to collapse
Yes!! Sorry, I am using windows...
thanks for your help and this thread. I have made my changes, now i need to "recompile" (sorry if it is the wrong term). but i need to make the services.jar.out into a file so i can put it into my .zip (rom) I am going to set up a workstation computer with the right programs and files on it for future work.
Thanks again and any help on the next steps would be awesome.
@pardonmyfreedom
Can you update the hide clock for the new services jar? I am running SR3.5 and I can't seem to find line 574. Thanks for all the help.
removed post
craigmack said:
@pardonmyfreedom
Can you update the hide clock for the new services jar? I am running SR3.5 and I can't seem to find line 574. Thanks for all the help.
Click to expand...
Click to collapse
CTRL+F for line 592 in the SkyRaider 3.5 Services.jar
cannot find status folder on mine....using CM7 RC1
How to hide signal icon?
Thanks,I'm trying···
frantic912 said:
cannot find status folder on mine....using CM7 RC1
Click to expand...
Click to collapse
Me too...help??
Can help I remove time icon?
http://forum.xda-developers.com/attachment.php?attachmentid=611966&stc=1&d=1306821621
Hi there, I want to share this tutorial for implementing Swipe-to-Remove Notification feature found in CyanogenMod to stock ROM (Gingerbread or earlier ROM). Sure it will be available on ICS but for those who like to add one to their custom ROM here's how Currently i don't know to whom should i give credit to, if anybody knows please post below and i'll add the link for the original modder. Thanks to:
1. like-p for help showing me what files to be edited
2. LeoMar75 for some info on how to control Stub switch case
This mod is based on Sony Ericsson Xperia Ray, so take care when adding to another device, some code might be different though so no direct copy paste, please learn some of the line first.
PS: For Froyo mod, please follow Jason-EX here
Requirement:
1. decompiled Framework.jar with Baksmali manager
2. decompiled SystemUI.apk with APK Multi Tool
3. Some Basic understanding about editing xml file and smali code.
4. WinMerge or other comparison tool (to better editing and comparing with my sample file)
5. Backup the framework.jar and SystemUI.apk first!
Files to be edited:
in SystemUI.apk
res/anim/
res/layout/status_bar_latest_event.xml
res/values/public.xml
smali/com/android/systemui/statusbar/LatestItemContainer$1.smali
smali/com/android/systemui/statusbar/LatestItemContainer.smali
smali/com/android/systemui/statusbar/StatusBarService$7.smali (or depends on your numbering, could be $8 or larger)
smali/com/android/systemui/statusbar/StatusBarService.smali
in framework.jar:
smali/com/android/internal/statusbar/IStatusBarService$Stub$Proxy.smali
smali/com/android/internal/statusbar/IStatusBarService$Stub.smali
smali/com/android/internal/statusbar/IStatusBarService.smali
UPDATE: This is the additional guide for other device when editing StatusBarService.smali. See here:
1. HTC based
2. Samsung based
Alright, let's mod one by one
1. Editing SystemUI.apk
1.1 Editing res/anim
We are registering anim object here, so swipe animation can be done.
Create folder anim (if not exists yet) inside /res folder
Create 2 file named slide_out_left_basic.xml and slide_out_right_basic.xml inside res/anim folder
for slide_out_left_basic.xml, edit the file and fill with this
Code:
<?xml version="1.0" encoding="utf-8"?>
<translate android:duration="@android:integer/config_mediumAnimTime" android:fromXDelta="0.0" android:toXDelta="-100.0%p"
xmlns:android="http://schemas.android.com/apk/res/android" />
for slide_out_right_basic.xml, edit the file and fill with this
Code:
<?xml version="1.0" encoding="utf-8"?>
<translate android:duration="@android:integer/config_mediumAnimTime" android:fromXDelta="0.0" android:toXDelta="100.0%p"
xmlns:android="http://schemas.android.com/apk/res/android" />
Save both
Update: Mirko ddd (&shoman94 have pointed that out before but i have no idea where to change, sorry mate) have given me the tip to improve the gesture. read his post here Thanks mate, both of you!
1.2 Editing res/layout/status_bar_latest_event.xml
We are replacing LinearLayout object used in StatusBar with LatestItemContainer here, so notification can be removed. We handle the Styling first by editing this .xml first. Here are the steps:
Change the code from Original code to this (change the bold one)
Code:
<?xml version="1.0" encoding="utf-8"?>
<[B]com.android.systemui.statusbar.LatestItemContainer [/B]android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="65.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.systemui.statusbar.LatestItemView android:id="@id/content" android:background="@android:drawable/status_bar_item_background" android:paddingRight="6.0sp" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="64.0sp" android:shadowColor="#ff000000" android:shadowDx="0.0" android:shadowDy="1.0" android:shadowRadius="2.0" />
<View android:background="@drawable/divider_horizontal_light_opaque" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<[B]/com.android.systemui.statusbar.LatestItemContainer[/B]>
Save
1.3 Editing res/values/public.xml
This one is for registering anim file that we made on step 1.1 to be available publicly and to be recognized in .smali program. Here are the steps:
Recompile your apk after putting anim file into /res folder
Decompile again the resulting apk
Inside /res/values/public.xml, you'll found something like this:
Code:
<resources>
.
.
.
[B]
<public type="anim" name="slide_out_left_basic" id="0x7f0c0000" />
<public type="anim" name="slide_out_right_basic" id="0x7f0c0001" />
[/B]
</resources>
[*]Remember the ID for both anim lines. This will be applied again on the step 1.4
1.4 Adding smali/com/android/systemui/statusbar/LatestItemContainer$1.smali and smali/com/android/systemui/statusbar/LatestItemContainer.smali
This is the class of LatestItemContainer that will be used to handle the notification list instead of LatestItemView. Here are the steps:
Please download from the attachment
insert the files inside to mentioned folder above
Inside LatestItemContainer$1.smali, there's an id that references the anim from step1.2. please edit it if you have different id for anim left or anim from previous step.
Code:
.line 53
:cond_0
const/high16 v1, [B]0x7f0c[/B]
and
Code:
.line 51
const v1, [B]0x7f0c0001[/B]
1.5 Add smali/com/android/systemui/statusbar/StatusBarService$7.smali (or depends on your existing framework numbering, could be $8 or larger)
This is additional function for StatusBarService to handle onClearNotification function. Here are the steps:
Extract the StatusBarService$7.smali from attachment
If StatusBarService$7.smali does not exist before, just place it inside, if not, skip this step.
If StatusBarService$7.smali exists, Please rename the file to StatusBarService$8.smali (or whatever higher number that is unused) and rename all the line inside the file from
Code:
StatusBarService$7
to
Code:
StatusBarService$8
1.6 Edit smali/com/android/systemui/statusbar/StatusBarService.smali
UPDATE: This is the additional guide for other device when editing StatusBarService.smali. See here:
1. Generic java readout
2. HTC based
3. Samsung based
This is the file that generate NotificationView. Please take care of the changes here more carefully because there might be some differences between vendors in this file. Here are the steps:
Open StatusBarService.smali and find this function
Code:
.method makeNotificationView(Lcom/android/internal/statusbar/StatusBarNotification;Landroid/view/ViewGroup;)[Landroid/view/View;
Find this code in the makeNotificationView function body:
Code:
invoke-virtual {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v18
const v4, 0x7f0b0014
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v10
Insert the bold code below between the existing code:
Code:
invoke-virtual {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v18
[B] check-cast v18, Lcom/android/systemui/statusbar/LatestItemContainer;
.line 516
.local v18, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_swno
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_swno
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v4
move-object/from16 v1, p0
move-object/from16 v2, p1
invoke-direct {v0, v1, v2}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v18
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/Runnable;)V
.line 735
:cond_swno[/B]
const v4, 0x7f0b0014
move-object/from16 v0, v18
move v1, v4
[B] invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;[/B]
move-result-object v10
Once again, change
Code:
StatusBarService$7
to
Code:
StatusBarService$8
line if you happened to have StatusBarService$8.smali as the result of renaming on the previous step.
IMPORTANT LOGIC TO BE UNDERSTOOD: This step tells the function to:
1. cast the already made View Object to LatestItemContainer instead of using LatestView class.
2. Filter if the Notification is removable or not
3. the LatestItemContainer object (v18) is assigned with onSwipeCallback(new StatusBarService$7)
Change the following (still on the same function body):
Code:
move v1, v4
invoke-virtual {v0, v1}, Landroid/view/View;->setDrawingCacheEnabled(Z)V
.line 542
const/4 v4, 0x3
to
Code:
move v1, v4
[B] invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setDrawingCacheEnabled(Z)V
[/B]
.line 542
const/4 v4, 0x3
Please note:
StatusBarService.smali might be different between vendor, so please adapt with your .smali to implement the above coding.
2. Editing framework.jar
2.1 editing smali/com/android/internal/statusbar/IStatusBarService$Stub.smali
Here are the steps:
Add this code on variable declaration part inside the file
Code:
.field static final TRANSACTION_onClearAllNotifications:I = 0xb
[B].field static final TRANSACTION_onNotificationClear:I = 0xc[/B]
.field static final TRANSACTION_onNotificationClick:I = 0x9
.field static final TRANSACTION_onNotificationError:I = 0xa
If the 0xc is already used on another static value, you must change it so it remains unique.
Find this code:
Code:
.method public onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
.registers 14
.parameter "code"
.parameter "data"
.parameter "reply"
.parameter "flags"
.annotation system Ldalvik/annotation/Throws;
value = {
Landroid/os/RemoteException;
}
.end annotation
.prologue
.line 39
sparse-switch p1, :sswitch_data_124
change to
Code:
.method public onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
.registers 14
.parameter "code"
.parameter "data"
.parameter "reply"
.parameter "flags"
.annotation system Ldalvik/annotation/Throws;
value = {
Landroid/os/RemoteException;
}
.end annotation
.prologue
.line 39
[B]sparse-switch p1, :sswitch_data_13e[/B]
Insert/replace this code (it is at the end of the file):
Code:
.line 176
const/4 v0, 0x1
goto/16 :goto_7
.line 39
:sswitch_data_124
.sparse-switch
0x1 -> :sswitch_f
0x2 -> :sswitch_1c
0x3 -> :sswitch_29
0x4 -> :sswitch_42
0x5 -> :sswitch_5f
0x6 -> :sswitch_7b
0x7 -> :sswitch_8d
0x8 -> :sswitch_c7
0x9 -> :sswitch_d5
0xa -> :sswitch_ef
0xb -> :sswitch_116
0x5f4e5446 -> :sswitch_8
.end sparse-switch
to
Code:
[B]
.line 176
const/4 v0, 0x1
goto/16 :goto_7
.end local v1 #_arg0:Ljava/lang/String;
.end local v2 #_arg1:Ljava/lang/String;
.end local v3 #_arg2:I
:sswitch_124
const-string v0, "com.android.internal.statusbar.IStatusBarService"
invoke-virtual {p2, v0}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V
.line 177
invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;
move-result-object v1
.line 178
.restart local v1 #_arg0:Ljava/lang/String;
invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;
move-result-object v2
.line 179
.restart local v2 #_arg1:Ljava/lang/String;
invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I
move-result v3
.line 180
.restart local v3 #_arg2:I
invoke-virtual {p0, v1, v2, v3}, Lcom/android/internal/statusbar/IStatusBarService$Stub;->onNotificationClear(Ljava/lang/String;Ljava/lang/String;I)V
.line 181
invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V
.line 182
const/4 v0, 0x1
goto/16 :goto_7[/B]
.line 39
:sswitch_data_13e
.sparse-switch
0x1 -> :sswitch_f
0x2 -> :sswitch_1c
0x3 -> :sswitch_29
0x4 -> :sswitch_42
0x5 -> :sswitch_5f
0x6 -> :sswitch_7b
0x7 -> :sswitch_8d
0x8 -> :sswitch_c7
0x9 -> :sswitch_d5
0xa -> :sswitch_ef
0xb -> :sswitch_116
[B]0xc -> :sswitch_124[/B]
0x5f4e5446 -> :sswitch_8
.end sparse-switch
it's important to note this
Code:
[B]0xc -> :sswitch_124[/B]
If you rename the static at the previous steps, please change the 0xc accordingly.
2.2 Editing smali/com/android/internal/statusbar/IStatusBarService$Stub$Proxy.smali
Here are the steps:
Insert these function code to the file:
Code:
.method public onNotificationClear(Ljava/lang/String;Ljava/lang/String;I)V
.registers 9
.parameter "pkg"
.parameter "tag"
.parameter "id"
.annotation system Ldalvik/annotation/Throws;
value = {
Landroid/os/RemoteException;
}
.end annotation
.prologue
.line 359
invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;
move-result-object v0
.line 360
.local v0, _data:Landroid/os/Parcel;
invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;
move-result-object v1
.line 362
.local v1, _reply:Landroid/os/Parcel;
:try_start_8
const-string v2, "com.android.internal.statusbar.IStatusBarService"
invoke-virtual {v0, v2}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V
.line 363
invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V
.line 364
invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V
.line 365
invoke-virtual {v0, p3}, Landroid/os/Parcel;->writeInt(I)V
.line 366
iget-object v2, p0, Lcom/android/internal/statusbar/IStatusBarService$Stub$Proxy;->mRemote:Landroid/os/IBinder;
const/16 v3, 0xa
const/4 v4, 0x0
invoke-interface {v2, v3, v0, v1, v4}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
.line 367
invoke-virtual {v1}, Landroid/os/Parcel;->readException()V
:try_end_21
.catchall {:try_start_8 .. :try_end_21} :catchall_28
.line 370
invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V
.line 371
invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V
.line 373
return-void
.line 370
:catchall_28
move-exception v2
invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V
.line 371
invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V
throw v2
.end method
Please inspect the code for this part:
Code:
[B]const/16 v3, 0xa[/B]
const/4 v4, 0x0
invoke-interface {v2, v3, v0, v1, v4}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
The bold one must match on one of the switch case value at the end of IStatusBarService$Stub.smali,
in my phone actually the valid one is the TRANSACTION_onNotificationError (0xa) so if your NotificationError is not 0xa but 0xb for example, please change the bold one to 0xb
Save
2.3 editing smali/com/android/internal/statusbar/IStatusBarService.smali
Insert this function code to the file. Here are the steps:
Insert these function code to the file:
Code:
.method public abstract onNotificationClear(Ljava/lang/String;Ljava/lang/String;I)V
.annotation system Ldalvik/annotation/Throws;
value = {
Landroid/os/RemoteException;
}
.end annotation
.end method
Save
There you have it AFAIK, the files that you need to take care more than others are:
1. smali/com/android/systemui/statusbar/StatusBarService.smali
2. res/values/public.xml
The rest can be applied from the attachment below directly. Ok that's all, after you are done, compile both SystemUI.apk and Framework.jar.
How to Compile the right way?
1. SystemUI.apk ->
Compile with APK Multi Tool, press y and y twice with all the requested input,
delete modified file from keep folder, and after that continue compiling.
Copy from original APK the META-INF and AndroidManifest.xml to the unsignedSystemUI.apk
rename unsignedSystemUI.apk to signedSystemUI.apk
select Zipalign from APK Multi Tool to optimize apk.
Rename to SystemUI.apk (move the original one just in case)
2. framework.jar ->
Smali inside Baksmali Manager
Replace classes.dex inside framework.jar with the generated one.
and apply on your phone.
Hope this helps you (programmer ofc, not end user ) to implement on your device.
G'day!
Mate, thank you so much for this - I have been trying to figure it out for our ROM for weeks LOL I'm going to give it a try this evening and I'll let you know if I get it! Thanks again
Dunc001 said:
Mate, thank you so much for this - I have been trying to figure it out for our ROM for weeks LOL I'm going to give it a try this evening and I'll let you know if I get it! Thanks again
Click to expand...
Click to collapse
Ok let me know mate
ill try it on my SGY
Looks fun! great post
tommytomatoe said:
Looks fun! great post
Click to expand...
Click to collapse
Updated step, to give you some warning about StatusBarService$7 naming convention
definitely gonna give this a try!!
great akaka.try it soon.
did u know how to port ICS layout to stock rom? can u write a tut?
this will be great!!
nvt992 said:
great akaka.try it soon.
did u know how to port have ICS layout to stock rom? can u write a tut?
this will be great!!
Click to expand...
Click to collapse
What layout? Do you mean ICS launcher layout or..?
no.see my attach
nvt992 said:
no.see my attach
Click to expand...
Click to collapse
Well do you have the original link? First, i know nothing about that, so i should learn first. and secondly, it's more about theme editing, so i think it's more about editing XML inside SystemUI.apk rather than coding a .smali like above. Thirdly, the shortcut for setting in ICS IMHO is not as efficient as Power Widget Status Bar.
hansip87 said:
Well do you have the original link? First, i know nothing about that, so i should learn first. and secondly, it's more about theme editing, so i think it's more about editing XML inside SystemUI.apk rather than coding a .smali like above. Thirdly, the shortcut for setting in ICS IMHO is not as efficient as Power Widget Status Bar.
Click to expand...
Click to collapse
this is for cm7
patch http://forum.xda-developers.com/showthread.php?t=1324924
or original theme
http://forum.xda-developers.com/showthread.php?t=1334922
hope u can do it
nvt992 said:
this is for cm7
patch http://forum.xda-developers.com/showthread.php?t=1324924
or original theme
http://forum.xda-developers.com/showthread.php?t=1334922
hope u can do it
Click to expand...
Click to collapse
Well ok thanks but don't count on me ok because i am currently researching for 2G/3G toggle button for PowerWidget, this one is not that high on my list, but you never know..
ok thank you
where can i get Baksmali manager?
lasmaty07 said:
where can i get Baksmali manager?
Click to expand...
Click to collapse
Check back later mate, just uploading right now because of on the original link, it's dead. I'll upload it for us all to share
EDIT: Uploaded. Click Baksmali Manager link on the first page to download. APK Multi Tool can be found on the same parent thread (Hacking General)
Done, but get this error when recompiling .apk
Code:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\me\Desktop\folder>apktool.bat b -f -d out
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
at brut.androlib.Androlib.buildSources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Tried to do it manually like this and using apk multitool, but same error in log.
even tried to compile just after decompiling but that's no help.. same error
Any help?
jaggyjags said:
Done, but get this error when recompiling .apk
Code:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\me\Desktop\folder>apktool.bat b -f -d out
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
at brut.androlib.Androlib.buildSources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Tried to do it manually like this and using apk multitool, but same error in log.
even tried to compile just after decompiling but that's no help.. same error
Any help?
Click to expand...
Click to collapse
APKTools is a bit outdated and i'm afraid some incompatibilites with Google SDK might be the source of the problem. search APK Multi Tools and use that one instead with SDK release 16 and up.
Hello, and thanks for the how-to!
Sadly I couldn't get it to work on my phone (Motorola Atrix 2). Some of the smali files were pretty different... I tried my best but there were definitely moments when I wasn't sure if I was doing the correct thing... SystemUI won't compile.
Hi, all. Seems the statusbarservice.smali is very different from each other. So to help you all, this is the java code that should give you a better understanding. Please read here https://github.com/nadlabak/android...m/android/server/status/StatusBarService.java
Sent from my ST18i using XDA App
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is a mod that will add three options to the reboot menu of MIUI 4. It is based on the 4-way reboot mod for MIUI 2.x by roenano with my modifications. In summary, this is what you'll get after following the how-to:
- a deodexed MIUI 4 ROM
- basic knowledge of how to use smali/baksmali tools
- basic knowledge of how smali code works is a plus
- a good text editor e.g. Notepad++ or Sublime Text 2
- some "ROM modder" intuition and ability to adapt when things do not go exactly like what the how-to says
We're going to add and modify some smali files in android.policy.jar to redirect the original "Reboot" menu to a custom class that will display the reboot options and perform the action according to what the user has selected.
We'll have to extract the smali from android.policy.jar. I'm going to assume that you already know how to use smali/baksmali. The only suggestion is you should specify the output directory when using baksmali to prevent some confusion -- especially when you're doing many things in the same working directory. The command I normally use when decompiling classes.dex extracted from android.policy.jar is as follows:
Code:
baksmali -o android.policy classes.dex
All smali files will be put in android.policy directory. After you finished editing you can issue the following command to recompile it back to classes.dex:
Code:
smali -o classes.dex android.policy
Let's assume we're working in android.policy directory from now on.
We'll start with the easy part by adding some smali files (custom classes) to the package. You can download the files here. The zip contains essentially three files as follows:
Code:
[FONT="Courier New"]MiuiGlobalActions$9.smali[/FONT]
[FONT="Courier New"]MiuiGlobalActions$9$1.smali[/FONT]
[FONT="Courier New"]MiuiGlobalActions$9$2.smali[/FONT]
First, take a look in com/android/internal/policy/impl/ directory and see if there is already a file named MiuiGlobalActions$9.smali or not. If there is no such file then you're lucky, just copy over the three files into the mentioned directory.
But if the file already exists then we'll have to change our file names so it won't override what's already there. We can do it by renaming the three above files and change $9 to the next available number e.g. $10 (actually any unused number will work, just make sure you use the same number in all three files) Then open each renamed file and replace every occurrences of MiuiGlobalActions$9 with MiuiGlobalActions$10 (or the number you used). A simple "search/replace all" in the text editor should do the trick. After that, copy over the three files into the mentioned directory.
Next we'll have to edit two smali files in order to get it working.
com/android/internal/policy/impl/MiuiGlobalActions$SinglePressAction.smali
Add the highlighted code just after .end annotation and before # instance fields
Code:
.end annotation
[COLOR="Red"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
# instance fields
.field private mIconResId:I
Then add another highlighted code after # direct methods and before .method protected constructor <init>(II)V
Code:
# direct methods
[COLOR="Red"].method static constructor <clinit>()V
.registers 3
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Recovery"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Bootloader"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/MiuiGlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method[/COLOR]
.method protected constructor <init>(II)V
.registers 3
.parameter "iconResId"
Then save the file. The above modifications will populate the options array used by the three files we copied earlier. Next we'll redirect the original "Reboot" menu to our custom class, this can be done by editing:
com/android/internal/policy/impl/MiuiGlobalActions.smali
In order to know which line of code to change, we'll have to find which smali is being called when the user select the original "Reboot" menu.
If you're using Linux or Cygwin, open the terminal, go to com/android/internal/policy/impl/ directory and use the following command:
Code:
grep -l reboot *.smali
If you're using Command Prompt, open it, go to the same directory and use the following command instead:
Code:
findstr /M reboot *.smali
The output should be similar to the following. There will be a file named MiuiGlobalActions$#.smali where # is some number different from the files we added earlier. In my case this number is 3.
Code:
[B]MiuiGlobalActions$3.smali[/B]
MiuiGlobalActions$9$1.smali
MiuiGlobalActions$9$2.smali
MiuiGlobalActions$9.smali
MiuiGlobalActions$SinglePressAction.smali
To make sure it's the right file that handle the reboot command, open MiuiGlobalActions$3.smali and you'll see a line similar to this:
Code:
invoke-static {v0, v1, v2}, Lcom/android/internal/app/[B]ShutdownThread;->reboot[/B](Landroid/content/Context;Ljava/lang/String;Z)V
Once we know the file name, the modification is super easy. Just search and replace MiuiGlobalActions$3 with MiuiGlobalActions$9 in com/android/internal/policy/impl/MiuiGlobalActions.smali. Remember to change $9 to the number you used if you changed the three files' names. Note that there should be only two instances to be replaced. After you finish, save the file.
That's it. Now you'll have to recompile the smali code to classes.dex, put it back into android.policy.jar, push the jar onto the phone and reboot
Reserved just in case
Thanks you, kong :-D
kong
Thank any way/
Is it possible make zip file to install this menu through recovery? Be cause I do not have idea how to work with smali files, I think I am not alone how to operate with it/ =)
toqpuk said:
kong
Thank any way/
Is it possible make zip file to install this menu through recovery? Be cause I do not have idea how to work with smali files, I think I am not alone how to operate with it/ =)
Click to expand...
Click to collapse
It's possible to provide a flashable zip for a specific version of MIUI for a specific device, but not a generic one that can be used by all devices since android.policy.jar keeps changing in each MIUI releases.
That's why I wrote a "guide" so anyone who has those "prerequisites" can apply it to the appropriate android.policy.jar
I tried this on my miui v4 rom port, but it dint work, when ever i long press my power button miui reboots. here's my edited android.policy.jar.
http://www.mediafire.com/?lw7y57yk25drdy4
If someone would like to add Quick Reboot to the menu:
Create a new file, for example: GlobalActions$12.smali:
Code:
.class Lcom/android/internal/policy/impl/GlobalActions$12;
.super Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.source "GlobalActions.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/internal/policy/impl/GlobalActions;->createDialog()Landroid/app/AlertDialog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/GlobalActions;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
.registers 4
.parameter
.parameter "x0"
.parameter "x1"
.prologue
.line 267
iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$12;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
invoke-direct {p0, p2, p3}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>(II)V
return-void
.end method
# virtual methods
.method public onPress()V
.locals 6
.prologue
.line 142
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v3
.line 143
.local v3, localRuntime:Ljava/lang/Runtime;
const/4 v4, 0x4
new-array v0, v4, [Ljava/lang/String;
.line 144
.local v0, arrayOfString2:[Ljava/lang/String;
const/4 v4, 0x0
const-string v5, "pkill"
aput-object v5, v0, v4
.line 145
const/4 v4, 0x1
const-string v5, "-TERM"
aput-object v5, v0, v4
.line 146
const/4 v4, 0x2
const-string v5, "-f"
aput-object v5, v0, v4
.line 147
const/4 v4, 0x3
const-string v5, "system_server"
aput-object v5, v0, v4
.line 151
:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v2
.line 158
:goto_0
return-void
.line 153
:catch_0
move-exception v1
.line 156
.local v1, e:Ljava/io/IOException;
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_0
.end method
.method public showBeforeProvisioning()Z
.locals 1
.prologue
.line 162
const/4 v0, 0x1
return v0
.end method
.method public showDuringKeyguard()Z
.locals 1
.prologue
.line 167
const/4 v0, 0x1
return v0
.end method
called like this:
Code:
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$12;
const v3, 0x1080410
const v4, 0x1040523
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$12;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
It requires a new busybox installation to succeed
siulmagic said:
I tried this on my miui v4 rom port, but it dint work, when ever i long press my power button miui reboots. here's my edited android.policy.jar.
http://www.mediafire.com/?lw7y57yk25drdy4
Click to expand...
Click to collapse
I believe you forgot to modify this line in MiuiGlobalActions.smali
Code:
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/[B]MiuiGlobalActions$3[/B];-><init>(Lcom/android/internal/policy/impl/MiuiGlobalActions;II)V
kong said:
I believe you forgot to modify this line in MiuiGlobalActions.smali
Code:
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/[B]MiuiGlobalActions$3[/B];-><init>(Lcom/android/internal/policy/impl/MiuiGlobalActions;II)V
Click to expand...
Click to collapse
Thanks for the tutorial.... It's work great.... lucky me there is no file use $9.... so I just copy the file and edit some smali.... thanks sir
Sent from my GT-S5670 using Tapatalk 2
AldoSebastian said:
Thanks for the tutorial.... It's work great.... lucky me there is no file use $9.... so I just copy the file and edit some smali.... thanks sir
Click to expand...
Click to collapse
Thanks for confirming that it works
can you guys check if this works on miui 2.6.22, i just tried it and the 3 way reboot menu does not come up, it just reboots the device. i dont think this is compatible anymore.
---------- Post added at 02:01 PM ---------- Previous post was at 01:58 PM ----------
disregard i edited the wrong globalpressaction smali
siulmagic said:
can you guys check if this works on miui 2.6.22, i just tried it and the 3 way reboot menu does not come up, it just reboots the device. i dont think this is compatible anymore.
---------- Post added at 02:01 PM ---------- Previous post was at 01:58 PM ----------
disregard i edited the wrong globalpressaction smali
Click to expand...
Click to collapse
I can confirm that 3way reboot mod works on my Sensation on MIUI ICS 2.6.22. It has been made from scratches using kong's how-to.
thanks for this guide.
I wanted to port this to my device but the download with the three smali files is dead (not reachable for me).
Can someone re-upload the files?
Edit: Ok, I've found an older build with those files included. Works fine. Expect the missing hot boot option
For me, the boot to RECOVERY won't work.. Can you help me to do this?
Can someone reupload files as aosp.in is off
Alberto96 said:
Can someone reupload files as aosp.in is off
Click to expand...
Click to collapse
I've found another release which included these files
zip file attached
Anyone an idea how to include Hot reboot?
I was going to ask the same thing: is it possible to include a Hot Boot option back? I compared an older android.policy.jar which included the Hot Boot option, so I could add it back by copying the same lines but I haven't tried because I saw you recently switched to 3-way instead of 4-way. I thought that newer MIUI versions just don't allow hot reboot anymore, but if it's possibile to add it back, I would love to try.
thunderteaser said:
I was going to ask the same thing: is it possible to include a Hot Boot option back? I compared an older android.policy.jar which included the Hot Boot option, so I could add it back by copying the same lines but I haven't tried because I saw you recently switched to 3-way instead of 4-way. I thought that newer MIUI versions just don't allow hot reboot anymore, but if it's possibile to add it back, I would love to try.
Click to expand...
Click to collapse
I saw some ROMs using the 4way-reboot. So I think it's still possible. But I don't know how to do it
Mod doesn't work for me, phone gets unstable and keeps rebooting (that actually happens everytime i modify a jar file, maybe doing something wrong when recompiling?)
I got the 3 way reboot menu option but it doesn't work (meaning it just reboots the phone normally)
Xperia st17i
Qns: Do u still keep the GlobalActions$3.smali?
This is a guide on how to enable unlimited apps on the traybar. This is for devs or users who want to do the mod themselves and include in their custom or own rom.
Tools:
1. apktools/smali/baksmali
2. 7zip
3. notepad++
4. knowledge of using the above tools and decompiling and recompiling.
Guide:
Part I: Editing services.jar
1. Decompile services.jar and edit MultiWindowManagerService.smali located in com/android/server/am folder. Search for the following code and insert the one with ++ highlighted in red (dont include the ++ just the goto :cond_10). Note that cond_10 may be different for your version so look for "const/4 v0, 0x1" below, above it is your "cond_xx" and edit the "goto :cond_10" like "goto :cond_xx".
Code:
.method public isSupportApp(Ljava/lang/String;)Z
.registers 3
.parameter "packageName"
.prologue
.line 410
[COLOR="Red"]++goto :cond_10[/COLOR]
iget-object v0, p0, Lcom/android/server/am/MultiWindowManagerService;->mSupportAppList:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_10
const-string v0, "android"
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
.line 411
[COLOR="Red"]:cond_10[/COLOR]
const/4 v0, 0x1
.line 414
:goto_11
return v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
2. Recompile.
Part II: Editing SystemUI.apk
1. Decompile SystemUI.apk and edit MiniModeAppsPanel.smali located in com/android/systemui/statusbar folder. Search for "CATEGORY_MULTIWINDOW_LAUNCHER". Just delete the line with "--" highlighted in blue and add the line with "++" highlighted in red. Make sure that the v7 in "const-string v7" is the same as the v7 in "sget-object v7". It could be v11 or v22 or whatever so make sure to edit the "const-string vx" with the correct vx value in "const-string vx".
Code:
[COLOR="Red"]++const-string v7, "android.intent.category.LAUNCHER"[/COLOR]
[COLOR="Blue"]--sget-object v7, Lcom/android/systemui/multiwindow/MultiWindowReflector$Intent;->CATEGORY_MULTIWINDOW_LAUNCHER:Ljava/lang/String;[/COLOR]
2. Recompile.
Part III: Push the edited services.jar and SystemUI.apk to your tablet and reboot.
Awesome dude!! Thanks!
worked perfectly for the new 8013!!
http://d-h.st/YRJ
selective disable?
In general this is really awesome and I really appreciate the options this gives me, but there are some apps where I wish this was either disabled or the overlay button was in another spot. Being right over the enter key on my keyboard or near a button in a game tends to cause some grief for me. Any suggestions?
Edit: Found the answer. Lol. http://forum.xda-developers.com/showthread.php?t=2136313
Fix for "Show disabled apps" bug in Galaxy Note 3 (KitKat) TouchWiz Launcher
Hi,
This mod is for fixing the TW Launcher bug present in Galaxy Note 3 (N9005) 4.4.2 Kitkat. (Present Only in Latest Kitkat firmware like UGNG1,UGNH1,UGNI4)
Bug description: Suppose you have disabled some apps, but you can't see or enable them from App drawer (TW Launcher), because Show disabled apps options will be grayed out as soon as you disable any App from Settings or from (TW Launcher) App drawer. And Show disabled apps will be available if you haven't disabled any apps. In short, Show disabled apps is behaving in opposite way.
My Note 3 details:
Variant: SM-N9005,
ROM: Stock odexed ROM-rooted,
Firmware: N9005XXUGNG1,
Region: BTU.
This guide will explain in detail on How to fix it. and I hope it might be useful for somebody.
Their might be other ways to implement it. but I am writing the steps which I have followed.
You Need:
1. Windows PC.
2. JRE installed.
3. Download the required tools from here. You can get the latest aapt.exe here, apktool.jar here, baksmali.jar and smali.jar files here
So here is the step by step guide on how to do it.
1. Copy framework folder (/system/framework) from your phone to C:\apktool\system\framework folder of your PC, and SecLauncher4.apk, SecLauncher4.odex files from your phone (/system/priv-app) to C:\apktool folder of your PC.
2. baksmali the SecLauncher4.odex present in C:\apktool folder using the command
Code:
[/B][B][COLOR="Red"]java -jar baksmali.jar -d C:\apktool\system\framework -x SecLauncher4.odex[/COLOR][/B]
Click to expand...
Click to collapse
-d path of directory where framework files are placed.-x target .odex file (in our case it's SecLauncher4.odex)3. Once command is completed, you will see a folder named out in C:\apktool.
4. Navigate to C:\apktool\out\com\android\launcher2, and search for the file MenuAppModel.smali.
5. Open the file and search for .method isDisableAppListEmpty.
Code:
[/B][B]
.method isDisableAppListEmpty()Z
.locals 1
.prologue
.line 711
iget-object v0, p0, Lcom/android/launcher2/MenuAppModel;->mAppDiabledItems:Ljava/util/Map;
if-nez v0, :cond_0
.line 712
invoke-virtual {p0}, Lcom/android/launcher2/MenuAppModel;->getDisabledAppList()Ljava/util/List;
.line 714
:cond_0
iget-object v0, p0, Lcom/android/launcher2/MenuAppModel;->mAppDiabledItems:Ljava/util/Map;
invoke-interface {v0}, Ljava/util/Map;->isEmpty()Z
move-result v0
if-eqz v0, :cond_1
.line 715
[COLOR="Red"] const/4 v0, [COLOR="Blue"]0x1[/COLOR][/COLOR]
.line 717
:goto_0
return v0
:cond_1
[COLOR="red"] const/4 v0, [COLOR="blue"]0x0[/COLOR][/COLOR]
goto :goto_0
.end method
[/B]
Click to expand...
Click to collapse
6. Change the red line to, as shown below for fixing the Show Disabled apps bug in Launcher.
Code:
[/B][B]
.line 714
:cond_0
iget-object v0, p0, Lcom/android/launcher2/MenuAppModel;->mAppDiabledItems:Ljava/util/Map;
invoke-interface {v0}, Ljava/util/Map;->isEmpty()Z
move-result v0
if-eqz v0, :cond_1
.line 715
[COLOR="Red"] const/4 v0, [COLOR="Blue"]0x0[/COLOR][/COLOR]
.line 717
:goto_0
return v0
:cond_1
[COLOR="red"] const/4 v0, [COLOR="blue"]0x1[/COLOR][/COLOR]
goto :goto_0
.end method
[/B]
Click to expand...
Click to collapse
7. Once changes are done, smali the out folder present in C:\apktool using the command
Code:
[/B][B][COLOR="Red"]java -jar smali.jar -o classes.dex out[/COLOR][/B]
Click to expand...
Click to collapse
-o the name of newly created .dex file.out is the folder name.8. Once you see the classes.dex file in the folder, then push this .dex file into SecLauncher4.apk file using the command
Code:
[/B][B][COLOR="Red"]aapt add SecLauncher4.apk classes.dex[/COLOR][/B]
Click to expand...
Click to collapse
9. After the command in Step 8, Size of apk file should increase, Now Zipalign the apk using the command.
Code:
[/B][B][COLOR="Red"]zipalign -fv 4 SecLauncher4.apk SecLauncher4_new.apk[/COLOR][/B]
Click to expand...
Click to collapse
10. Now you will see a new apk file named "SecLauncher4_new.apk", Copy the SecLauncher4_new.apk to your phone and rename it to SecLauncher4.apk, This is deodexed .apk file, and you can directly push this apk into your phone path /system/priv-app using RootExplorer and set the permission to rw-r--r--, and delete the SecLauncher4.odex file from the priv-app folder.
Restart the phone, and you should be able to disable and enable the unwanted apps from Touch Wiz Launcher.
11. If you want to create the SecLauncher4.odex file from the SecLauncher4.apk file then their are few more steps, which involves Terminal Emulator, but this apk will work fine. Please delete or remove the SecLauncher4.odex file from the system/priv-app folder and keep only SecLauncher4.apk, because this apk is deodexed and working fine for me.
Here are the steps to Create .odex from .apk file:
a. Copy the modified .apk file to Phone Internal Storage, for example: /storage/emulated/0/app/SecLauncher4.apk and download dexopt-wrapper from here.b. Unzip dexopt-wrapper.zip and Copy dexopt-wrapper file to system/bin folder of your Phone using Root Explorer and set the permission to 0755 or rwxr-xr-x.c. After Setting the correct permission, Download and install Terminal Emulator, and open it.d. Type the following commands as shown below to generate .odex from .apk file
Code:
[/B][B]
[COLOR="Red"]su[/COLOR]
[/B]
Click to expand...
Click to collapse
su - This is to grand super user permission.
Code:
[/B][B]
[COLOR="red"]dexopt-wrapper /storage/0/emulated/app/SecLauncher4.apk /storage/0/emulated/app/SecLauncher4.odex[/COLOR]
[/B]
Click to expand...
Click to collapse
dexopt-wrapper path-of-apk path-of-newly-created-odex - Once this command is executed, you should see a success message on Terminal Emulator.e. Now you will find a modified .odex file in /storage/0/emulated/app/ . Replace the original .odex with the modified file. Take a back up of Original .odex file
For enabling Ripple ink effect with fingers or without S-pen, check out here...
For enabling Particle Effect or Lens Flare Effect on LockScreen please check out here
Hit THANKS button, If I helped You.
Thanks for your tip/mod
Tested and working
Rajada said:
Thanks for your tip/mod
Tested and working
Click to expand...
Click to collapse
Thanks.
What's your firmware version?
amk19 said:
Thanks.
What's your firmware version?
Click to expand...
Click to collapse
N9005XXUFNF4. (Changelist 1 955 971)
i am using a modified seclauncher4 but was interested in doing the disabled apps modification. Although i am using the same rom as in you, i have deleted the seclaucher4.odex file when i replaced the original seclakucher4 with modified seclauncher4
Can you please advise, how do i do the modification now . do i have to generate the odex file first before i do anything
swagatsourav said:
i am using a modified seclauncher4 but was interested in doing the disabled apps modification. Although i am using the same rom as in you, i have deleted the seclaucher4.odex file when i replaced the original seclakucher4 with modified seclauncher4
Can you please advise, how do i do the modification now . do i have to generate the odex file first before i do anything
Click to expand...
Click to collapse
Hi,
You can modify it even without creating .odex file.
Just decompile it and then you'll see a folder named smali inside the decompiled apk folder, make the required changes and recompile it again.