I'm thinking it should be possible to modify the Amazon VOD app to get it to continue to work on rooted Fires. Right now you have to unroot or rename the "su" binary to something else. I poked around the apk and found that the VOD app is using a DRM solution from Widevine. A strings dump on the dex file shows this interesting string
Code:
*Widevine detected a tampered/rooted device
and a dexdump shows several references to various Widevine APIs.
Considering renaming su breaks their root check, the code may be doing something as simple as looking for su in the path. If this is the case we should be able to find out were in the dex (or maybe the native *.so) that this done and overwrite the string within the binary.
I'm going to keep poking at it. But I wanted to post this information in case anyone else was working on something similar or had any good ideas/suggestions.
You know, OTA Root Keeper is literally one click (un)root. Not hard to use it at all.
Printerscape said:
You know, OTA Root Keeper is literally one click (un)root. Not hard to use it at all.
Click to expand...
Click to collapse
I did not know that. I still think it is worth investigating.
Printerscape said:
You know, OTA Root Keeper is literally one click (un)root. Not hard to use it at all.
Click to expand...
Click to collapse
Just installed it and doesn't seem to work for Amazon VOD?
antagonizt said:
Just installed it and doesn't seem to work for Amazon VOD?
Click to expand...
Click to collapse
After running unroot, you need to force close the Amazon Video app or reboot for streaming to work.
Sent using Tapatalk
NotJustAPhone said:
After running unroot, you need to force close the Amazon Video app or reboot for streaming to work.
Sent using Tapatalk
Click to expand...
Click to collapse
Thanks, it's working now.
that is why it would be nice to get the VOD app to not look. simply make easier to just keep root in place. though it is not really that big of a deal.
any luck yet?
Here is a possible start. Not versed enough in decompiling android apps to attempt myself yet.
This was done to the google video apk to remove the WideVine checks.
Cant link When i have 8 posts ill update
How It Was Done
To accomplish the bypass I changed the following files;
/smali/com/widevine/drm/internal/y.smali(This is to bypass the root check)
Original;
Code: [Select]
const-string v5, "su"Changed;
Code: [Select]
const-string v5, "wu"
/smali/com/widevine/drm/internal/m.smali(This is to disable the tamper check)
Original;
Code: [Select]
if-nez v0, :cond_1
sget-object v0, Lcom/widevine/drmapi/android/WVStatus;->TamperDetected:Lcom/widevine/drmapi/android/WVStatus;
const-string v1, "Apk verification failed."Changed;
Code: [Select]
if-eqz v0, :cond_1
sget-object v0, Lcom/widevine/drmapi/android/WVStatus;->TamperDetected:Lcom/widevine/drmapi/android/WVStatus;
const-string v1, "Apk verification failed."
/smali/com/widevine/drmapi/android/WVPlayback.smali (This is to disable the tamper checks)
Original Play check;
Code: [Select]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-nez v0, :cond_1Changed;
Code: [Select]
*if-eqz v0, :cond_0**** Line deleted
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-eqz v0, :cond_1
Original queryAssetStatus check;
Code: [Select]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-nez v0, :cond_1Changed;
Code: [Select]
*if-eqz v0, :cond_0***** Line deleted
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-eqz v0, :cond_1
Original registerAsset check;
Code: [Select]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-nez v0, :cond_1
Changed;
Code: [Select]
*if-eqz v0, :cond_0***** Line Deleted
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-eqz v0, :cond_1
Original requestLicense check;
Code: [Select]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-nez v0, :cond_1Changed;
Code: [Select]
*if-eqz v0, :cond_0***** Line Deleted
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-eqz v0, :cond_1
Original setCredentials check;
Code: [Select]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-nez v0, :cond_1Changes;
Code: [Select]
*if-eqz v0, :cond_0***** Line Deleted
iget-object v0, p0, Lcom/widevine/drmapi/android/WVPlayback;->g:Lcom/widevine/drm/internal/ab;
invoke-virtual {v0}, Lcom/widevine/drm/internal/ab;->c()Z
move-result v0
if-eqz v0, :cond_1
Click to expand...
Click to collapse
So this doesn't stop it from checking for root, but ChainFire's SuperSU will let you temporarily hide your root from it without as much effort as some of the other apps.
Tried this on my Droid Charge yesterday and it worked great.
Also tried with "HideMyRoot" but it was unsuccessful.
I was working on swipe to remove notifications mod for the past three months and now finally have it working. This tutorial is for all those who have a problem compiling it.
Special thanks to hansip87 and spacecaker for helping me out. The original thread by hansip is here.
This is for ddkq8 but should work with any firmware.
For compiling the right way check the second post. I have attached all the files that have been edited in this guide in the second post. You can use them to compare.
hansip87 said:
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.
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
Click to expand...
Click to collapse
Now lets start the mod.
1. Editing SystemUI.apk
1.1 Editing res/anim
We are registering anim object here, so swipe animation can be done.
Create an anim folder (if it does 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="-50.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="50.0%p"
xmlns:android="http://schemas.android.com/apk/res/android" />
Save both files.
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
Now some problems arise if you do not assign the correct id for a anim file. So to prevent it we make the use of apktool.
Recompile your apk after step 1.2
Decompile again the resulting apk.
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 :
Inside /res/values/public.xml, you'll find something like this (at the end of the file):
Code:
<resources>
.
.
.
<public type="anim" name="slide_out_left_basic" id="0x7f0c0000" />
<public type="anim" name="slide_out_right_basic" id="0x7f0c0001" />
</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, 0x7f0a
and
Code:
.line 51
const v1, 0x7f0a0001
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.
Put it in the folder smali/com/android/systemui/statusbar/
*MOST IMPORTANT AND DIFFICULT PART*
1.6 Edit smali/com/android/systemui/statusbar/StatusBarService.smali
This is the file that generate NotificationView. 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 {v1, v3, p2, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
Insert the bold code below the line
"invoke-virtual {v1, v3, p2, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v9"
Code:
check-cast v9, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v9, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v4
move-object/from16 v1, p0
move-object/from16 v7, p1
invoke-direct {v0, v1, v7}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v9
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/Runnable;)V
.line 735
.line 581
:cond_1
Also insert the following bold code :
Code:
const v1, 0x7f090024
[B]invoke-virtual {v9, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;[/B]
move-result-object v1
move-object v0, v1
check-cast v0, Landroid/view/ViewGroup;
So it should look something like this :
Code:
invoke-virtual {v1, v3, p2, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v9
[I][B]check-cast v9, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v9, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v4
move-object/from16 v1, p0
move-object/from16 v7, p1
invoke-direct {v0, v1, v7}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v9
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/Runnable;)V
.line 735
.line 581
:cond_1[/B][/I]
const v1, 0x7f090024
[I][B] invoke-virtual {v9, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;[/B][/I]
move-result-object v1
move-object v0, v1
check-cast v0, Landroid/view/ViewGroup;
Bold is the inserted code.
Now we are done editing the systemui files. Lets move on to framework.jar
2. Editing framework.jar
2.1 editing smali/com/android/internal/statusbar/IStatusBarService$Stub.smali
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 = 0xe[/B]
.field static final TRANSACTION_onNotificationClick:I = 0x9
.field static final TRANSACTION_onNotificationError:I = 0xa
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 it 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_15a[/B]
Find and replace this code (it is at the end of the file):
Code:
.line 183
const/4 v0, 0x1
goto/16 :goto_7
: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
Change it to :
Code:
.line 183
const/4 v0, 0x1
goto/16 :goto_7
[B]
.line 187
.end local v1 #_arg0:Ljava/lang/String;
.end local v2 #_arg1:Ljava/lang/String;
.end local v3 #_arg2:I
.end local v4 #_arg3:I
.end local v5 #_arg4:I
.end local v6 #_arg5:Ljava/lang/String;
:sswitch_132
const-string v0, "com.android.internal.statusbar.IStatusBarService"
invoke-virtual {p2, v0}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V
.line 188
invoke-virtual {p0}, Lcom/android/internal/statusbar/IStatusBarService$Stub;->onClearAllNotifications()V
.line 189
invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V
.line 190
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_140
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_15a
.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_9b
0x9 -> :sswitch_a9
0xa -> :sswitch_e3
0xb -> :sswitch_f1
0xc -> :sswitch_10b
0xd -> :sswitch_132
[B]0xe -> :sswitch_140[/B]
0x5f4e5446 -> :sswitch_8
.end sparse-switch
.end method
2.2 Editing smali/com/android/internal/statusbar/IStatusBarService$Stub$Proxy.smali
Here are the steps:
Insert these function code to the end of 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
Find this code in the file :
Code:
[B]const/16 v3, 0xc
const/4 v4, 0x0[/B]
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,
Save.
2.3 editing smali/com/android/internal/statusbar/IStatusBarService.smali
Insert this 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
And with this we are done editing the files.
You now have modded the rom that you like to have the swipe to remove notifications.
Cheers..
How to Compile the right way?
1.SystemUI.apk ->
Compile with APK Multi Tool, press y and y twice when asked.
Delete modified files from keep folder, and after that continue compiling.
Copy from original APK the 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 to implement it on your device.
Second ... Thanks
Sent from my GT-S5830 using Tapatalk
wheres the dl link >? lolol
CoolCatGetHome said:
wheres the dl link >? lolol
Click to expand...
Click to collapse
Its a tutorial. There are already some flashable zips out there.
awesome guide !
Bravoo! This is awesome!
Sent from my WAREZ impulses.
Great guide bro
dam tahts a legit guide
yeowwwai said:
Bravoo! This is awesome!
Sent from my WAREZ impulses.
Click to expand...
Click to collapse
abhibnl said:
Great guide bro
Click to expand...
Click to collapse
SiL3nTKiLL said:
dam tahts a legit guide
Click to expand...
Click to collapse
Thanks..
Finally U did it!! Congrats Shaan
devilsking said:
Finally U did it!! Congrats Shaan
Click to expand...
Click to collapse
Yea..
Finally
From the Galaxy to your phone
So who's gonna be the genius to do one for lewa ?
djsky2011 said:
So who's gonna be the genius to do one for lewa ?
Click to expand...
Click to collapse
This guide is specifically for stock roms ...
There will be good amount of smali changes needed for making it for lewa if i am not wrong
Sent from Galaxy Ace which just landed on "MOON"
shaaan said:
I was working on swipe to remove notifications mod for the past three months and now finally have it working. This tutorial is for all those who have a problem compiling it.
Special thanks to hansip87 and spacecaker for helping me out. The original thread by hansip is here.
This is for ddkq8 but should work with any firmware.
For compiling the right way check the second post. I have attached all the files that have been edited in this guide in the second post. You can use them to compare.
Now lets start the mod.
1. Editing SystemUI.apk
1.1 Editing res/anim
We are registering anim object here, so swipe animation can be done.
Create an anim folder (if it does 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="-50.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="50.0%p"
xmlns:android="http://schemas.android.com/apk/res/android" />
Save both files.
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
Now some problems arise if you do not assign the correct id for a anim file. So to prevent it we make the use of apktool.
Recompile your apk after step 1.2
Decompile again the resulting apk.
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 :
Inside /res/values/public.xml, you'll find something like this (at the end of the file):
Code:
<resources>
.
.
.
<public type="anim" name="slide_out_left_basic" id="0x7f0c0000" />
<public type="anim" name="slide_out_right_basic" id="0x7f0c0001" />
</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, 0x7f0a
and
Code:
.line 51
const v1, 0x7f0a0001
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.
Put it in the folder smali/com/android/systemui/statusbar/
*MOST IMPORTANT AND DIFFICULT PART*
1.6 Edit smali/com/android/systemui/statusbar/StatusBarService.smali
This is the file that generate NotificationView. 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 {v1, v3, p2, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
Insert the bold code below the line
"invoke-virtual {v1, v3, p2, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v9"
Code:
check-cast v9, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v9, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v4
move-object/from16 v1, p0
move-object/from16 v7, p1
invoke-direct {v0, v1, v7}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v9
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/Runnable;)V
.line 735
.line 581
:cond_1
Also insert the following bold code :
Code:
const v1, 0x7f090024
[B]invoke-virtual {v9, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;[/B]
move-result-object v1
move-object v0, v1
check-cast v0, Landroid/view/ViewGroup;
So it should look something like this :
Code:
invoke-virtual {v1, v3, p2, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v9
[I][B]check-cast v9, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v9, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v2
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v4
move-object/from16 v1, p0
move-object/from16 v7, p1
invoke-direct {v0, v1, v7}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v9
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/Runnable;)V
.line 735
.line 581
:cond_1[/B][/I]
const v1, 0x7f090024
[I][B] invoke-virtual {v9, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;[/B][/I]
move-result-object v1
move-object v0, v1
check-cast v0, Landroid/view/ViewGroup;
Bold is the inserted code.
Now we are done editing the systemui files. Lets move on to framework.jar
2. Editing framework.jar
2.1 editing smali/com/android/internal/statusbar/IStatusBarService$Stub.smali
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 = 0xe[/B]
.field static final TRANSACTION_onNotificationClick:I = 0x9
.field static final TRANSACTION_onNotificationError:I = 0xa
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 it 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_15a[/B]
Find and replace this code (it is at the end of the file):
Code:
.line 183
const/4 v0, 0x1
goto/16 :goto_7
: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
Change it to :
Code:
.line 183
const/4 v0, 0x1
goto/16 :goto_7
[B]
.line 187
.end local v1 #_arg0:Ljava/lang/String;
.end local v2 #_arg1:Ljava/lang/String;
.end local v3 #_arg2:I
.end local v4 #_arg3:I
.end local v5 #_arg4:I
.end local v6 #_arg5:Ljava/lang/String;
:sswitch_132
const-string v0, "com.android.internal.statusbar.IStatusBarService"
invoke-virtual {p2, v0}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V
.line 188
invoke-virtual {p0}, Lcom/android/internal/statusbar/IStatusBarService$Stub;->onClearAllNotifications()V
.line 189
invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V
.line 190
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_140
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_15a
.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_9b
0x9 -> :sswitch_a9
0xa -> :sswitch_e3
0xb -> :sswitch_f1
0xc -> :sswitch_10b
0xd -> :sswitch_132
[B]0xe -> :sswitch_140[/B]
0x5f4e5446 -> :sswitch_8
.end sparse-switch
.end method
2.2 Editing smali/com/android/internal/statusbar/IStatusBarService$Stub$Proxy.smali
Here are the steps:
Insert these function code to the end of 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
Find this code in the file :
Code:
[B]const/16 v3, 0xc
const/4 v4, 0x0[/B]
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,
Save.
2.3 editing smali/com/android/internal/statusbar/IStatusBarService.smali
Insert this 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
And with this we are done editing the files.
You now have modded the rom that you like to have the swipe to remove notifications.
Cheers..
Click to expand...
Click to collapse
LOL. Too long for a noob like me.
Thx btw.
I'm afraid of deving now 'coz I hard-bricked my ACE once and took it to the service. Guess what? They changed my mainboard for free.
I tried to make it 3 times but I didn't get succes.
So here is a question: Is there somebody who has a lot of time and feels like doing it for me?
I'm on KPO 2.3.3.
(I attached the files which are needed)
Congo shaaan
One could also different values for android:toXDelta="-50.0%p" as they please,if its 100%,then you need to swipe across the full screen,if 50%,half of the screen,and vice versa.
Maybe you should mention that
Prawesome said:
Congo shaaan
One could also different values for android:toXDelta="-50.0%p" as they please,if its 100%,then you need to swipe across the full screen,if 50%,half of the screen,and vice versa.
Maybe you should mention that
Click to expand...
Click to collapse
Lewa's is bugged this way, sliding full screen never happens so you can't clear notifications by swiping.
consegregate said:
Lewa's is bugged this way, sliding full screen never happens so you can't clear notifications by swiping.
Click to expand...
Click to collapse
Never used Lewa
Btw guys,i suggest a value of 40% for Delta
Prawesome said:
Never used Lewa
Btw guys,i suggest a value of 40% for Delta
Click to expand...
Click to collapse
40 for delta..
Lemme try
TeamCooper Developer
TheMyth Developer
was asked to make this statement,sorry for the English ,it's Google translator
result http://forum.xda-developers.com/goo.../mod-3-power-menu-stock-5-0-1-deodex-t2997128
for made this, need 5.0.1 (deodex) http://forum.xda-developers.com/goo...-deodex-5-0-1-app-priv-app-framework-t2994027
for decompile im use ApkTools200RC3m http://d-h.st/26rF
part 1
decompile framework-res.apk
open \framework-res\res\values\arrays.xml
looking for <item>power</item> immediately below this line inserted
Code:
<item>reboot</item>
<item>recovery</item>
then immediately open strings.xml and add at the end
Code:
<string name="reboot_recovery">Recovery</string>
same thing in the folder values-ru (or similar for your country)
Code:
<string name="reboot_recovery">Рекавери</string>
example:
values-ru (for Russia)
values-it (for Italy)
and etc....
from arhive framework add files
compile ,then assembled renamed framework222-res.apk and decompile again (that would be assigned id)
take away C:\ApkTools200RC3m\framework222-res\res\values\public.xml in the main that
(replaced the one that is there on this)
open public.xml in the editor (we'll be here to watch the assigned id)
collect ...
part 2
decompile android.policy.jar
from arhive policy add files
open GlobalActions.smali
paste below this line 20: Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;,
the following:
Code:
Lcom/android/internal/policy/impl/GlobalActions$RebootAction;,
Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;,
paste below this line 35: .field private static final GLOBAL_ACTION_KEY_POWER:Ljava/lang/String; = "power"
the following:
Code:
.field private static final GLOBAL_ACTION_KEY_REBOOT:Ljava/lang/String; = "reboot"
.field private static final GLOBAL_ACTION_KEY_RECOVERY:Ljava/lang/String; = "recovery"
and delete this
.field private static final GLOBAL_ACTION_KEY_SETTINGS:Ljava/lang/String; = "settings"
field line 1026:
const-string v0, "airplane"
and replace the code from .line 275 to .line 276
Code:
:cond_3
const-string v0, "airplane"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_4
at
Code:
:cond_3
const-string v0, "reboot"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_4
.line 276
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$RebootAction;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$RebootAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_3
now find
const-string v0, "settings"
and replace the code from .line 290 to .line 292
Code:
:cond_7
const-string v0, "settings"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_8
.line 291
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->getSettingsAction()Lcom/android/internal/policy/impl/GlobalActions$Action;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_3
at
Code:
:cond_7
const-string v0, "recovery"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_2
.line 291
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :goto_3
put the necessary files
give already moded GlobalActions.smali for that would compare if that
thanks for the tut
Thanks for the tutorial!
jermaine151 said:
Thanks for the tutorial! Where do I put the ID's in GlobalActions$RebootAction.smali?
Code:
.line 367
const v0, 0x1080766
const v1, 0x10403c7
Click to expand...
Click to collapse
GlobalActions$RebootRecovery = is responsible for the overload during recovery
GlobalActions$RebootAction = for reboot
they need to check out icon's id and name id
id in public.xml from framework-res
GlobalActions$RebootAction
.line 367
const v0, 0x1080766 this icon reboot <public type="drawable" name="ic_reboot" id="0x01080766" />
const v1, 0x10403c7 its <public type="string" name="factorytest_reboot" id="0x010403c7" />
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GlobalActions$RebootRecovery
.line 367
const v0, 0x1080767 this icon recovery <public type="drawable" name="ic_recovery" id="0x01080767" />
const v1, 0x10406c5 its <public type="string" name="reboot_recovery" id="0x010406c5" />
excellent job man!! thanks :good:
garynych said:
GlobalActions$RebootRecovery = is responsible for the overload during recovery
GlobalActions$RebootAction = for reboot
they need to check out icon's id and name id
id in public.xml from framework-res
GlobalActions$RebootAction
.line 367
const v0, 0x1080766 this icon reboot <public type="drawable" name="ic_reboot" id="0x01080766" />
const v1, 0x10403c7 its <public type="string" name="factorytest_reboot" id="0x010403c7" />
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GlobalActions$RebootRecovery
.line 367
const v0, 0x1080767 this icon recovery <public type="drawable" name="ic_recovery" id="0x01080767" />
const v1, 0x10406c5 its <public type="string" name="reboot_recovery" id="0x010406c5" />
Click to expand...
Click to collapse
Thanks Gary! I appreciate it!
garynych said:
was asked to make this statement,sorry for the English ,it's Google translator
result http://forum.xda-developers.com/goo.../mod-3-power-menu-stock-5-0-1-deodex-t2997128
for made this, need 5.0.1 (deodex) http://forum.xda-developers.com/goo...-deodex-5-0-1-app-priv-app-framework-t2994027
for decompile im use ApkTools200RC3m http://d-h.st/26rF
part 1
decompile framework-res.apk
open \framework-res\res\values\arrays.xml
looking for <item>power</item> immediately below this line inserted
Code:
<item>reboot</item>
<item>recovery</item>
then immediately open strings.xml and add at the end
Code:
<string name="reboot_recovery">Recovery</string>
same thing in the folder values-ru (or similar for your country)
Code:
<string name="reboot_recovery">Рекавери</string>
example:
values-ru (for Russia)
values-it (for Italy)
and etc....
from arhive framework add files
compile ,then assembled renamed framework222-res.apk and decompile again (that would be assigned id)
take away C:\ApkTools200RC3m\framework222-res\res\values\public.xml in the main that
(replaced the one that is there on this)
open public.xml in the editor (we'll be here to watch the assigned id)
collect ...
part 2
decompile android.policy.jar
from arhive policy add files
open GlobalActions.smali
paste below this line 20: Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;,
the following:
Code:
Lcom/android/internal/policy/impl/GlobalActions$RebootAction;,
Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;,
paste below this line 35: .field private static final GLOBAL_ACTION_KEY_POWER:Ljava/lang/String; = "power"
the following:
Code:
.field private static final GLOBAL_ACTION_KEY_REBOOT:Ljava/lang/String; = "reboot"
.field private static final GLOBAL_ACTION_KEY_RECOVERY:Ljava/lang/String; = "recovery"
and delete this
.field private static final GLOBAL_ACTION_KEY_SETTINGS:Ljava/lang/String; = "settings"
field line 1026:
const-string v0, "airplane"
and replace the code from .line 275 to .line 276
Code:
:cond_3
const-string v0, "airplane"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_4
at
Code:
:cond_3
const-string v0, "reboot"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_4
.line 276
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$RebootAction;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$RebootAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_3
now find
const-string v0, "settings"
and replace the code from .line 290 to .line 292
Code:
:cond_7
const-string v0, "settings"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_8
.line 291
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->getSettingsAction()Lcom/android/internal/policy/impl/GlobalActions$Action;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_3
at
Code:
:cond_7
const-string v0, "recovery"
invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_2
.line 291
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :goto_3
put the necessary files
give already moded GlobalActions.smali for that would compare if that
Click to expand...
Click to collapse
aweome!!
I wander if works add a bootloader and make it a 4 way :laugh:... will try that on Moto G 3 way, and if all good a 4 way :fingers-crossed:...
tks for share...
baybutcher27 said:
I wander if works add a bootloader and make it a 4 way :laugh:
Click to expand...
Click to collapse
Add Safe Mode and make it 5 Way.
Thank you for this tutorial, after deodexing and some minor changes works fine on my Moto G running GPe 5.0.1 [emoji106]
{
"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"
}
▪◼ Tapatalk ♦ Moto G ◼▪
Problem with Nexus 6 that I dont understand...
The menu works perfect but the mod breaks the ability to tether! Strange?
I have a log cat here of the tether fail errors if you want to look at it: http://pastebin.com/Nhesq4sV
Maybe you can help us figure it out for Nexus 6.