I learn it from this thread:http://forum.xda-developers.com/showthread.php?t=811532
this is the final method for Xperia phones that will add reboot options to the power menu
updated 2011/08/07
================================================== ==========
Step 1.
the first thing we need to do is add string and image resources to framwork-res
for this example I am using a MT15i_4.0.A.368_HK.ftf ROM
your resource id's will be different if on another ROM
use apk_manager to decompile framework-res
open "values\strings.xml" and add our string resources
Code:
<string name="reboot">Reboot</string>
save and close
open "values-zh-rCN\strings.xml" and add our string resources
Code:
<string name="reboot">重启手机</string>
save and close
open "values\public.xml" and assign our strings resource id's
scroll until you get to the end of the "<public type="string"" id list
note the id of the last string, in this example it is "0x010403e0" sometimes
the id's are out of order so search for "0x010403e0 + 1" or "0x010403e1"
if the next id is unused then we can start assigning id's to the strings
we added.
Code:
<public type="string" name="reboot" id="0x010403e1" />
now is a good time to add the image resources(reboot.png) so add your icons to
"res\drawable-hdpi"
and assign id's to them the same way we did for the strings(using the sorted funtion of microsoft-office-excel may be much more easier)
in this example, using the example icons in the zip file I had
Code:
<public type="drawable" name="reboot" id="0x01080526" />
save and close
now framework-res has the resources needed for this mod use
apk_manager to compile.
================================================== ==========
Step 2.
next we need to modify Xperia's shutdown method to accept 3 more options
so decompile framework and open "com\android\internal\app\ShutdownThread.smali "
since we are going to pass an integer to ShutdownThread and then evaluate
that integer when the code runs we have to have a spot for the integer so
change this
Code:
.field private static mReboot:Z
to
Code:
.field public static mReboot:I
.field private static mReboot:Z
then in method(add the red color code)
Code:
.line 409
:goto_1f
const-string v2, "ShutdownThread"
const-string v2, "Performing low-level shutdown..."
invoke-static {v4, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
Code:
sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
const/4 v2, 0x1
if-eq v1, v2, :cond_2f
Code:
.line 410
invoke-static {}, Landroid/os/Power;->shutdown()V
.line 411
return-void
Code:
:cond_2f
const-string v4, "reboot"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
Code:
.line 388
:catch_2a
move-exception v0
save and close
compile framework
================================================== ==========
Step 3.
now we are going to add the extra options to the power menu
decompile android.policy
open "com\android\internal\policy\impl\GlobalActions.sm ali"
the first thing that we need to do is increase the array length by 3
so in method createDialog change this
Code:
const/4 v0, 0x3
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
to this
Code:
const/4 v0, 0x4
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
now add the new menu items this is where the resource id's that we added
to framework-res com into play so after
Code:
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
add this code
Code:
aput-object v2, v0, v1
const/4 v1, 0x3
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
const v3, 0x1080526 # reboot icon resource id
const v4, 0x10403e1 # reboot string resource id
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
make sure to change the resource id's to match what you added to to framework-res
save and close
next add the code that runs when the menu item is pressed
copy GlobalActions$3.smali and name it GlobalActions$7.smali
open GlobalActions$7 and replace all instances of GlobalActions$3(ctrl+h)
with GlobalActions$7 then change
Code:
const/4 v1, 0x1
to
Code:
const/4 v1, 0x1
const/4 p0, 0x1
sput p0, Lcom/android/internal/app/ShutdownThread;->mReboot:I
save and close
compile android.policy
done test on the phone.
flash the attached update.zip with the stock updater.enjoy~
Click to expand...
Click to collapse
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Thank u EQ,Let me have a try
Any one can help me add new options reboot directly to CWM
quangnhut123 said:
Any one can help me add new options reboot directly to CWM
Click to expand...
Click to collapse
?
Sent Via LT15i - FXP46-CM7
quangnhut123 said:
Any one can help me add new options reboot directly to CWM
Click to expand...
Click to collapse
He wants boot to recovery
Sent from my MT15i using xda premium
blade buddy solves this problem
copy GlobalActions$3.smali and name it GlobalActions$7.smali
open GlobalActions$7 and "replace all instances of GlobalActions$3(ctrl+h)
with GlobalActions$7 then change"
can you tell me ho to do that with qoute?
copy "GlobalActions$3.smali" and name it "GlobalActions$7.smali"
open "GlobalActions$7.smali" and replace all instances of "GlobalActions$3" (ctrl+h)
with GlobalActions$7
example in first column:
.class Lcom/android/internal/policy/impl/GlobalActions$3;
change to
.class Lcom/android/internal/policy/impl/GlobalActions$7;
correct if am wrong
----------------------------------------------------------------------
indonesia:
copy "GlobalActions$3.smali" ganti nama jadi "GlobalActions$7.smali"
buka "GlobalActions$7.smali" dan ganti semua tulisan "GlobalActions$3" (ctrl+h)
dengan "GlobalActions$7"
contoh pada baris pertama:
.class Lcom/android/internal/policy/impl/GlobalActions$3;
menjadi
.class Lcom/android/internal/policy/impl/GlobalActions$7;
adoet_t said:
copy "GlobalActions$3.smali" and name it "GlobalActions$7.smali"
open "GlobalActions$7.smali" and replace all instances of "GlobalActions$3" (ctrl+h)
with GlobalActions$7
example in first column:
.class Lcom/android/internal/policy/impl/GlobalActions$3;
change to
.class Lcom/android/internal/policy/impl/GlobalActions$7;
correct if am wrong
----------------------------------------------------------------------
indonesia:
copy "GlobalActions$3.smali" ganti nama jadi "GlobalActions$7.smali"
buka "GlobalActions$7.smali" dan ganti semua tulisan "GlobalActions$3" (ctrl+h)
dengan "GlobalActions$7"
contoh pada baris pertama:
.class Lcom/android/internal/policy/impl/GlobalActions$3;
menjadi
.class Lcom/android/internal/policy/impl/GlobalActions$7;
Click to expand...
Click to collapse
You can use my mod from Ray here It is 99%(if not 100%) compatible with Arc..
Thank you MM!!!:D:D
error while recompiling
I apologize if this question is in wrong section but i ran into a small problem with my sony xperia ray ics 4.0.4 ...587,
I read the given tutorial on adding reboot, . But after i edit public xml i try to compile and it gives me an error
error: Public symbol drawable/reboot declared here is not defined.
i have followed the tutorial properly (i think)..plz help me where m i going wrong?
mandar_ez said:
I apologize if this question is in wrong section but i ran into a small problem with my sony xperia ray ics 4.0.4 ...587,
I read the given tutorial on adding reboot, . But after i edit public xml i try to compile and it gives me an error
error: Public symbol drawable/reboot declared here is not defined.
i have followed the tutorial properly (i think)..plz help me where m i going wrong?
Click to expand...
Click to collapse
did you add the drawable to the working folder?
PVy.
@ How to add Reboot to power menu for Xperia's phones
or install this theme..
http://forum.xda-developers.com/showthread.php?t=1952567
pvyParts said:
did you add the drawable to the working folder?
PVy.
Click to expand...
Click to collapse
thank you for replying..
yes i pasted the reboot.png in drawable-hdpi folder..on recompile there is that error..
thanks again
also i extracted the framework-res.apk from /system/framework/framework-res.apk from my xperia using the file manager..is it necessary to extract from the stock rom?
log:
C:\apktool>java -jar apktool.jar b frame NEWframework-res.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\apktool\frame\res\values\public.xml:6621: error: Public entry identifier 0x10
808bc entry index is larger than available symbols (index 2236, total symbols 20
38).
C:\apktool\frame\res\values\public.xml:6621: error: Public symbol drawable/ic_lo
ck_reboot declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-ver
sion, 15, -F, C:\Users\Kate\AppData\Local\Temp\APKTOOL3008729626159014937.tmp, -
x, -S, C:\apktool\frame\res, -M, C:\apktool\frame\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 15, --target-sdk-version, 15, -F, C:\Users\Kate\AppData\Local\Temp\AP
KTOOL3008729626159014937.tmp, -x, -S, C:\apktool\frame\res, -M, C:\apktool\frame
\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more
Hi
what about ics?
i need it plz help...
in ics the following line :
Code:
const/4 v0, 0x3
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
doesn't exist in android.policy.jar\com\android\internal\policy\impl\GlobalActions.smali
poria1999 said:
Hi
what about ics?
i need it plz help...
in ics the following line :
Code:
const/4 v0, 0x3
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
doesn't exist in android.policy.jar\com\android\internal\policy\impl\GlobalActions.smali
Click to expand...
Click to collapse
Can anyone help me?
poria1999 said:
Can anyone help me?
Click to expand...
Click to collapse
do you use stock ics????
s.bluedreams said:
do you use stock ics????
Click to expand...
Click to collapse
Yep...
Is it work for u?
poria1999 said:
Yep...
Is it work for u?
Click to expand...
Click to collapse
doesnt work at stock i think !
use one mod like Ultimate HD MOD by eagle boy and then try...
i didnt test it
هموطن
Does work at stock for sure.
Recoded it, mine works, this one maybe not.
Related
I found this:
http://forum.xda-developers.com/showthread.php?t=1483193
Can someone do this pls
???????
Sent from my Dell Streak using XDA App
DISCLAIMER:This is not my work,. i am just reposting
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
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"?>
<com.android.systemui.statusbar.LatestItemContainer androidrientation="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" androidaddingRight="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" />
</com.android.systemui.statusbar.LatestItemContainer>
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:
Add this code to the file like this before XML main body ends:
Code:
<resources>
.
.
.
<public type="anim" name="slide_out_left_basic" id="0x7f0c0000" />
<public type="anim" name="slide_out_right_basic" id="0x7f0c0001" />
</resources>
Please note that id should be unique for every line item so adjust the anim id accordingly. If you don't know how, just leave it, do a compile and decompile again and the id will be added automatically. Thanks to LeoMar for the tip!
Remember the Anim ID, save it for editing LatestItemContainer$1.smali
Save
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, 0x7f0c
and
Code:
.line 51
const v1, 0x7f0c0001
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
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/StatusBarNotificationV
move-object/from16 v0, v18
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/RunnableV
.line 735
:cond_swno
const v4, 0x7f0b0014
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;
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
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setDrawingCacheEnabled(Z)V
.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
.field static final TRANSACTION_onNotificationClear:I = 0xc
.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
sparse-switch p1, :sswitch_data_13e
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:
.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/StringV
.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
.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
0xc -> :sswitch_124
0x5f4e5446 -> :sswitch_8
.end sparse-switch
it's important to note this
Code:
0xc -> :sswitch_124
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/StringV
.line 363
invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeString(Ljava/lang/StringV
.line 364
invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeString(Ljava/lang/StringV
.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:
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
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
mother of god... one hell of a reply!
crashDebug said:
mother of god... one hell of a reply!
Click to expand...
Click to collapse
?
Sent from my Dell Streak using XDA App
I think it would be great if someone could do this for those of us who don't understand coding.
It's much better in sony Ericsson forum as Xperia mini pro is my second phone
devs There are willing to help but here nobody wills to help.
I already tried this but compiling back was error
Sent from my Dell Streak using XDA App
Mo one ???
Sent from my SK17i using XDA App
Hello friends today I want to share with you this little mod on how to integrate a button to switch 3G/2G in lidroidbar......:laugh:
We need to change 4 packages which include: lidroid-res.apk, the Secphone.apk, the quikpanel.apk and SystemUI.apk
First we have to add the receivers at Secphone.Apk and register them at runtime throug phone app startup..
Download this zip and paste into SecPhone.apk classes
1- Decompile Secphone.apk classes with apktool or simply extract the classes.dex and decompile with smali utility
Find the class PhoneApp.smali ( \com\android\phone ) and add this values : .
field private final mModeReceiver:Landroid/content/BroadcastReceiver; *
Code:
.field private mLastNumber:Ljava/lang/String;
.field private mLastPhoneState:Lcom/android/internal/telephony/Phone$State;
.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
.field private final mMediaButtonReceiver:Landroid/content/BroadcastReceiver;
[COLOR=DarkRed].field private final mModeReceiver:Landroid/content/BroadcastReceiver;[/COLOR] *
.field public mMmiInitMsg:Landroid/os/AsyncResult;
Search for new-instance v0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;
And after this line add this :
Code:
new-instance v0, Lcom/android/phone/NetworkModeReceiver;
invoke-direct {v0}, Lcom/android/phone/NetworkModeReceiver;-><init>()V
iput-object v0, p0, Lcom/android/phone/PhoneApp;->mModeReceiver:Landroid/content/BroadcastReceiver;
Now search this line iget-object v1, p0, Lcom/android/phone/PhoneApp;->mReceiver:Landroid/content/BroadcastReceiver;
and after invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneApp;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilterLandroid/content/Intent;
Add this code :
Code:
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "com.android.phone.CHANGE_NETWORK_MODE"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/android/phone/PhoneApp;->mModeReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneApp;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Thats all for Secphone.apk and you can recompile them.....
2- Now we need to add the button values to lidroid-res.apk ( easy part )
Decompile the lidroid framework and add this values to string : <string name="quickpanel_networkmode_text">2G/3G/Auto</string>
After we need to add to drawable-hdmi 3 png image and renaming in stat_gsm_on stat_gsm_off stat_gsm_auto, search for your favorite icon araund the web. Thats all for lidroid framework recompile.
After compiling lidroid-res.apk you need to decompile again and copy the corresponding values from the public file : Example in my case the string
quickpanel_networkmode_text have this value 0x050b0063 ( 0x50b0063 in systemui ), do this even for images that you have added ....We will need these values when we're going to add the button to lidroidbar within the systemui.
3- Add button to lidroid values inside the systemui:
Decompile your SystemUI classes.dex ( where the lidroidbar setting are ) and copy this file inside \com\lidroid\systemui\quickpanel
Search the power button.smali and add this values
Code:
[COLOR=DarkRed]sget-object v0, Lcom/lidroid/systemui/quickpanel/PowerButton;->BUTTONS:Ljava/util/HashMap;
const-string v1, "toggleNetworkMode"
const-class v2, Lcom/lidroid/systemui/quickpanel/NetworkModeButton;
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR]
.line 71
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
sput-object v0, Lcom/lidroid/systemui/quickpanel/PowerButton;->BUTTONS_LOADED:Ljava/util/HashMap;
.line 80
sput-object v3, Lcom/lidroid/systemui/quickpanel/PowerButton;->GLOBAL_ON_CLICK_LISTENER:Landroid/view/View$OnClickListener;
.line 83
sput-object v3, Lcom/lidroid/systemui/quickpanel/PowerButton;->GLOBAL_ON_LONG_CLICK_LISTENER:Landroid/view/View$OnLongClickListener;
return-void
.end method
In case adjust for your directory...
Now enter to com/lidroid/constants/ and open statusbar.smali and add this line:
.field public static final BUTTON_NETWORKMODE:Ljava/lang/String; = "toggleNetworkMode"
Now open out/lidroid and search for R$drawable.smali open and add this values:
Code:
.field public static final stat_gsm_on:I = 0x50200ff
.field public static final stat_gsm_off:I = 0x50200fe
.field public static final stat_gsm_auto:I = 0x5020100
adjusted values with those of your lidroid framework.....
Now open R$string.smali and add this line:
.field public static final quickpanel_networkmode_text:I = 0x50b0063
Also adjusted again values with those of your lidroid framework.....
Finally open the file we added before: the "NetworkModeButton.smali"
We have to adjust the values for the image and string take from the lidroid framework....
Thats all for SystemUI you can recompile.....:laugh:
4- Final part...Add toggle in the quikpanel.apk
Decompile the quikpanel.apk and insert this value to string.xml ( inside values/string )
<string name="title_toggle_NetworkMode">Toggle 2G/3G</string>
Compile and after decompile again, We need the string value that we added, take this value...
Now search into smali files the PowerWidjetUtil.smali and add another button like this:
Code:
const-string v1, "toggleNetworkMode"
new-instance v2, Lcom/goatrip/statusbar/PowerWidgetUtil$ButtonInfo;
const-string v3, "toggleNetworkMode"
const v4, 0x7f080049
const-string v5, "goatrip:drawable/stat_gsm_on"
invoke-direct {v2, v3, v4, v5}, Lcom/goatrip/statusbar/PowerWidgetUtil$ButtonInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
The button structure may be different than mine simply copy and paste a your existing button source.
Now adjust the string value with the one obtained first
Thats all Enjoy
If you like this mod simply give me a thanks!!!!!!
{
"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"
}
Added Modded Lidroid Framework......:laugh:
Hey, first of all, many thanks for your work.
But, I can´t make it work. I do all changes in SecPhone.apk, but any time I reboot the phone, all I get is SecPhone has sttoped. Any ideas to fix it.
The first point said: Download this zip and paste into SecPhone.apk classes
I decompiled SecPhone.apk first and copy the files later into \com\android\phone, I guess this the right order, isn´t it?.
If I replace the SecPhone.apk with the original one, there are not any fc, but this toggle does not appear anywhere. I can´t see it into the lidroidSettings.
ROM. LS8
Kernel: Jeboo
Thanks in advance, any help would be appreciated.
Josehg said:
Hey, first of all, many thanks for your work.
But, I can´t make it work. I do all changes in SecPhone.apk, but any time I reboot the phone, all I get is SecPhone has sttoped. Any ideas to fix it.
The first point said: Download this zip and paste into SecPhone.apk classes
I decompiled SecPhone.apk first and copy the files later into \com\android\phone, I guess this the right order, isn´t it?.
If I replace the SecPhone.apk with the original one, there are not any fc, but this toggle does not appear anywhere. I can´t see it into the lidroidSettings.
ROM. LS8
Kernel: Jeboo
Thanks in advance, any help would be appreciated.
Click to expand...
Click to collapse
+1
Does the toggle switch between 2G & 3G bands?
hi Neme77
Can you tell me how I can add 23 Toggles in In this SystemUI here
I want to add lidroid-res - LidroidSettings
Please,
Someone made work this mod on LSD or LSE?
Enviado desde mi GT-I9100 usando Tapatalk 2
Devil_1210 said:
Someone made work this mod on LSD or LSE?
Enviado desde mi GT-I9100 usando Tapatalk 2
Click to expand...
Click to collapse
+1
that would be awesome
anyone?
Josehg said:
Hey, first of all, many thanks for your work.
But, I can´t make it work. I do all changes in SecPhone.apk, but any time I reboot the phone, all I get is SecPhone has sttoped. Any ideas to fix it.
The first point said: Download this zip and paste into SecPhone.apk classes
I decompiled SecPhone.apk first and copy the files later into \com\android\phone, I guess this the right order, isn´t it?.
If I replace the SecPhone.apk with the original one, there are not any fc, but this toggle does not appear anywhere. I can´t see it into the lidroidSettings.
ROM. LS8
Kernel: Jeboo
Thanks in advance, any help would be appreciated.
Click to expand...
Click to collapse
in SecPhone, after all the changes, delete this string in the AndroidManifest.xml:
Code:
<uses-permission android:name="android.permission.DUMP" />
Recompile and Sign apk
Troy.main said:
hi Neme77
Can you tell me how I can add 23 Toggles in In this SystemUI here
I want to add lidroid-res - LidroidSettings
Please,
Click to expand...
Click to collapse
In LidroidSetting.apk\smali\com\lidroid\settings\statusbar\ PowerWidgetUtil.smali add this command to the end of the following method:
.method public static getButtons(Landroid/content/ContextLjava/util/HashMap;
Add the RED lines
Code:
const-string v6, "lidroid:drawable/stat_multiwindow_on"
invoke-direct {v3, v4, v5, v6}, Lcom/lidroid/settings/statusbar/PowerWidgetUtil$ButtonInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 189
:cond_18
[COLOR="DarkRed"] const-string v1, "toggleNetworkMode"
invoke-virtual {v0, v1, v7}, Lcom/lidroid/settings/Features;->has(Ljava/lang/String;Z)Z
move-result v1
if-eqz v1, :cond_mak
.line 186
sget-object v1, Lcom/lidroid/settings/statusbar/PowerWidgetUtil;->BUTTONS:Ljava/util/HashMap;
const-string v2, "toggleNetworkMode"
new-instance v3, Lcom/lidroid/settings/statusbar/PowerWidgetUtil$ButtonInfo;
const-string v4, "toggleNetworkMode"
const v5, 0x7f09009f
const-string v6, "lidroid:drawable/stat_gsm_on"
invoke-direct {v3, v4, v5, v6}, Lcom/lidroid/settings/statusbar/PowerWidgetUtil$ButtonInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 190
:cond_mak[/COLOR]
sget-object v1, Lcom/lidroid/settings/statusbar/PowerWidgetUtil;->BUTTONS:Ljava/util/HashMap;
goto/16 :goto_0
.end method
If you have the lidroid of wanam, edit the smali NetworkModeButton.smali, replacing all the words "lidroid" with "wanam"
example:
Code:
Before:
.class public Lcom/lidroid/systemui/quickpanel/NetworkModeButton;
.super Lcom/lidroid/systemui/quickpanel/PowerButton;
Later:
.class public Lcom/wanam/systemui/quickpanel/NetworkModeButton;
.super Lcom/wanam/systemui/quickpanel/PowerButton;
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment 4269150
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
GUIDE IS ON POST #2
Hi folks!
In Skype 4.x it is impossible to call invisible contacts, and I was hoping you would lend me a hand to change things around!
Here's what I got so far:
I assume that the app is checking if the contact is available, if not it returns an error message
The displayed error message is "No answer"
In \res\values\strings.xml the string "No answer" has 2 matches:
Code:
<string name="message_call_duration_no_answer">no answer</string>
and
<string name="message_call_failed_no_answer">No answer</string>
I assume we're looking for the latter
Apart from public.xml and many localized string.xml the string "message_call_failed_no_answer" can only be found in two R$string.smali (in \smali\com\skype\raider and \smali\com\skype\android\app) wich I assume being identical for our purposes
Code:
.class public final Lcom/skype/android/app/R$string;
.super Ljava/lang/Object;
.source "R.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/skype/android/app/R;
.end annotation
Code:
.class public final Lcom/skype/raider/R$string;
.super Ljava/lang/Object;
.source "R.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/skype/raider/R;
.end annotation
From this line on the files are identical
In both the files the string "message_call_failed_no_answer" has only 1 match:
Code:
.field public static final message_call_failed_no_answer:I = 0x7f070261
If we look for the string "0x7f070261", we find it in 4 files: public.xml, the two almost identical R$string.smali, and smali\com\skype\android\app\calling\PreCallActivity.smali
In PreCallActivity.smali the string "0x7f070261" has only 1 match:
Code:
.method private endCallWithReason(Lcom/skype/SkyLib$LEAVE_REASON;)V
[blablabla]
.line 642
:pswitch_6
const v0, 0x7f070261
invoke-virtual {p0, v0}, Lcom/skype/android/app/calling/PreCallActivity;->getString(I)Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lcom/skype/android/app/calling/PreCallActivity;->endCallWithMessage(Ljava/lang/String;)V
goto :goto_0
...but... my coding skills are equal to ZERO, so I have no clue how to proceed from here
I tried to look into Skype 3.2 but PreCallActivity.smali doesn't exist: nor in smali\com\skype\android\app (infact in smali\com\skype\android\ there is no app subdir to be found at all...), nor anywhere else.
A little help please?
Thank you for your time
f:fingers-crossed:
Edit: Now that I think of it, I will try to just delete from .line 642 to goto_0 and recompile... I'm not so hopeful but hey! :fingers-crossed:
Edit: I Recompiled the apk deleting only
Code:
invoke-virtual {p0, v0}, Lcom/skype/android/app/calling/PreCallActivity;->getString(I)Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lcom/skype/android/app/calling/PreCallActivity;->endCallWithMessage(Ljava/lang/String;)V
, copied META-INF folder and AndroidManifest.xml over from the original apk to the newly compiled one, checked zipalignment zipaligned it, signed it and... GREAT SUCCESS! I've managed to insall and use the app... now I'll wait for my invisible friends to "show up"
GUIDE
Alrighty Folks!
Well... IT WORKS
So, to sum it up, if you want to do it yourself:
Decompile the Skype apk
Open \smali\com\skype\android\app\PreCallActivity.smali in Notepad++ (or your editor of choice)
Find 0x7f070261
Edit the file to look something like this
HTML:
const v0, 0x7f070261
#
# invoke-virtual {p0, v0}, Lcom/skype/android/app/calling/PreCallActivity;->getString(I)Ljava/lang/String;
#
# move-result-object v0
#
# invoke-direct {p0, v0}, Lcom/skype/android/app/calling/PreCallActivity;->endCallWithMessage(Ljava/lang/String;)V
#
goto :goto_0
(I commented the pesky lines but I guess deleting them would be ok too)
Recompile
Open your new apk and copy META-INF folder and manifest.xml from the original apk
Sign the new apk
Zipalign the signed apk
Install as a regular apk
CREDITS:
KUDOS TO @ibanez7 FOR HIS EXCELLENT GUIDE ABOUT DECOMPILING/RECOMPILING APKs :good::good::good: (Recommended if you have doubts about any of the above steps)
KUDOS TO @Flextrick FOR HIS AWESOME ANDROID MULTITOOL :good::good::good:
Make sure you thank them if you found this guide useful
Enjoy
f
Howdy I have been compiling a list mods for the Verizon Note 4, but most should work across all variants!!
{
"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 thread is posted in the Samsung Galaxy Note 4 Unified Development Thread and can be viewed across all Note 4 Variants.
This is and will always be a work in progress, so feel free to contribute and please do!!!!
This thread assumes you know how to decompile and compile using APKTOOL.
Enjoy!!!
[Guide How-to] Verizon Note 4 Remove CD Installer & ASEC Note 4
This removes the annoying CD installer that pops up when you plug into your computer and your phone will go straight to MTP.
Enjoy!!
Remove CD Installer Download: http://d-h.st/Wm7
Just flash with TWRP
[Guide How-to] Verizon Note 4 Enable Native Call Recording Note 4
Smali edit for InCallUI.apk:
com/android/services/telephony/common/PhoneFeature.smali
Add the lines that are highlighted in RED
Code:
const-string v3, "CscFeature_VoiceCall_ConfigRecording"
invoke-virtual {v0, v3}, Lcom/sec/android/app/CscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
[COLOR="Red"]const-string v0, "RecordingAllowed"[/COLOR]
.line 1693
sget-object v3, Lcom/android/services/telephony/common/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
const-string v6, "voice_call_recording"
const-string v7, "RecordingAllowed"
const-string v3, "CscFeature_VoiceCall_ConfigRecording"
invoke-virtual {v0, v3}, Lcom/sec/android/app/CscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const-string v0, "RecordingAllowed"
.line 1693
sget-object v3, Lcom/android/services/telephony/common/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
const-string v6, "voice_call_recording"
const-string v7, "RecordingAllowed"
For those not capable of doing smali edits just flash this via TWRP. Enable Call Recording
[Guide How-to] Remove Lockscreen Carrier Note 4
This removes the lockscreen carrier text.
Keyguard.apk smali edit:
smali/com/android/keyguard/CarrierText.smali:
Change if-nez to if-eqz in the indicated edit in BLUE:
Code:
.method private static concatenate(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
.locals 5
.param p0, "plmn" # Ljava/lang/CharSequence;
.param p1, "spn" # Ljava/lang/CharSequence;
.prologue
const/4 v2, 0x1
const/4 v3, 0x0
.line 310
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v4
[COLOR="Blue"]if-eqz[/COLOR] v4, :cond_1
move v0, v2
For those of you not capable of smali edit's, just flash this via TWRP Remove Lock Screen Carrier Text
[Guide How-to] Remove Safe Volume Warning Note 4
This removes the safe volume warning that pops up when you turn up the volume beyond a certain point
This mod requires modifying framework.jar
Edit smali/android/media/AudioService.smali:
Changes are in .method private checkSafeMediaVolume(III)Z
, new lines are in BLUE:
Code:
iget-object v6, p0, Landroid/media/AudioService;->mSafeMediaVolumeState:Ljava/lang/Integer;
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
move-result v6
[COLOR="Blue"]goto :goto_td[/COLOR]
if-ne v6, v7, :cond_4
Code:
goto :goto_1
.line 6873
.end local v0 # "e":Ljava/lang/Exception;
.end local v1 # "pm":Landroid/os/PowerManager;
.end local v3 # "wl":Landroid/os/PowerManager$WakeLock;
[COLOR="Blue"]:goto_td[/COLOR]
:cond_4
monitor-exit v5
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
goto :goto_0
.end method
For those not capable of smali edit's just flash this in TWRP Remove Safe Volume Warning
[Guide How-To] Enable Call & MSG Blocking Note 4
This enables call and msg blocking natively.
Simple CSC edit.
system/csc/feature.xml edit
Must be inserted BEFORE
</FeatureSet>
</SamsungMobileFeature>
(** please note that feature.xml can be overwritten so this may not stick if using a third party software like Xposed)
Code:
<CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
For those of you not capable of this edit, just flash this with TWRP Native Call & Message Block
[Guide How-to] Replace Recents with Menu Note 4
Keylayout edits:
system/usr/keylayout/Generic.kl
Change key 254 from APP_SWITCH to MENU
key 254 MENU
Download: Generic.kl
Now Recent Apps capacitive key is Menu (single-press) and Search (long-press).
However, we have now lost access to recent apps via a hardware key.
[Guide How-to] VZW Note 4 4 Way Reboot Power Menu EPM Note 4
This will work with Odex or Deodexed Rom. To see the 4 way Menu you must hit restart on the Primary Menu!!!
First grab your Deodexed android.policy.jar from system/framework
Decompile it with APKTOOL. Look in smali\com\android\internal\policy\impl\
Find GlobalActions$SinglePressAction.smali and open with NotePad++
Look for this:
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
# instance fields
.field public customAction:I
.field public isKnoxCustom:Z
.field private final mIcon:Landroid/graphics/drawable/Drawable;
.field private final mIconResId:I
.field mLayoutId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
# direct methods
.method protected constructor <init>(II)V
.locals 2
.param p1, "iconResId" # I
.param p2, "messageResId" # I
Add in the Red Text to look like this:
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
[COLOR="Red"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
# instance fields
.field public customAction:I
.field public isKnoxCustom:Z
.field private final mIcon:Landroid/graphics/drawable/Drawable;
.field private final mIconResId:I
.field mLayoutId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
# direct methods
[COLOR="Red"].method static constructor <clinit>()V
.locals 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method[/COLOR]
.method protected constructor <init>(II)V
.locals 2
.param p1, "iconResId" # I
.param p2, "messageResId" # I
Save file and look for GlobalActions.smali in the same folder.
Find this:
Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1126
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$8;
const-string v2, "VZW"
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
const v2, 0x1080b2d
:goto_2
const v4, 0x10401cf
move-object/from16 v0, p0
invoke-direct {v3, v0, v2, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1164
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
Change the red text to look like this:
Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1126
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]99[/COLOR];
const-string v2, "VZW"
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
const v2, 0x1080b2d
:goto_2
const v4, 0x10401cf
move-object/from16 v0, p0
invoke-direct {v3, v0, v2, v4}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]99[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1164
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
Save file.
Add the 3 smali files in this zip to the same folder: Smali-Files-Zip
Now recompile. That's it.
For those of you not able to edit smali. Here is a zip flashable with TWRP. VZW Note 4 4 Way EPM Menu
To see the 4 way Menu you must hit restart on the Primary Menu!!!
Enjoy!!!
Framework Mods- Note 4 Native WiFi Tether, All Rotations, Safe Media Volume Disabled, Dreams enabled, Battery Critical Warnings lowered to 1%.
Here is the download: Framework Mods
Here is the download to return to stock: Stock Framework
Enjoy!!!
[Guide How-to] Remove NFC notification icon in status bar Note 4
First grab your Features.xml from /system/csc/
Open with Notepad++ and look for following text:
Code:
<!-- NFC -->
<CscFeature_NFC_SetSecureEventType>ISIS</CscFeature_NFC_SetSecureEventType>
<CscFeature_NFC_StatusBarIconType>Vzw</CscFeature_NFC_StatusBarIconType>
<CscFeature_SmartcardSvc_SetAccessControlType>GPAC, MODE1</CscFeature_SmartcardSvc_SetAccessControlType>
<CscFeature_SmartcardSvc_HideTerminalCapability>eSE</CscFeature_SmartcardSvc_HideTerminalCapability>
<CscFeature_NFC_CardModeRoutingTypeForUicc>ROUTE_ON_WHEN_SCREEN_UNLOCK</CscFeature_NFC_CardModeRoutingTypeForUicc>
<CscFeature_NFC_EnableSecurityPromptPopup>all</CscFeature_NFC_EnableSecurityPromptPopup>
<CscFeature_NFC_EnableInvalidTagPopup>true</CscFeature_NFC_EnableInvalidTagPopup>
<CscFeature_NFC_ConfigAdvancedSettings>Disable</CscFeature_NFC_ConfigAdvancedSettings>
<CscFeature_NFC_DefaultCardModeConfig>DH:UICC</CscFeature_NFC_DefaultCardModeConfig>
Change the red text to look like this:
Code:
<!-- NFC -->
<CscFeature_NFC_SetSecureEventType>ISIS</CscFeature_NFC_SetSecureEventType>
<CscFeature_NFC_StatusBarIconType>[COLOR="Red"]none[/COLOR]</CscFeature_NFC_StatusBarIconType>
<CscFeature_SmartcardSvc_SetAccessControlType>GPAC, MODE1</CscFeature_SmartcardSvc_SetAccessControlType>
<CscFeature_SmartcardSvc_HideTerminalCapability>eSE</CscFeature_SmartcardSvc_HideTerminalCapability>
<CscFeature_NFC_CardModeRoutingTypeForUicc>ROUTE_ON_WHEN_SCREEN_UNLOCK</CscFeature_NFC_CardModeRoutingTypeForUicc>
<CscFeature_NFC_EnableSecurityPromptPopup>all</CscFeature_NFC_EnableSecurityPromptPopup>
<CscFeature_NFC_EnableInvalidTagPopup>true</CscFeature_NFC_EnableInvalidTagPopup>
<CscFeature_NFC_ConfigAdvancedSettings>Disable</CscFeature_NFC_ConfigAdvancedSettings>
<CscFeature_NFC_DefaultCardModeConfig>DH:UICC</CscFeature_NFC_DefaultCardModeConfig>
Save file and copy back to /system/csc, reboot and boom its gone!!!
Enjoy!!
[Guide How-to] Enable Private Mode with a deodexed Rom and SecureStorage=false Note 4
First thing you need to do is grab PersonalPageService.apk from system/priv-app
Decompile with APKTOOL
Find PersonalPageService\smali\com\samsung\android\personalpage\service\util\SecureProperties.smali open with Notepad++
Find the follow code:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
.param p1, "context" # Landroid/content/Context;
.prologue
const/4 v1, 0x1
.line 61
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 54
const/4 v0, 0x0
iput-object v0, p0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->mImpl:Lcom/samsung/android/personalpage/service/util/SecureProperties$PropertiesImpl;
.line 63
invoke-static {}, Landroid/os/Debug;->isProductShip()I
move-result v0
if-nez v0, :cond_3
.line 64
invoke-static {}, Lcom/sec/android/securestorage/SecureStorage;->isSupported()Z
move-result v0
if-nez v0, :cond_2
.line 65
const/4 v0, 0x0
sput-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
.line 72
:goto_0
sget-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
if-eqz v0, :cond_0
Replace the items in Red like this:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
.param p1, "context" # Landroid/content/Context;
.prologue
const/4 v1, 0x1
.line 61
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 54
const/4 v0, 0x0
iput-object v0, p0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->mImpl:Lcom/samsung/android/personalpage/service/util/SecureProperties$PropertiesImpl;
.line 63
invoke-static {}, Landroid/os/Debug;->isProductShip()I
move-result v0
[COLOR="Red"]if-nez v0, :cond_0[/COLOR]
.line 64
invoke-static {}, Lcom/sec/android/securestorage/SecureStorage;->isSupported()Z
move-result v0
[COLOR="Red"]if-nez v0, :cond_0[/COLOR]
.line 65
const/4 v0, 0x0
sput-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
.line 72
:goto_0
sget-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
if-eqz v0, :cond_0
Save file and compile apk. Push to system/priv-app
For those not capable of changing smali files here is a flashable zip: PersonalPageService.apk
Enjoy!!!
[Guide How-To] Enable Lockscreen Rotation Note 4
First grab Keyguard.apk from system/priv-app
Decompile with APKTOOL.
Open smali file smali/com/android/keyguard/KeyguardViewManager.smali
Look for the following:
Code:
.method private shouldEnableScreenRotation()Z
.locals 3
.prologue
const/4 v1, 0x0
.line 249
iget-object v2, p0, Lcom/android/keyguard/KeyguardViewManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 250
.local v0, "res":Landroid/content/res/Resources;
const-string v2, "lockscreen.rot_override"
invoke-static {v2, v1}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v2
Replace the Red text to look like this:
Code:
Code:
.method private shouldEnableScreenRotation()Z
.locals 3
.prologue
[COLOR="Red"]const/4 v1, 0x1[/COLOR]
.line 249
iget-object v2, p0, Lcom/android/keyguard/KeyguardViewManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 250
.local v0, "res":Landroid/content/res/Resources;
const-string v2, "lockscreen.rot_override"
invoke-static {v2, v1}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v2
Compile and push to system/priv-app
For those that are unable to edit smali here is a flashable zip: LockSceen Rotation
Enjoy!!
[Guide How-to] Disable Screen Wake Plugged/Unplugged Note 4
First grab your services.jar from system/framework and decompile with APKTOOL
Find smali\com\android\server\power\PowerManagerService .smali and open PowerManagerService with Notepad++
Look for the following:
Code:
.method private shouldWakeUpWhenPluggedOrUnpluggedLocked(ZIZ)Z
.locals 4
.param p1, "wasPowered" # Z
.param p2, "oldPlugType" # I
.param p3, "dockedOnWirelessCharger" # Z
.prologue
const/4 v1, 0x1
const/4 v0, 0x0
.line 2216
iget-boolean v2, p0, Lcom/android/server/power/PowerManagerService;->mWakeUpWhenPluggedOrUnpluggedConfig:Z
if-nez v2, :cond_1
Change to Red text to look like this:
Code:
.method private shouldWakeUpWhenPluggedOrUnpluggedLocked(ZIZ)Z
.locals 4
.param p1, "wasPowered" # Z
.param p2, "oldPlugType" # I
.param p3, "dockedOnWirelessCharger" # Z
.prologue
[COLOR="Red"]const/4 v1, 0x0[/COLOR]
const/4 v0, 0x0
.line 2216
iget-boolean v2, p0, Lcom/android/server/power/PowerManagerService;->mWakeUpWhenPluggedOrUnpluggedConfig:Z
if-nez v2, :cond_1
That's it. Compile and push to system/framework
For those of you not capable of editing smali files here is a flashable zip: Disable Screen Wake Plug/unpluged
Enjoy!!!
[Guide How-to] Bluetooth Scan Dialog Removal
First grab your SecSettings.apk from system/priv-app and decompile with APKTOOL
Find smali/com/android/settings/Bluetooth/BluetoothScanDialog.smali
Look for the follow in .method private initialize()V method:
Code:
.line 79
new-instance v4, Lcom/android/settings/bluetooth/BluetoothScanDialog$3;
invoke-direct {v4, p0, v0}, Lcom/android/settings/bluetooth/BluetoothScanDialog$3;-><init>(Lcom/android/settings/bluetooth/BluetoothScanDialog;Landroid/app/AlertDialog;)V
invoke-virtual {v0, v4}, Landroid/app/Dialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V
.line 86
[COLOR="Red"]invoke-virtual {v0}, Landroid/app/Dialog;->show()V[/COLOR]
.line 87
return-void
.end method
Delete the text in Red, save file and compile. That's it. push to system/priv-app
Enjoy!!!
Flashlight Toggle & Battery Stats Toggle Mod Flashable-Settings-About Phone-Status-OFFICIAL Zip Updated 12-3-2014
Here is the flashable Flashlight Toggle Mod: VZW Flash Light Battery Stats Toggle Mod-Official Status
YOU MUST WAIT AT LEAST 5-10 MINS AFTER FLASHING FOR THE MOD TO WORK.
Some of you might also have to add "Flashlight" to your settings DB via SQLite. To see the toggle.
1) Download sqlite editor app. I got it from here.
2) Open the app and give it root permissions. It should populate a list.
3) Scroll and Tap the "Settings Storage"
4) Tap "Settings.db"
5) Tap "System"
6) Scroll down until you find "notification_panel_active_app_list", tap to highlight it. I noticed its a little hard to get it highlighted because it seems to want to highlight the one under it. So you might have to tap the one right above it to get it highlighted. Make sure its the notification_panel_active_app_list, and I also updated my notification_panel_active_app_list_reset NOT the notification_panel_default_active_app_list. I picked the wrong one the first time and it didnt work.
7) Once it is highlighted tap the phones menu button.
8) Tap "Edit Record"
9) You'll see a list of all the toggles that are currently enabled to show in notification area.
10) At the bottom of the list or anywhere else in the list add ; and the words Flashlight and Battery then another ;. So it will look like this at the end. ;TouchSensitivity;Flashlight;Battery; Then press Save.
11) Reboot and you should have a Flashlight and a Battery Stats toggle now. You can now use the edit feature and move it anywhere you want in the list of toggles.
This might also have a positive side effect of the following:
When you go to Settings-About Phone-Status it might say OFFICIAL!!!
Enjoy!!!
Enable Tab view in Settings
First grab your SecSettings.apk from system/priv-app
Decompile with APKTOOL and open res.values/bools with Notepad++
look for the following 2 lines:
Code:
<bool name="settings_list">false</bool>
<bool name="settings_grid">true</bool>
Change them to look like this:
Code:
<bool name="settings_list">[COLOR="Red"]true[/COLOR]</bool>
<bool name="settings_grid">[COLOR="Red"]false[/COLOR]</bool>
That's it. Compile and push to System/priv-app
Enjoy!!
How to enable Flashlight operation with Volume
First grab your SecSettings.apk from system/priv-app and decompile with APKTOOL.
Look in res/xml for display_settings_2014.xml and open with Notepad++
Add the following line in Red. When you are done look in settings-Display and you will see Torch Light options menu
Code:
<CheckBoxPreference android:title="@string/led_indicator_settings" android:key="key_simple_led_indicator_settings" android:summary="@string/led_indicator_settings_summary" android:widgetLayout="@touchwiz:layout/preference_widget_twcheckbox" />
[COLOR="Red"]<PreferenceScreen android:title="@string/torchlight_settings" android:key="torchlight" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
<ListPreference android:persistent="false" android:entries="@array/touch_key_light_entries" android:title="@string/touch_key_light" android:key="touch_key_light" android:summary="@string/touch_key_light_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/touch_key_light_values" />
Compile and push to system/priv-app
That's it.
Enjoy!!!!
How to Enable add Apps Ops to Settings.
First grab SecSettings.apk from system/priv-app and decompile with APKTOOL
Get gridlist_settings_headers.xml from res/xml and edit with Notepad++
Look for:
Code:
<header android:icon="@drawable/ic_setting_grid_powersaving" android:id="@id/power_saving" android:title="@string/power_saving_mode_title_k" android:fragment="com.android.settings.powersavingmode.MenuPowerSavingModeSettings" />
and add right below it the following:
Code:
<header android:icon="@drawable/ic_settings_applicationpermissions" android:title="@string/app_ops_settings" android:fragment="com.android.settings.applications.AppOpsSummary" />
Save file and compile. That's it.
Push to system/priv-app
Enjoy!!!
Great post...
Will the Wi-Fi tether mod work with the ATT Variant?
thesilentnight said:
Great post...
Will the Wi-Fi tether mod work with the ATT Variant?
Click to expand...
Click to collapse
I have not seen the AT&T firmware. You must be rooted. If you are rooted and want to send me your framework-res.apk I can take a look for you.
Sadly as far as i know, root isnt yet available yet for the ATT variant....
thesilentnight said:
Sadly as far as i know, root isnt yet available yet for the ATT variant....
Click to expand...
Click to collapse
OMG, I'm sooo glad I could write what's written in my signature.
EMSpilot said:
...Here is the flashable Flashlight Toggle Mod...
Click to expand...
Click to collapse
You sir, ROCK!!! Very good work
the "Verizon Note 4 Enable Native Call Recording Note 4"
Will this work on N910G snapdragon variant ? also, does this enable automatic call recording ?
pratik_193 said:
the "Verizon Note 4 Enable Native Call Recording Note 4"
Will this work on N910G snapdragon variant ? also, does this enable automatic call recording ?
Click to expand...
Click to collapse
If you can send me your InCallUI.apk I can take a look. No automatic call recording. When you get a call or make a call you simply tap the call recording button once on the screen.
EMSpilot said:
If you can send me your InCallUI.apk I can take a look. No automatic call recording. When you get a call or make a call you simply tap the call recording button once on the screen.
Click to expand...
Click to collapse
Here it is..
Can you make a modded secphone something we had for note 3 ? link below
http://forum.xda-developers.com/showthread.php?t=2498449
CZ Eddie said:
OMG, I'm sooo glad I could write what's written in my signature.
Click to expand...
Click to collapse
Why is that?
thesilentnight said:
Sadly as far as i know, root isnt yet available yet for the ATT variant....
Click to expand...
Click to collapse
CZ Eddie said:
OMG, I'm sooo glad I could write what's written in my signature.
Click to expand...
Click to collapse
thesilentnight said:
Why is that?
Click to expand...
Click to collapse
My sig is pretty self explanatory in regards to your earlier statement.
I ditched my grandfathered unlimited data plan with AT&T in November 2014 because AT&T won't let anyone root their Galaxy phones.
Hello, T-Mobile!
Click to expand...
Click to collapse
pratik_193 said:
Here it is..
Can you make a modded secphone something we had for note 3 ? link below
http://forum.xda-developers.com/showthread.php?t=2498449
Click to expand...
Click to collapse
Hey @EMSpilot any luck ?
pratik_193 said:
Hey @EMSpilot any luck ?
Click to expand...
Click to collapse
Where did this InCallUI.apk come from? It won't build.
EMSpilot said:
Where did this InCallUI.apk come from? It won't build.
Click to expand...
Click to collapse
i got it from the current ROM i have a N910G snapdragon... you need anything else ?
Hmm, get a whole bunch of errors when trying to decompile SecSettings.apk. I can decompile other apks fine so don't think it's something with my setup.
Code:
W: Skipping "android" package group
W: Could not decode attr value, using undecoded value instead: ns=android, name=widgetLayout, value=0x02030015
Can't find framework resources for package of id: 2. You must install proper framework files, see project website for more info
Great post op!!
Did by any chance someone tried this in an international N4?
Awesome thread!
Subscribed!
Thanks contributors!
@EMSpilot
when i try to add the torchlight mod it makes all the checkboxes in the settings menu disappear.
any idea what the problem could be? the mod itself works perfect, but the checkboxes are pretty usefull as well.
thanks in advance :good:
Psycho_666 said:
@EMSpilot
when i try to add the torchlight mod it makes all the checkboxes in the settings menu disappear.
any idea what the problem could be? the mod itself works perfect, but the checkboxes are pretty usefull as well.
thanks in advance :good:
Click to expand...
Click to collapse
What Rom are you running? NJ5? or? The mods are based on NI2. If you are running NJ5 you have to decompile do the mod compile and push back to the phone.
I'm running an ANK5 rom.
but I don't understand how it has anything to do with the checkboxes.
it's pretty frustrating
Sent from my Note 4
{
"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"
}
Hello everybody!
Just wanted to write a guide to mod SystemUI for notch device cause I want to show both notification icon and clock. This mod is temporary because I believe that MIUI Team will fix this in next version
Big update: This mod is officially supported by mi-globe.com and made for all version of MIUI. Big thanks to mi-globe.com and @zapperbyte.
See more here:
https://mi-globe.com/miui-notification-icons-for-notch-phones/[/QUOTE]
Ok let start
Things needed:
1.Basic knowledge how to compile/decompile using Apktool/Apk Studio... whatever you prefered
3.Brain and pation
Thanks to @sacca25 for letting me know about mi-globe forum. Thanks mi-globe forum for awesome center-clock mod
Steps:
First, backup your original MiuiSystemUI.apk
1. Decompile center clock MiuiSystemUI
2. Edit status_bar layout
3. Edit status_bar smali code
4. Edit dimension for smaller clock
5. Recompile MiuiSystemUI. Done!
Dont forget to run "adb shell settings put system status_bar_show_notification_icon 1" from CMD
Edit smali code. Be careful
Note: Code can be different base on MIUI release version and devices. Find exactly code to remove. Just look at method name to find
1. Edit SystemUI\smali\com\android\systemui\statusbar\phone\CollapsedStatusBarFragment.smali
Find this code and remove RED line
Code:
.method public hideNotificationIconArea(Z)V
.locals 1
[COLOR="Red"] sget-boolean v0, Lcom/android/systemui/Constants;->IS_NOTCH:Z
if-nez v0, :cond_0[/COLOR]
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->animateHide(Landroid/view/View;Z)V
[COLOR="red"] :cond_0[/COLOR]
return-void
.end method
Next find this code and remove RED line too
Code:
.method public initNotificationIconArea(Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;)V
.locals 3
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mStatusBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0a01d1
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/view/ViewGroup;
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;->getNotificationInnerAreaView()Landroid/view/View;
move-result-object v1
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaController:Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-virtual {v1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v1
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-virtual {v1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v1
check-cast v1, Landroid/view/ViewGroup;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-virtual {v1, v2}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V
:cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
const/4 v1, 0x0
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->showNotificationIconArea(Z)V
[COLOR="Red"] sget-boolean v1, Lcom/android/systemui/Constants;->IS_NOTCH:Z
if-nez v1, :cond_1[/COLOR]
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mStatusBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0a01a9
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Lcom/android/systemui/statusbar/StatusBarIconView;
invoke-virtual {p1, v1}, Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;->setMoreIcon(Lcom/android/systemui/statusbar/StatusBarIconView;)V
[COLOR="red"] :cond_1[/COLOR]
return-void
.end method
Finally for this file, found this code and remove RED line
Code:
.method public showNotificationIconArea(Z)V
.locals 1
[COLOR="Red"] sget-boolean v0, Lcom/android/systemui/Constants;->IS_NOTCH:Z
if-nez v0, :cond_0[/COLOR]
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->animateShow(Landroid/view/View;Z)V
[COLOR="red"] :cond_0[/COLOR]
return-void
.end method
2. Edit SystemUI\smali\com\android\systemui\statusbar\phone\StatusBar.smali
Find this code and remove RED line
Code:
.method private updateNotificationIconsLayout()V
.locals 5
iget v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mState:I
const/4 v4, 0x1
if-ne v3, v4, :cond_1
const/4 v1, 0x1
:goto_0
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mMiuiStatusBarPrompt:Lcom/android/systemui/miui/statusbar/phone/MiuiStatusBarPromptController;
const/4 v4, 0x2
invoke-virtual {v3, v4}, Lcom/android/systemui/miui/statusbar/phone/MiuiStatusBarPromptController;->isShowingState(I)Z
move-result v0
[COLOR="Red"] sget-boolean v3, Lcom/android/systemui/Constants;->IS_NOTCH:Z
if-nez v3, :cond_2[/COLOR]
iget-boolean v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mShowNotifications:Z
if-eqz v3, :cond_2
if-eqz v0, :cond_0
if-eqz v1, :cond_2
:cond_0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mDemoMode:Z
xor-int/lit8 v2, v3, 0x1
:goto_1
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mNotifications:Landroid/view/View;
if-eqz v2, :cond_3
const/4 v3, 0x0
:goto_2
invoke-virtual {v4, v3}, Landroid/view/View;->setVisibility(I)V
return-void
:cond_1
const/4 v1, 0x0
goto :goto_0
:cond_2
const/4 v2, 0x0
goto :goto_1
:cond_3
const/4 v3, 0x4
goto :goto_2
.end method
Done. Now you have notification icon show on status bar, but it covered by the notch. Next, we going to edit layout file to show notification icon
Edit status bar layout
Just need to replace status_bar.xml attach below to exist one in res/layout folder
For one who have knowledge about editting xml layout file, you can edit layout file to what you prefered.
Edit dimension (Optional)
Edit dimension for smaller clock size and smaller notification icon size
Open res/values/dimens.xml and find code to edit
For clock size. Mine is 9.0sp:
Code:
<dimen name="status_bar_clock_size">11.5sp</dimen>
For clock padding. Mine is 2.0dp
Code:
<dimen name="status_bar_clock_end_padding">3.0dip</dimen>
Code:
<dimen name="status_bar_clock_starting_padding">3.0dip</dimen>
For notification icon size. Mine is 10dp:
Code:
<dimen name="status_bar_icon_size">13.0dip</dimen>
You can edit another dimensions like status_bar_notification_icon_padding for notification icon padding, status_bar_padding_start for statusbar padding...
Recompile APK and use it. Again, dont forget to run "adb shell settings put system status_bar_show_notification_icon 1" from CMD
Problem fixing:
1. For one who facing problem with pip_dismiss_scrim.9.png when recompiling, download attachment below, unzip it and override exist one
2. Statusbar missing after reboot:
- Open both original MiuiSystemUI.apk and recompiled MiuiSystemUI.apk in winrar.
- Replace classes.dex from new apk to original one
- Replace status_bar.xml from new apk to original one
- Replace resources.arsc from new apk to original only if you modify dimens
- Use the original with replaced files
Thanks for reading. Any idea/comments would be appriciated
Bonus: Here my mod for Mi8 SE using 8.9.20 ROM. Backup and flash via twrp:
https://drive.google.com/file/d/1Huq9zcHtOHs9bQL80U8ikqaW-fLCEEXC/view
Thanks for your great tutorial.
Guml3y said:
Thanks for your great tutorial.
Click to expand...
Click to collapse
You're welcome
I'm trying to apply it on MI 8 SE (sirius) w/o success
I'm a beginner...could you pls check my steps below
miuisystemui.apk decompiled but I didn't find smali files... I used ui.apk extract fm zip archive downloaded...I need to use the original one on my phone?
lerch82 said:
I'm trying to apply it on MI 8 SE (sirius) w/o success
I'm a beginner...could you pls check my steps below
miuisystemui.apk decompiled but I didn't find smali files... I used ui.apk extract fm zip archive downloaded...I need to use the original one on my phone?
Click to expand...
Click to collapse
You must to decompile using apktool or another, with properly installed framework. MiuiSystemUI.apk from your phone or zip rom for your phone accepted
Thank you for this tutorial!!
But i've and error with the pip_dismiss_scrim.9.png
This is the error i got with original MiuiSystemUI.apk recompile:
Code:
W: ERROR: 9-patch image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png malformed.
W: No marked region found along edge.
W: Found along left edge.
W: ERROR: Failure processing PNG image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png
So i've replaced the PNG with the one you provided, but now i've another error:
Code:
W: ERROR: 9-patch image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png malformed.
W: Image must be at least 3x3 (1x1 without frame) pixels.
W: ERROR: Failure processing PNG image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png
gulp79 said:
Thank you for this tutorial!!
But i've and error with the pip_dismiss_scrim.9.png
This is the error i got with original MiuiSystemUI.apk recompile:
Click to expand...
Click to collapse
I've updated attachment for this 9-patch. XDA has problem while downloading 9-patch attach directly
Trần Anh VN said:
I've updated attachment for this 9-patch. XDA has problem while downloading 9-patch attach directly
Click to expand...
Click to collapse
All ok now! Thank you!
gulp79 said:
All ok now! Thank you!
Click to expand...
Click to collapse
Glad to hear that
Trần Anh VN said:
You must to decompile using apktool or another, with properly installed framework. MiuiSystemUI.apk from your phone or zip rom for your phone accepted
Click to expand...
Click to collapse
many thanks
Hi! Can i flash bonus file for miui eu stable OEBCNFH??
Thank you very much for mod!!!
One different question!!
What tempered glass do you have? It seems to have great fit. Every one that i bought (cheap ones) was rubbish.
Thanks again
gulp79 said:
Thank you for this tutorial!!
But i've and error with the pip_dismiss_scrim.9.png
This is the error i got with original MiuiSystemUI.apk recompile:
Code:
W: ERROR: 9-patch image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png malformed.
W: No marked region found along edge.
W: Found along left edge.
W: ERROR: Failure processing PNG image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png
So i've replaced the PNG with the one you provided, but now i've another error:
Code:
W: ERROR: 9-patch image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png malformed.
W: Image must be at least 3x3 (1x1 without frame) pixels.
W: ERROR: Failure processing PNG image C:\Users\user\Desktop\ApkTool\ApkTool\MiuiSystemUI\res\drawable-xxhdpi\pip_dismiss_scrim.9.png
Click to expand...
Click to collapse
hellow
change that file by the same name, but change to jpg extension and remove the png
fixed up
regards
---------- Post added at 12:51 PM ---------- Previous post was at 12:48 PM ----------
thanks man:
we will use it, as long as the Chinese do not fix it
a greeting
lmj2261 said:
Hi! Can i flash bonus file for miui eu stable OEBCNFH??
Click to expand...
Click to collapse
Not sure but you can try
ageloskalp said:
Thank you very much for mod!!!
One different question!!
What tempered glass do you have? It seems to have great fit. Every one that i bought (cheap ones) was rubbish.
Thanks again
Click to expand...
Click to collapse
Try to find full glue tempered glass with black border. They call 5D, 6D...
Like this
Can you make a flashable zip for lastest stable eu?
Thanks in advance.
(Em cảm ơn)
any direct and easy flashable zip available. just download and flash over twrp on xiaomi.eu stable rom?
thanhnvt194 said:
Can you make a flashable zip for lastest stable eu?
Thanks in advance.
(Em cảm ơn)
Click to expand...
Click to collapse
Plabon7 said:
any direct and easy flashable zip available. just download and flash over twrp on xiaomi.eu stable rom?
Click to expand...
Click to collapse
Finding a way to make a flashable zip which work for all devices, all version of rom. Not sure I can right now
Seem like android P for mi 8 has a little bit different. Waiting for update
Code:
.method public hideNotificationIconArea(Z)V
.locals 1
invoke-static {}, Lcom/android/systemui/Util;->isNotch()Z
move-result v0
if-nez v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;
invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->animateHide(Landroid/view/View;Z)V
:cond_0
return-void
.end method
I have installed the zip file but only 3 points appear in the notification bar, do not see the icons
What should I do to finish seeing the icons in the notification bar and thanks for this help