[GUIDE][MIUI12] Bring back blur to MIUI 12 - Redmi 7A Guides, News, & Discussion

How to enable the blur effects on MIUI 12
If you have a low-end device, you probably noticed the gray background color on your control center and notification shade. Let's bring back the glorious blur effect by patching MiuiSystemUI.apk.
Prerequisites:
adb
smali/baksmali
zip
a tool to decompile .apk file
Custom Recovery
Common knowledge. I'm not responsible if you bricked your device or caused a thermonuclear war.
### Prepare the tools needed.
Install the tools required for this operation. Use your favorite distro's package manager to install it or clone it from its github repository.
### Pull MiuiSystemUI.apk from your device
Bash:
$ adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk .
The command above will copy the apk file to the current directory. It's recommended to create a backup. We will be overwriting it later.
### Decompile or Extract the APK
Decompile the APK with your favorite tool. I will use MT Manager, an android application, for this. Go to the extracted folder. It should contain:
assets/
kotlin/
META-INF/
res/
AndroidManifest.xml
classes.dex
resources.arsc
### Disassemble classes.dex
Disassemble it by:
Bash:
$ baksmali d classes.dex
This command should create the out/ folder. It will contain all the .smali files extracted from classes.dex.
Go inside the out/ folder.
### Editing .smali files to enable blur
This is the important part. There are two files we need to edit. The ControlPanelWindowManager.smali that will enable the blur on the control center and StatusBarWindowManager.smali that will enable the blur on the notification shade.
1. Open com/android/systemui/miui/statusbar/phone/ControlPanelWindowManager.smali with your favorite text editor.
2. Find the applyBlurRatio() method. It should be on line 101 to 148. Then change the whole function to:
Code:
.method private applyBlurRatio(F)V
.registers 5
.line 180
invoke-virtual {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->hasAdded()Z
move-result v0
if-eqz v0, :cond_2b
.line 181
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "setBlurRatio: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "ControlPanelWindowManager"
invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 182
iget-object v0, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;
iget-object v1, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mControlPanel:Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowView;
invoke-virtual {v1}, Landroid/widget/FrameLayout;->getViewRootImpl()Landroid/view/ViewRootImpl;
move-result-object v1
const/4 v2, 0x0
invoke-static {v0, v1, p1, v2}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V
.line 183
invoke-direct {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->apply()V
:cond_2b
return-void
.end method
3. Save it.
4. Open com/android/systemui/statusbar/phone/StatusBarWindowManager.smali with your favorite text editor.
5. Find the applyBlurRatio() method. It should be on line 294 to 341. Then change the whole function to:
Code:
.method private applyBlurRatio(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V
.registers 6
.line 320
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mStatusBarView:Landroid/view/ViewGroup;
invoke-virtual {v1}, Landroid/view/ViewGroup;->getViewRootImpl()Landroid/view/ViewRootImpl;
move-result-object v1
iget v2, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F
const/4 v3, 0x0
invoke-static {v0, v1, v2, v3}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V
.line 323
iget-object p0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mBlurRatioListeners:Ljava/util/List;
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p0
:goto_14
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_26
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;
.line 324
iget v1, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F
invoke-interface {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;->onBlurRatioChanged(F)V
goto :goto_14
:cond_26
return-void
.end method
6. Save it.
### Assemble .smali files back to classes.dex
Inside out/ folder. Execute the command below to assemble all smali files back to classes.dex
Bash:
$ smali a . -o classes.dex
This should create a new classes.dex on the current directory.
### Build a new MiuiSystemUI.apk
Move or copy the compiled classes.dex to the extracted MiuiSystemUI.apk. This should replace the old one. Then delete the out/ folder. We don't need it anymore. Create a new MiuiSystemUI.apk by:
Bash:
$ zip -r MiuiSystemUI.apk assets/ kotlin/ META-INF/ res/ AndroidManifest.xml classes.dex resources.arsc
### Push the new MiuiSystemUI.apk
Go to your custom recovery, mount /system, then push the modified MiuiSystemUI.apk. Note that if you're rooted with Magisk, you can create a magisk module instead.
This will overwrite the default or stock MiuiSystemUI.apk so make sure you made a backup before doing this.
Bash:
$ adb push MiuiSystemUI.apk /system/priv-app/MiuiSystemUI/
### Finish!
Reboot.
PS.
This is my first contribution so go easy on me.
PPS.
Your warranty is now void. I'm not responsible if you bricked your device. You are choosing to make this modifications.
PPPS.
Another method of enabling blur using apktool.

Worked on my Redmi Note 8T with MIUI Global 12.0.3.0. Thanks A LOT!

HitFan said:
Worked on my Redmi Note 8T with MIUI Global 12.0.3.0. Thanks A LOT!
Click to expand...
Click to collapse
Can you help me if I give you the miuisystemui apk? I don't have access to laptop or pc, will you please help me?

HitFan said:
Worked on my Redmi Note 8T with MIUI Global 12.0.3.0. Thanks A LOT!
Click to expand...
Click to collapse
please make a video how it works.. i have the same phone and the same version.

Godspeed999 said:
Can you help me if I give you the miuisystemui apk? I don't have access to laptop or pc, will you please help me?
Click to expand...
Click to collapse
Here you go it's for Redmi Note 8T Miui 12.0.3.0 Global

Ahsene said:
please make a video how it works.. i have the same phone and the same version.
Click to expand...
Click to collapse
Here's video:

anyone can help me? i dont know how to do the process and i want the apk file or magisk module link for miui 12.0.5 ginkgo global please

HitFan said:
Here's video:
Click to expand...
Click to collapse
I am not able to convert the smali files back to classes.dex, can you help me out by telling me exactly what you did? Thanks in advance

ilovecookieee said:
How to enable the blur effects on MIUI 12
If you have a low-end device, you probably noticed the gray background color on your control center and notification shade. Let's bring back the glorious blur effect by patching MiuiSystemUI.apk.
Prerequisites:
adb
smali/baksmali
zip
a tool to decompile .apk file
Custom Recovery
Common knowledge. I'm not responsible if you bricked your device or caused a thermonuclear war.
### Prepare the tools needed.
Install the tools required for this operation. Use your favorite distro's package manager to install it or clone it from its github repository.
### Pull MiuiSystemUI.apk from your device
Bash:
$ adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk .
The command above will copy the apk file to the current directory. It's recommended to create a backup. We will be overwriting it later.
### Decompile or Extract the APK
Decompile the APK with your favorite tool. I will use MT Manager, an android application, for this. Go to the extracted folder. It should contain:
assets/
kotlin/
META-INF/
res/
AndroidManifest.xml
classes.dex
resources.arsc
### Disassemble classes.dex
Disassemble it by:
Bash:
$ baksmali d classes.dex
This command should create the out/ folder. It will contain all the .smali files extracted from classes.dex.
Go inside the out/ folder.
### Editing .smali files to enable blur
This is the important part. There are two files we need to edit. The ControlPanelWindowManager.smali that will enable the blur on the control center and StatusBarWindowManager.smali that will enable the blur on the notification shade.
1. Open com/android/systemui/miui/statusbar/phone/ControlPanelWindowManager.smali with your favorite text editor.
2. Find the applyBlurRatio() method. It should be on line 101 to 148. Then change the whole function to:
Code:
.method private applyBlurRatio(F)V
.registers 5
.line 180
invoke-virtual {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->hasAdded()Z
move-result v0
if-eqz v0, :cond_2b
.line 181
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "setBlurRatio: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "ControlPanelWindowManager"
invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 182
iget-object v0, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;
iget-object v1, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mControlPanel:Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowView;
invoke-virtual {v1}, Landroid/widget/FrameLayout;->getViewRootImpl()Landroid/view/ViewRootImpl;
move-result-object v1
const/4 v2, 0x0
invoke-static {v0, v1, p1, v2}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V
.line 183
invoke-direct {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->apply()V
:cond_2b
return-void
.end method
3. Save it.
4. Open com/android/systemui/statusbar/phone/StatusBarWindowManager.smali with your favorite text editor.
5. Find the applyBlurRatio() method. It should be on line 294 to 341. Then change the whole function to:
Code:
.method private applyBlurRatio(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V
.registers 6
.line 320
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mStatusBarView:Landroid/view/ViewGroup;
invoke-virtual {v1}, Landroid/view/ViewGroup;->getViewRootImpl()Landroid/view/ViewRootImpl;
move-result-object v1
iget v2, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F
const/4 v3, 0x0
invoke-static {v0, v1, v2, v3}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V
.line 323
iget-object p0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mBlurRatioListeners:Ljava/util/List;
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p0
:goto_14
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_26
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;
.line 324
iget v1, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F
invoke-interface {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;->onBlurRatioChanged(F)V
goto :goto_14
:cond_26
return-void
.end method
6. Save it.
### Assemble .smali files back to classes.dex
Inside out/ folder. Execute the command below to assemble all smali files back to classes.dex
Bash:
$ smali a . -o classes.dex
This should create a new classes.dex on the current directory.
### Build a new MiuiSystemUI.apk
Move or copy the compiled classes.dex to the extracted MiuiSystemUI.apk. This should replace the old one. Then delete the out/ folder. We don't need it anymore. Create a new MiuiSystemUI.apk by:
Bash:
$ zip -r MiuiSystemUI.apk assets/ kotlin/ META-INF/ res/ AndroidManifest.xml classes.dex resources.arsc
### Push the new MiuiSystemUI.apk
Go to your custom recovery, mount /system, then push the modified MiuiSystemUI.apk. Note that if you're rooted with Magisk, you can create a magisk module instead.
This will overwrite the default or stock MiuiSystemUI.apk so make sure you made a backup before doing this.
Bash:
$ adb push MiuiSystemUI.apk /system/priv-app/MiuiSystemUI/
### Finish!
Reboot.
PS.
This is my first contribution so go easy on me.
PPS.
Your warranty is now void. I'm not responsible if you bricked your device. You are choosing to make this modifications.
Click to expand...
Click to collapse
(Sorry for the dumb question )Is there any way to push the apk without root and custom recovery?

sudo_s said:
(Sorry for the dumb question )Is there any way to push the apk without root and custom recovery?
Click to expand...
Click to collapse
Probably not man , you need admin permissions and for that you either need a rooted device or custom recovery. BTW i tried this whole thing and it didnt work( Redmi 8a). Whats your device?

Tech x 125 said:
Probably not man , you need admin permissions and for that you either need a rooted device or custom recovery. BTW i tried this whole thing and it didnt work( Redmi 8a). Whats your device?
Click to expand...
Click to collapse
Mine is Redmi note 10,
Tech x 125 said:
Probably not man , you need admin permissions and for that you either need a rooted device or custom recovery. BTW i tried this whole thing and it didnt work( Redmi 8a). Whats your device?
Click to expand...
Click to collapse
That's what I thought, guess I've to wait till my bootloader gets unlocked. Mine is Redmi Note 10

gomeeez11 said:
anyone can help me? i dont know how to do the process and i want the apk file or magisk module link for miui 12.0.5 ginkgo global please
Click to expand...
Click to collapse
I have the magisk module for redmi note 8 Global 12.0.3, I hope I helped!

Can You Please Post The Apk For The Xiaomi Redmi Note 10 ?
The global version miui 12.0.10

batamam said:
I have the magisk module for redmi note 8 Global 12.0.3, I hope I helped!
Click to expand...
Click to collapse
Please patch and made a magisk mofule for me. Redmi Note 9

shawkath646 said:
Please patch and made a magisk mofule for me. Redmi Note 9
Click to expand...
Click to collapse
Doing that for you, reaching you back when I'm done

Thank you so much for your tutorial! Worked like a charm.
For those who want it, here's my patched MiuiSystemUI.apk for the Redmi Note 8T EEA [12.0.3].
[UNTESTED ON OTHER VERSIONS/PHONES, BE SURE TO BACKUP YOUR ORIGINAL]

shawkath646 said:
Please patch and made a magisk mofule for me. Redmi Note 9
Click to expand...
Click to collapse
Here it is, no need for the oat folder. Just replace this in recovery mode and you're good to go.

Rigby103_epic said:
Here it is, no need for the oat folder. Just replace this in recovery mode and you're good to go.
Click to expand...
Click to collapse
I thank you too much, I am the owner of the same terminal, but I still do not understand how to pass the file to the file if the system is in read mode, please notify the person who requested the patch if It really worked for him
Also, I wish I could do the same with my own hands, would you be so kind as to attach a folder with all the necessary files? If it is not much annoying, I await your answer, greetings

Rigby103_epic said:
Doing that for you, reaching you back when I'm done
Click to expand...
Click to collapse
Can you make one for Redmi 9C?

Thel_Vadam said:
I thank you too much, I am the owner of the same terminal, but I still do not understand how to pass the file to the file if the system is in read mode, please notify the person who requested the patch if It really worked for him
Also, I wish I could do the same with my own hands, would you be so kind as to attach a folder with all the necessary files? If it is not much annoying, I await your answer, greetings
Click to expand...
Click to collapse
You gotta go into recovery, file manager and then go to system/priv-app/MiuiSystemUI and replace the apk in there ^^

Related

[REF] How to add Reboot to power menu (updated 10/21/2010)

this is the final method that will add reboot,recovery and download options
to the power menu updated 10/21/2010
============================================================
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 stock JI6 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_recovery">Recovery</string>
<string name="reboot_download">Download</string>
<string name="reboot">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 "10403c2" sometimes
the id's are out of order so search for "10403c2 + 1" or "10403c3"
if the next id is unused then we can start assigning id's to the strings
we added.
Code:
<public type="string" name="reboot_recovery" id="0x010403c3" />
<public type="string" name="reboot_download" id="0x010403c4" />
<public type="string" name="reboot" id="0x010403c5" />
now is a good time to add the image resources so add your icons to
"res\drawable-hdpi"
and assign id's to them the same way we did for the strings
in this example, using the example icons in the zip file I had
Code:
<public type="drawable" name="reboot" id="0x010803aa" />
<public type="drawable" name="recovery" id="0x010803ab" />
<public type="drawable" name="download" id="0x010803ac" />
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 Samsung'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
add this to line 37
Code:
.field public static mReboot:I
then in method run at line 1463 add this code before "invoke-static {}, Landroid/os/Power;->shutdown()V"
Code:
sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
const/4 v2, 0x1
if-eq v1, v2, :reboot
const/4 v2, 0x2
if-eq v1, v2, :rebootRecovery
const/4 v2, 0x3
if-eq v1, v2, :rebootDownload
then after this code on about line 1477
Code:
.line 531
invoke-static {}, Landroid/os/Power;->shutdown()V
.line 532
return-void
add this code
Code:
:reboot
const-string v4, "now"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
:rebootRecovery
const-string v4, "recovery"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
:rebootDownload
const-string v4, "download"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
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.smali"
the first thing that we need to do is increase the array length by 3
so in method createDialog on line 431 change this
Code:
const/4 v0, 0x3
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
to this
Code:
const/4 v0, 0x6
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 on line 457 after "aput-object v2, v0, v1"
add this code
Code:
const/4 v1, 0x3
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
const v3, 0x10803aa # reboot icon resource id
const v4, 0x10403c5 # 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
aput-object v2, v0, v1
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
const v3, 0x10803ab # recovery icon resource id
const v4, 0x10403c3 # recovery string resource id
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
const v3, 0x10803ac # download icon resource id
const v4, 0x10403c4 # download string resource id
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
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
with GlobalActions$7 then add this code to line 52 before
"invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
Code:
const/4 v2, 0x1
sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
save and close
copy GlobalActions$3.smali and name it GlobalActions$8.smali
open GlobalActions$8 and replace all instances of GlobalActions$3
with GlobalActions$8 then add this code to line 52 before
"invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
Code:
const/4 v2, 0x2
sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
save and close
copy GlobalActions$3.smali and name it GlobalActions$9.smali
open GlobalActions$9 and replace all instances of GlobalActions$3
with GlobalActions$9 then add this code to line 52 before
"invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
Code:
const/4 v2, 0x3
sput v2, 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.
Anyway to get this in a flashable zip? I don't know how to decompile files
BabyBoi.JN said:
Anyway to get this in a flashable zip? I don't know how to decompile files
Click to expand...
Click to collapse
bump Bump bump please
Nice
Sent from my vibrant
BabyBoi.JN said:
Anyway to get this in a flashable zip? I don't know how to decompile files
Click to expand...
Click to collapse
I second that. I miss that option
where is policy file
how to decompile
i use ubuntu
thx
Sent from my SGH-T959 using XDA App
sounds like a great add-in if could be made flashable
adm1jtg said:
sounds like a great add-in if could be made flashable
Click to expand...
Click to collapse
Either that or a how to for dummies version
Sent from Vibrant Frankin Twiz Update3 JI2 modem.bin jac kernel with voodoo lagfix on XDA app with no fc's FINALLY!
daddysays said:
Either that or a how to for dummies version!
Click to expand...
Click to collapse
EXACTLY!!! That's what I need LOL
untermensch said:
someone asked for this so here it is.
decompile android.policy
make a copy of GlobalActions$3.smali and name it to GlobalActions$7.smali open GlobalActions$7.smali
and replace all instances of GlobalActions$3 with GlobalActions$7
replace method onPress with this
Code:
.method public onPress()V
.registers 3
const-string v0, "Reboot Now"
invoke-static {v0}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
.end method
save and close
now open GlobalActions.smali
and in method createDialog
the first thing that we need to do is increase the array length by 1 so find this
Code:
const/4 v0, 0x3
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
and change to
Code:
const/4 v0, 0x4
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
next we add the new menu item so on line 457 we add this next bit of code after "aput-object v2, v0, v1"
Code:
const/4 v1, 0x3 # position in the menu array
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
const v3, 0x1080030 # power icon
const v4, 0x10402af # reboot string
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
framework-res already has a string for reboot so no modifications are needed to framework-res
save and close then compile android.policy
Click to expand...
Click to collapse
Hi,
Thanks so much for this, absolutely fantastic work like always!
For anyone that doesn't know how to decompile/compile apk files search for either APK Manager, or smali/baksmali tutorial/help/etc., it should help you out greatly.
And for those that want a flashable .zip, well, here you go, BUT, I'm lazy, so it requires some conditions:
1) You use a rom based on JI6 that's fully deodexed
2) you have previously flashed (or your custom rom included) the epic/puzzle lockscreen mod (also from untermensch)
3) You disable voodoo (if you use it) prior to flashing since this zip attempts to wipe your dalvik-cache
That said, zip should flash fine from clockwork, and all it does is replace your android.policy.jar with one pre-modded for lockscreen & reboot option support, and it wipes your dalvik-cache since that's the safest thing to do after applying any mod, period.
Cheers, =)
s0niqu3 said:
Hi,
Thanks so much for this, absolutely fantastic work like always!
For anyone that doesn't know how to decompile/compile apk files search for either APK Manager, or smali/baksmali tutorial/help/etc., it should help you out greatly.
And for those that want a flashable .zip, well, here you go, BUT, I'm lazy, so it requires some conditions:
1) You use a rom based on JI6 that's fully deodexed
2) you have previously flashed (or your custom rom included) the epic/puzzle lockscreen mod (also from untermensch)
3) You disable voodoo (if you use it) prior to flashing since this zip attempts to wipe your dalvik-cache
That said, zip should flash fine from clockwork, and all it does is replace your android.policy.jar with one pre-modded for lockscreen & reboot option support, and it wipes your dalvik-cache since that's the safest thing to do after applying any mod, period.
Cheers, =)
Click to expand...
Click to collapse
I was just about to upload the zip...
Oh well, beat me to it
s0niqu3 said:
Hi,
Thanks so much for this, absolutely fantastic work like always!
For anyone that doesn't know how to decompile/compile apk files search for either APK Manager, or smali/baksmali tutorial/help/etc., it should help you out greatly.
And for those that want a flashable .zip, well, here you go, BUT, I'm lazy, so it requires some conditions:
1) You use a rom based on JI6 that's fully deodexed
2) you have previously flashed (or your custom rom included) the epic/puzzle lockscreen mod (also from untermensch)
3) You disable voodoo (if you use it) prior to flashing since this zip attempts to wipe your dalvik-cache
That said, zip should flash fine from clockwork, and all it does is replace your android.policy.jar with one pre-modded for lockscreen & reboot option support, and it wipes your dalvik-cache since that's the safest thing to do after applying any mod, period.
Cheers, =)
Click to expand...
Click to collapse
You sir are a gentleman and a scholar
b0ricuaguerrero said:
You sir are a gentleman and a scholar
Click to expand...
Click to collapse
lol,
Appreciate the thought, but wrong gender, =)
b0ricuaguerrero said:
You sir are a gentleman and a scholar
Click to expand...
Click to collapse
LOL perhaps you meant you maam are a babe and a diva. Either way thanks so much for this.
Very nice, thank's for sharing.
Looks like I'm disabling Voodoo once again.
great job. done
Sent from my SGH-T959 using XDA App
Fyi the reboot after install takes longer than after installing a new rom
Sent from my SGH-T959
Many thanks for the file!
...but because I'm lazy and if I'm reading the file poster's req's correctly her version requires I flash a lockscreen I don't currently have, would any Gentleman or Lady be kind enough to build a .zip file which will work on a Stock Vibrant JI6 install?
Thnx!
I just got done flashing and it works great ty
Sent from bionix 1.9.1 jacs oc/uv vodoo kernel

[Guide]Official MIUI Port Guide Translation

Hi guys,i translated the key part of this guide,untill now,this guide is not completed ,if it updated ,i'll update this thread too
and until now,our MIUI PORT TEAM have these guys:
me,gabwerkz,redy2006
N00BY0815 and SquaDrive after read this post and if you want to join in plz let me know anyone else wants to join in are welcomed
===========================================line
1.A Sample For Smali
imagane that there's a Hello worlk application,we install the apk and open it,we can see a blackscreen and at the first line written:Hello world!
ok,this is a simple app.now we decompile it.
===================
we get a folder,then find the HelloActivity.smali,there's its content:
Code:
.class public Lcom/example/android/helloactivity/HelloActivity;
.super Landroid/app/Activity;
.source "HelloActivity.java"
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 27
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
return-void
.end method
# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
.locals 2
.parameter "savedInstanceState"
.prologue
.line 33
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
.line 37
const/high16 v1, 0x7f03
invoke-virtual {p0, v1},
Lcom/example/android/helloactivity/HelloActivity;->setContentView(I)V
.line 38
const/high16 v1, 0x7f05
invoke-virtual {p0, v1},
Lcom/example/android/helloactivity/HelloActivity;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
.line 39
.local v0, txtView:android/widget/TextView;
const/high16 v1, 0x7f04
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V
.line 40
return-void
.end method
"#" refers to notes.
begin with a dot named "annotations".
".line" means line number,it mainly used for debug.
.metho and .end method means a method's starting and endding.
more code plz goto http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
now we want to change the "Hello,world!" into "Happy,Craker!",what should we do?
in this smali
.lne 39 is
Code:
.local v0, txtView:android/widget/TextView;
const/high16 v1, 0x7f04
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V
and actually the source code is
Code:
txtView.setText(R.string.hello_activity_text_text)
here we can see it define a textview with R.string.hello_activity_text_text ,and i guess the string "Hello world!" is in it.
now we could not change the string,but we can replace it by change it directly
but how we do it in smali?
here we go
Code:
.line 39
.local v0, txtView:android/widget/TextView;
const-string v1, "Happy, Cracker!"
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
ps.i can't explane it more clearly,but we can see we replace the id with our string.
==========================
2.Porting MIUI Framework
Before starting i should tell us :all porting is based on deodexed files.and there's a stock android rom and miui rom to show you a example to understand how we make the porting work.
the main idea is change the smali code to port it.cause we can't get the souce code of miui,and by this way we can port it to our phone too.
the three files we should touch is :framework.jar ,android.policy.jar andservices.jar.they are the "core" of android system
there's an attach file download and open it we can see:
porting-miui/
|-----------------android
|------------framework.jar
|------------services.jar
|------------android.policy.jar
|------------------miui
|----------framework.jar
|----------services.jar
|----------android.policy.jar
|-----------framework-res/
|-----------framework-miui-res.apk
the android folder is from stock android ,miui folder is miui's files,and we need your phone's files here too.and in this guide we assume your phone is I9100.now we should decompile all of them and compare,to "patch" miui things to your phone.
that means ,we need to compare stock files with our files,compare stock files with miui files
i.porting resources
decompile framework-res.apk,all the resources in miui we need porting to our rom,so copy them to your compiled framework-res folder and then recompile it.
framework-miui-res.apk is a resouces package,all the miui apps need it.in our rom we can find RES_cappuccino.apk,RES_sui.apk and RES_model.apk.
usually miui's resource's id is started with 0x03,and the stock rom has two resouce package,framework-res.apk is started with 0x01 and another is started with 0x02.so if your phone has more than two package,you need contact with us.in the future we'll considering make the resouce's id started with 0x06 in miui.
ii.after we finish the decompile we can use the script rmline.sh to delete all the lines started with .line to make us more easier to compare the difference with two smali code.but backup the original decomplied files first plz.we can debug from it.
then,if you based on linux,you'd try meld to compare,if you are on windows,use beyoun compare
between stock and miui,we can see there's a lot of new classes which started with Miui,and a new miui folder,just copy those new files and folders to our stock folders(with .line)
in the attach file,there's a change-list file,which list what miui did change.maybe it's a little different with what we compared by ourselves,but it's nop (dummy instruction),it caused by apktool,so we don't need to care it,just compare listed files.
there are 3 solutions
1.ex. ActivityThread.smali,miui changed the method "getTopLevelResources",but i9100's and stock is the same,this is the easiest situation and we can replace the miui code into our files happily
2.also in ActivityThread.smali,miui changed the another method "applyConfigurationToResourcesLocked",and after comparation,we can see miui changed this method,so i9100 does.then what should we do?let's see the miui's code first
Code:
.method final applyConfigurationToResourcesLocked(Landroid/content/res/Configuration;)Z
invoke-virtual {v5, p1}, Landroid/content/res/Configuration;->updateFrom(Landroid/content/res/Configuration;)I
move-result v0
.local v0, changes:I
invoke-static {v0}, Landroid/app/MiuiThemeHelper;->handleExtraConfigurationChanges(I)V
invoke-virtual {p0, v7}, Landroid/app/ActivityThread;->getDisplayMetricsLocked(Z)Landroid/util/DisplayMetrics;
move-result-object v1
.local v1, dm:Landroid/util/DisplayMetrics;
at line 5 is what miui changed.before that,we should know some rule about smali
all the local variable is started with "v"
.locals 8 means this method use 8 local variables.
all the parameters are started by "p".and local variable and parameters started from 0.for all the nonstatic method,p0 means itself,i.e "this" pointer.
here we can see miui added a new static method,the code like this we call it linear code.it as one entry and one exit.and in compiler it called basic block.
so we just need to copy this block and paste into 9100's files at the same position,and we done.
3.for example,in Resources.smali,miui changed the "loadDrawable" method.here's the code
Code:
.method loadDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
.end local v8 #e:Ljava/lang/Exception;
.end local v13 #rnf:Landroid/content/res/Resources$NotFoundException;
:cond_6
invoke-virtual/range {p0 .. p2},
Landroid/content/res/Resources;->loadOverlayDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
move-result-object v6
if-nez v6, :cond_1
:try_start_1
move-object/from16 v0, p0
from line 6 to line 9 is what miui added.then we compare 9100 and stock android,we can find it's totally different.then how should we do now?
the key is find the added code's entry and exit.
at line 4 we see a ":cond_6",it says there should be a goto command to this :cond_6.so we got to find where used the :cond_6 and we finally got this:
Code:
const-string v15, ".xml"
invoke-virtual {v9, v15}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v15
if-eqz v15, :cond_6
read this code block carefully,and seems it is check if the string "v9" is ending with ".xml",if not,goto :cond_6 .ok ,let's go to see 9100's framework.
so we search ".xml" in the loadDrable method.find this:
Code:
const-string v17, ".xml"
move-object v0, v10
move-object/from16 v1, v17
invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v17
if-eqz v17, :cond_b
the logic is same as which in miui hmm?so goto :cond_b ,what we can see is totally same as miui's :cond_6 right? so we are sure this is where miui changed
look at the exit,miui has two exit point
one is if-nez v6, :cond_1 ,if so,goto :cond_1,if not,go on.so let's see what the :cond_1 did
here's cond_1's code
Code:
:cond_1
:goto_1
if-eqz v6, :cond_2
move-object/from16 v0, p1
iget v0, v0, Landroid/util/TypedValue;->changingConfigurations:I
and in 9100's file we can find this
Code:
:cond_1
:goto_1
if-eqz v7, :cond_2
move-object/from16 v0, p1
iget v0, v0, Landroid/util/TypedValue;->changingConfigurations:I
this time it check the v7's value,so we should add this into 9100
Code:
invoke-virtual/range {p0 .. p2},
Landroid/content/res/Resources;->loadOverlayDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
move-result-object v7
if-nez v7, :cond_1
a little dizzy hmm?take a break time and go back
iii.and the last we'll talk about inner class.
every inner class have a separete smali file.
e. ActivityThread$1.smali
if it is a Anonymous class,the name should be "outer class+$+number",else it should be "outer class+$+inner class"as its name.
if a inner class use outer class's privte method,the compiler will auto fill a static function like this:
Code:
public class Hello {
public class A {
void func() {
setup();
}
}
private void setup() {
}
we use the outer class's setup method in inner class A's "func" method.and we'll get the smali code:
part of Hello$A.smali
Code:
# virtual methods
.method func()V
.locals 1
.prologue
.line 5
iget-object v0, p0, LHello$A;->this$0:LHello;
#calls: LHello;->setup()V
invoke-static {v0}, LHello;->access$000(LHello;)V
.line 6
return-void
.end method
part of Hello.smali
Code:
.method static synthetic access$000(LHello;)V
.locals 0
.parameter
.prologue
.line 1
invoke-direct {p0}, LHello;->setup()V
return-void
.end method
we can see the compiler auto made a access$000 method,if we use a outer class's private method in a more complicate inner class,it'll made a new method,but every class may have various new class name,it changes a lot .compare it carefully,find the private method and find a name that you ever seened.
iiii.Finally there are some advices:
1.careful,find where to add miui's code
2.notice the local variable number
3.step by step,if you done a part of port,recompile it to see if it work
4.find a problem is not neccessary,use adb logcat and find what caused the problem.
5.more practice and you'll handle the smali code
==================================
because of my bad english ,if you can understand what i mean,plz point me out and i'll correct it as i can
if you think this post may help you,press the thanks button
here's the attachment:
http://www.multiupload.com/I33A07PRTF
For God Sake..
ahahahaha...
My head goin crazy...><..
maybe i need a little walk by learn..
after read those stuff i got fired up..
i want to learn Android from this..
can u guys teaching me little by little??
if so, count me on..i'm ready for testing every single build
and ready to burst my brain to learn this stuff..
SquaDrive said:
For God Sake..
ahahahaha...
My head goin crazy...><..
maybe i need a little walk by learn..
after read those stuff i got fired up..
i want to learn Android from this..
can u guys teaching me little by little??
if so, count me on..i'm ready for testing every single build
and ready to burst my brain to learn this stuff..
Click to expand...
Click to collapse
just use search...
after i tranlated this guide,i'd say i've understand a part of the "how to",and i'll gonna have a try based on v20n
dxdiag32 said:
after i tranlated this guide,i'd say i've understand a part of the "how to",and i'll gonna have a try based on v20n
Click to expand...
Click to collapse
Nice... and I'm just waiting here for your progress... LOL
Man, you got moves like jagger.
good luck dxdiag
Is there some progress?
Sent from my LG-P970 using XDA App
I would like to help, but I have too work now...
Good luck!
I think Huexxx should start porting MIUI to ours blacks xd His rom is good at this moment so he can make some break and create MIUI
doooh !
I really would offer my help but the only dev related thing I know is scripting with nsis. I don't know coding even if I'm pretty sure scripting and coding have similar principles. I don't even know what deodexing / zipaligning mean
As I learned everything by myself I know that all guides can't do 100% of the job. Learning is the key.
So I'm not sure if I can contribute but it will be a pleasure to join to your work.
Any news guys ?
Sent from my LG-P970 using xda premium

[guide] adding 14 statusbar toggles to samsung galaxy y duos, y pro duos & ace duos

[guide] adding 14 statusbar toggles to samsung galaxy y duos, y pro duos & ace duos
RATIONALE
When i set out to cook to cook my first and currently only custom rom for my first and currently only android device, i realised that porting those beautiful 14 statusbar toggles to to samsung galaxy y pro duos was not as easy as the original guide by xda member Lidroid and it's variants portrayed. i spent nearly two weeks searching and trying without success until i got some support from XDA-developers recognised contributer, Millan.sis. Together we were able to port the toggles to galaxy y pro duos. Note that Millan.sis did say Manoranjan2050 or so i think, was the first to port the statusbar toggles to the duos based phones.
having come across yet another person struggling for nearly two weeks to port these toggles to samsung galaxy ace duos, i decided to write a guide or more accurately modify the standard guide by lidroid to make it applicable on samsung galaxy dual sim based phones i n the hope that many more people will come out and cook more custom roms for these devices.
ACKNOWLEDMENTS
If you find this guide useful, you should perhaps thank me, but never forget to thank these people too. for without them this guide would never have come into existence
Lidroid for the original guide
Millan.sis for for being the first to port these toggles into duos phones providing me with the codes
Kundal for glaxy y duos codes
DISCLAIMER
In my experience, the worst that may happen to your phone if you mod your SystemUI.apk is that you loose your statusbar, a situation you can always recover from by replacing modded SystemUI.apk unmodded SystemUI.apk.
All these same, you are modding your SystemUI.apk at your own risk. I am not responsible for any damage that may come to your phone as a result of you using this guide, the original guide by lidroid or any of the tools mentioned in this guide.
THINGS YOU WILL NEED
Linux users
apk-tool, F-J Apk-tool or equivalent
patience and some common sense
windows users
Notepad++ or equivalent
apk-tool or apk-manager and their equivalents
patience and some common sense
Mac users
i'm sorry i can't help you as i have never owned a mac before but if you can get a tool capable of compiling and decompiling apk files, then you can adapt this guide to your own needs.
All OS users
Deodexed SystemUI.apk (smali files are only found in deodexed apps)
Read the original guide by Lidroid here and download Lidroid-res.apk, LidroidSystemUI.apk and QuickPanelSettings.apk
android sdk (optional) to give you adb support is not a bad idea since you will be able to directly push your finished work into the appropriate directories and reboot your phone to enjoy your toggles. Link is here
Dsixda's android kitchen (optional) for deodexing your stock rom and for signing. link is here
Batch auto apk modding tool for all OS platforms is available here
Link to apk-manager for both linux and windows is here
Step by step guide
METHOD
make sure you keep copies of the apks you are about to modify... just in case
[*]setup your apk-tool of choice
i am assuming, for the rest of this guide, that each of your apks is decompiled into a folder called 'working'
[*]
Place the LidroidSystemUI.apk into the 'in' or 'original-apk' folder of your apk-tool/manager
Decompile the LidroidSystemUI.apk and rename the created 'working' folder to say 'LidroidSystemUI'
Now place your SystemUI.apk into the 'in' or 'original-apk' folder of your apk-tool/manager and decompile it
do not rename the 'working' folder created for SystemUI.apk since we will recompile it later
Now open/browse the folder(directory) LidroidSystemUI/smali/com and copy the folder called lidroid
browse to working folder for SystemUI.apk, open working/smali/com and paste the lidroid folder from the previous step into this folder (com).
you should now have two folders (directories) called 'android' and 'lidroid' within working/smali/com of your decompiled SystemUI.apk folder(directory)
take a five-minute break if you are getting nervous
open the working folder of your decompiled SystemUI.apk from above and browse to working/smali/com/android/systemui/statusbar
you should find a bunch of smali files and two folders called 'policy' and 'quickpanel'
locate the file called 'StatusBarService.smali' and open it with the linux text editor of your choice.
if you are on windows OS, then you should use notepad++ for this.
repeat, you should use notepad++ and not notepad or wordpad etc
hit Ctrl+F on your keyboard to open the search window in your text editor.
type the following, of course without quotes, '.line 405' and hit enter key on keyboard
or instead, you may just read through the entire document until you come to .line 405
replace the following block of text (Galaxy y pro duos and ace duos only) if you use galaxy y duos, see post 8. flashlight code is same for all phones
Code:
.line 405
const/4 v12, 0x0
.line 409
.local v12, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
const v26, 0x7f030002
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
.end local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
check-cast v12, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 411
.restart local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
move-object/from16 v0, p0
with
Code:
.line 405
const/4 v12, 0x0
.line 409
const v26, 0x3030003
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
check-cast v12, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 411
.local v12, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v12}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
move-object/from16 v0, p0
FLASHLIGHT
if your phone does not have flashlight and you want to turn your normal screen into flashlight, then modify the manifest.xml file in the root of your decompiled working folder ie working/manifest.xml to look like this
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:sharedUserId="android.uid.system" android:process="system" android:versionCode="10" android:versionName="2.3.6" package="com.android.systemui"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.STATUS_BAR_SERVICE" />
<uses-permission android:name="android.permission.MANAGE_USB" />
<application android:label="@string/app_label" android:icon="@drawable/ic_launcher_settings" android:allowClearUserData="false" android:persistent="true">
<service android:name=".statusbar.StatusBarService" android:exported="false" />
<activity android:name=".usb.UsbStorageActivity" android:excludeFromRecents="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name="com.android.internal.app.ExternalMediaFormatActivity" android:excludeFromRecents="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbConfirmActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbPermissionActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbResolverActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.IconMenu" android:name=".usb.UsbAccessoryUriActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.lidroid.systemui.quickpanel.FlashlightActivity" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation" />
</application>
</manifest>
Notice i merely added the following line
Code:
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.lidroid.systemui.quickpanel.FlashlightActivity" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation" />
</application>
just before the line starting with </application>.
ensure that in your modified manifest.xml that the start of all the lines with <activity android:............. /> are all in a straight line since the spacing at the beggining of lines is very important.
if the phone has no flashlight and you fail to modify manifest.xml, then you will have a force close problem anytime you tap on flashlight toggle in your statusbar.
Now compile your modded working folder, sign it and push it into your /system/app folder of your phone.
Don't forget to also push lidroid-res.apk into /system/framework directory of your phone.
you may optionally push QuickpanelSettings.apk you downloaded earlier into your /system/app folder.
if you are not sure, how to push them into the appropriate directories on your phone, read the original thread by Lidroid
Reboot your phone and enjoy your modding.
SIGNING YOUR COMPILED APKS
you can use the signing facility that comes with your apk-tool or manager. in my case signing with my apk-tool make my SystemUI.apk to become too big and it also did not work. i had to resign using dsixda's kitchen.
in Dsixda's kitchen menu, choose the advanced option, select option to sign apks and then choose option to sign apks outside working folder
place you compiled SystemUI.apk inside the signed files folder created for you, go back to kitchen's menu and hit enter on our keyboard to sign your file.
TROUBLESHOOTING SECTION
all troubleshooting material will be posted here but first please read the original post by lidroid before complaining or asking questions here.
reserved
Nice!
Sent from my GT-S5360 using XDA
Cool.. now there will be more devs of roms i feel..
hit thanks button! If above post helps you..
Sent from my GT-S6102
nitubhaskar said:
Cool.. now there will be more devs of roms i feel..
hit thanks button! If above post helps you..
Sent from my GT-S6102
Click to expand...
Click to collapse
that is what i am hoping for. we can do with a few more rom.
In the SystemUI.apk of my GT S6102 (Rom XXLH1) the code block to be changed in StatusBarService.smali is at a different place.
It begins with .line 412:
Replace this:
Code:
.line 412
const/4 v12, 0x0
.line 416
.local v12, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
const v26, 0x7f030002
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
.end local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
check-cast v12, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 418
.restart local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
move-object/from16 v0, p0
with:
Code:
.line 412
const/4 v12, 0x0
.line 416
const v26, 0x3030003
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
check-cast v12, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 418
.local v12, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v12}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
move-object/from16 v0, p0
Kundal said:
In the SystemUI.apk of my GT S6102 (Rom XXLH1) the code block to be changed in StatusBarService.smali is at a different place.
It begins with .line 412:
Replace this:
Code:
.line 412
const/4 v12, 0x0
.line 416
.local v12, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
const v26, 0x7f030002
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
.end local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
check-cast v12, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 418
.restart local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
move-object/from16 v0, p0
with:
Code:
.line 412
const/4 v12, 0x0
.line 416
const v26, 0x3030003
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
check-cast v12, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 418
.local v12, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v12}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
move-object/from16 v0, p0
Click to expand...
Click to collapse
Thanks Kundal. I have never decompiled SystemUI.apk for S6102. Galaxy ace duos and y pro duos have same code when I decompiled them. Can someone upload SystemUI.apk of galaxy y duos for? Its handy to have a collection
Sent from my GT-B5512 using Tapatalk 2
thanks for the tutorial.
Can someone upload SystemUI.apk of galaxy y duos for? Its handy to have a collection
Click to expand...
Click to collapse
Here's my deodexed SystemUI.apk from GT S6102 XXLH1 Rom.
Kundal said:
Here's my deodexed SystemUI.apk from GT S6102 XXLH1 Rom.
Click to expand...
Click to collapse
Thanks once again Kundal for uploading. i decompiled you SystemUI.apk and it is as you said. I have also realised that you have had some experience in working with lidroid toggles. can you add a word on say changing the background themes etc
Since i am not sure if SystemUI.apk varies (i don't think so but...) varies with different baseband (firmware) versions, could someone else with a version different from Kundal's upload his SystemUI.apk? once this is done, i will edit my original post and credit Kundal and other uploaders as is appropriate.
I have also realised that you have had some experience in working with lidroid toggles. can you add a word on say changing the background themes etc
Click to expand...
Click to collapse
I heavily modded my SystemUi.apk and framework-res.apk. Basically I used UOT kitchen to get a black transparent background and to change statusbar icons. So far it's not really related to lidroid toggles.
With lidroid I replaced icons in /res/drawable-hdpi of lidroid-res.apk. It's easy to identify the icons you have to replace. They all have names like stat_gps_on.png. To replace icons you only need to open lidroid-res.apk with 7-Zip, navigate to /res/drawable-hdpi and drag your own (properly named) icons there to overwrite the originals.
To change the language of icon descriptions, notifications etc. you'll have to decompile lidroid-res.apk and edit the file /res/values/strings.xml. After recompiling the file I opened the original lidroid-res-apk with 7-Zip and dragged the modified file resources.arsc into it to preserve the signature of the original.
Kundal said:
I heavily modded my SystemUi.apk and framework-res.apk. Basically I used UOT kitchen to get a black transparent background and to change statusbar icons. So far it's not really related to lidroid toggles.
With lidroid I replaced icons in /res/drawable-hdpi of lidroid-res.apk. It's easy to identify the icons you have to replace. They all have names like stat_gps_on.png. To replace icons you only need to open lidroid-res.apk with 7-Zip, navigate to /res/drawable-hdpi and drag your own (properly named) icons there to overwrite the originals.
To change the language of icon descriptions, notifications etc. you'll have to decompile lidroid-res.apk and edit the file /res/values/strings.xml. After recompiling the file I opened the original lidroid-res-apk with 7-Zip and dragged the modified file resources.arsc into it to preserve the signature of the original.
Click to expand...
Click to collapse
thanks. i already changed icon packs and statusbar notification area using UOT. thanks for the info on language of icon discription and how to manually change icons without kitchen
Thanks for this useful post
Hit thanks buttonIf i helped
Kundal said:
In the SystemUI.apk of my GT S6102 (Rom XXLH1) the code block to be changed in StatusBarService.smali is at a different place.
It begins with .line 412:
Replace this:
Code:
.line 412
const/4 v12, 0x0
.line 416
.local v12, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
const v26, 0x7f030002
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
.end local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
check-cast v12, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 418
.restart local v12 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
move-object/from16 v0, p0
with:
Code:
.line 412
const/4 v12, 0x0
.line 416
const v26, 0x3030003
const/16 v27, 0x0
move-object/from16 v0, p1
move/from16 v1, v26
move-object/from16 v2, v27
invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v12
check-cast v12, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 418
.local v12, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v12}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
move-object/from16 v0, p0
Click to expand...
Click to collapse
Ya ur right but one thing its not about ur XXLH1 firmware only.all of galaxy y duos have the same lines
Hit thanks buttonIf I helped
Hey great!
How to mod % battery to replay default icon??
Yeah this is what i was looking for!!
I m fond of modding and this will add to my current project for ace duos ..
u will be all always credited on my thread..
EDIT : DIDNT WORKED
Only added lidroid folder and edited statusbarservice
didnt touched manifiest.xml
recompiled and signed with x-took [ apk tool] and after pushing it didnt worked;
moreover i have modified pngs in systemui.apk earlier , which never created any problem may be because i never decomplied as png are to be replaced only with 7zip.
any way to modifiy ??
Device ; Galaxy ace duos s6802
Re: [guide] adding 14 statusbar toggles to samsung galaxy y duos, y pro duos & ace du
mjp93 said:
Yeah this is what i was looking for!!
I m fond of modding and this will add to my current project for ace duos ..
u will be all always credited on my thread..
EDIT : DIDNT WORKED
Only added lidroid folder and edited statusbarservice
didnt touched manifiest.xml
recompiled and signed with x-took [ apk tool] and after pushing it didnt worked;
moreover i have modified pngs in systemui.apk earlier , which never created any problem may be because i never decomplied as png are to be replaced only with 7zip.
any way to modifiy ??
Device ; Galaxy ace duos s6802
Click to expand...
Click to collapse
Use my tool
http://forum.xda-developers.com/showthread.php?t=2181597
Sent from my A116 using Tapatalk 2
its not working everytime i make this mod i lose my statusbar. currently running on DDMC1 stock rom. can anyone help me out?? the precompiled 14 toggles for stock rom is also not working.

[Req] Sense GPS Crosshair Removal

Hey guys! I'm on stock rooted 4.3 sense 5.0 using Xposed framework + Sense 5 toolbox for all the tweaks/mods (awesome btw for anyone unaware) and I've been looking for a way to get rid of the GPS crosshair in the status bar.
I've only had this phone for about a week but I did some searching for something but was unable to come up with anything. The closest I could find was OMJ's mod pack but to enable that feature, it looks like you have enable a couple other things... plus I believe I'm still odexed.
I'd like to stay stock like I am. Is there an easy way to do this, or have I missed something?
Thanks in advance!
Hixman said:
Hey guys! I'm on stock rooted 4.3 sense 5.0 using Xposed framework + Sense 5 toolbox for all the tweaks/mods (awesome btw for anyone unaware) and I've been looking for a way to get rid of the GPS crosshair in the status bar.
I've only had this phone for about a week but I did some searching for something but was unable to come up with anything. The closest I could find was OMJ's mod pack but to enable that feature, it looks like you have enable a couple other things... plus I believe I'm still odexed.
I'd like to stay stock like I am. Is there an easy way to do this, or have I missed something?
Thanks in advance!
Click to expand...
Click to collapse
If you like stock so much then flash the stock deodexed Rom , problem solved
sent from my Sprint HTC ONE using Tapatalk 4
olorolo said:
If you like stock so much then flash the stock deodexed Rom , problem solved
sent from my Sprint HTC ONE using Tapatalk 4
Click to expand...
Click to collapse
Not necessarily. I'd thought of that but, as I said in my previous post, the only mod I'd found that would take care of it is OMJ's mod pack which comes with eqs and something else that I didn't really want.
Thanks for the reply though :laugh: I now feel like I'm being too picky haha! I like my setup but it's the only thing that bothers me having that icon just sitting there for no reason.
Gps removal is a smali mod to SystemUi.apk(not really that hard)
Sent from my HTCONE using Tapatalk
dased14 said:
Gps removal is a smali mod to SystemUi.apk(not really that hard)
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
Please share how to modify it bro because I actually hate it too
Sent from my unknown using Tapatalk
you have to decompile SystemUI.apk and the you have go to smali/com/android/systemui/statusbar/policy/LocationBasedController.small and find this
Code:
method private updateIcon()V
.locals 4
const/4 v1, 0x1
const/4 v2, 0x0
const/4 v0, 0x1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isVerizon()Z
move-result v3
if-eqz v3, :cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-nez v3, :cond_0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isVerizonLbsEnabled:Z
if-eqz v3, :cond_1
:cond_0
move v0, v2
:goto_0
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->setIconType(I)V
return-void
:cond_1
move v0, v1
goto :goto_0
:cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-eqz v3, :cond_3
move v0, v2
:goto_1
goto :goto_0
:cond_3
move v0, v1
goto :goto_1
.end method
and make it like this
Code:
.method private updateIcon()V
.locals 4
const/4 v0, 0x0
return-void
.end method
then recompile SystemUI.apk(make sure you sign it) and flash or adb push
(i would do it this way.
Code:
adb remount(hit enter)
adb shell stop(hit enter)
adb push<drag newly signed and compiled SystemUI here> /system/app/(hit enter)
adb reboot(hit enter)
then go set permissions(with whatever file explorer you use) to rw-r-r
dased14 said:
you have to decompile SystemUI.apk and the you have go to smali/com/android/systemui/statusbar/policy/LocationBasedController.small and find this
Code:
method private updateIcon()V
.locals 4
const/4 v1, 0x1
const/4 v2, 0x0
const/4 v0, 0x1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isVerizon()Z
move-result v3
if-eqz v3, :cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-nez v3, :cond_0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isVerizonLbsEnabled:Z
if-eqz v3, :cond_1
:cond_0
move v0, v2
:goto_0
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->setIconType(I)V
return-void
:cond_1
move v0, v1
goto :goto_0
:cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-eqz v3, :cond_3
move v0, v2
:goto_1
goto :goto_0
:cond_3
move v0, v1
goto :goto_1
.end method
and make it like this
Code:
.method private updateIcon()V
.locals 4
const/4 v0, 0x0
return-void
.end method
then recompile SystemUI.apk(make sure you sign it) and flash or adb push
(i would do it this way.
Code:
adb remount(hit enter)
adb shell stop(hit enter)
adb push<drag newly signed and compiled SystemUI here> /system/app/(hit enter)
adb reboot(hit enter)
then go set permissions(with whatever file explorer you use) to rw-r-r
Click to expand...
Click to collapse
thanks bro it worked! :laugh:
dased14 said:
you have to decompile SystemUI.apk and the you have go to smali/com/android/systemui/statusbar/policy/LocationBasedController.small and find this
Click to expand...
Click to collapse
nice...this is how I did it...
Code:
find:
.method public static isSupported()Z
.locals 1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isSprint()Z
move-result v0
return v0
.end method
change to:
.method public static isSupported()Z
.locals 1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isSprint()Z
move-result v0
if-eqz v0, :cond_e
:cond_e
const/4 v0, 0x0
return v0
.end method
this xposed module might get rid of it: http://forum.xda-developers.com/showthread.php?t=2353965
its purpose is to fix the data icons, but it also gets rid of the persistent gps icon (on 4.1.2 at least, the 4.3 rom I'm using already has it removed so I haven't checked that on 4.3).
hotaru2k3 said:
this xposed module might get rid of it: http://forum.xda-developers.com/showthread.php?t=2353965
its purpose is to fix the data icons, but it also gets rid of the persistent gps icon (on 4.1.2 at least, the 4.3 rom I'm using already has it removed so I haven't checked that on 4.3).
Click to expand...
Click to collapse
Nice! Confirmed working on 4.3.
Sent from my HTCONE using Tapatalk

[How-to] edit Huawei's apks

Modifying Huawei's apk files is neither simple nor possible at times.
What can we do?
Very little...
At this time, only the framework-res.apk file can be edited (only on Marshmallow).
For all other apks we can only edit the smali files.
Here there are some tools (Windows and Ubuntu)...
Windows
SuperRsKitchen
https://forum.xda-developers.com/ap...dows-linux-superr-s-kitchen-v3-0-0-0-t3601702
I never tested Windows version... I use it in Ubuntu.
Tickle My Android
https://forum.xda-developers.com/showthread.php?t=1633333&nocache=1
with apktool versions 2.0.1 to 2.2.0 I'm able to install framework, decompile and recompile only framework-res.apk
We can also decompile framework-res-hwext.apk ... but NOT recompile!
Other apks can't be decompiled.
With this tool I can also deodex system files...
I don't know if they are perfect, but my system don't have problems! Everything works
Batch ApkTool by bursoft
http://4pda.ru/forum/index.php?showtopic=557858&view=findpost&p=30280158
Thanks to kep2008
Wonderful tool multilanguage.
We can decompile (with apktool) as with TMA...
We can Deodex, decompile and recompile smalis, convert system.new.dat, etc...
I'm testing it.
I use it on NOUGAT!
Baksmali Manager
https://forum.xda-developers.com/showthread.php?t=2311766
there is smali/baksmali version 2.0.2 inside ...
with smali/baksmali versions 2.0 to 2.1.3 I'm able to decompile, edit smalis, recompile correctly.
there is Compression Level 9 as Default... but I can't have a good SystemUI.apk with this Compression (without navbar and statusbar...and other errors).
If I set Compression Level 0 my SystemUI is very good!
Other apks and jar files are good with this Setting!
Apktool
https://ibotpeaches.github.io/Apktool/
https://forum.xda-developers.com/showthread.php?t=1755243&page=192
smali/baksmali
https://github.com/JesusFreke/smali/wiki
Ubuntu
SuperRsKitchen
https://forum.xda-developers.com/ap...chen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434
Deodex release a lot of errors.
Kitchen makes other operations correctly...
but at the moment I don't know if the new ROM is good or not... I only tested the operations.
Apktool
like above
smali/baksmali
like above
All Credits to developers
MODS post n. 3
Dump Files...
https://forum.xda-developers.com/showthread.php?t=2450045
https://forum.xda-developers.com/showthread.php?t=2368121
with adb shell...
Code:
su
dd if=/dev/block/platform/hi_mci.0/by-name/system of=/storage/[B][COLOR="Red"]extSdCard[/COLOR][/B]/system.img
dd if=/dev/block/platform/hi_mci.0/by-name/recovery of=/storage/[COLOR="Red"][B]extSdCard[/B][/COLOR]/recovery.img
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/storage/[COLOR="Red"][B]extSdCard[/B][/COLOR]/boot.img
Otherwise, there is another way to retrieve these files: extracting from UPDATE.APP
Extraction can be done with the kitchen directly (there is a script that does this job) or by other apps, for example HuaweiUpdateExtractor ( https://forum.xda-developers.com/showthread.php?t=2433454 )
All Credits to developers
What can we do with files modification?
Here are some examples:
http://www.androidiani.com/forum/mo...-0-funzioni-utili-disabilitate-o-rimosse.html
In Samsung section there are a lot of examples that we could follow:
https://forum.xda-developers.com/ga...ified-development/devs-helpingd-devs-t3321679
https://forum.xda-developers.com/showthread.php?t=2799050
Mods tested on Android 6.0:
Navbar - hide virtual key
Launcher Stock: Home Layout and Rotation Toggle
Music Player on Lockscreen
Edit or translate KangVip
Advanced Power Menu by daxgirl
How to port Kangvip
Lockscreen rotation
All Rotations (360°) - Toggle by kep2008
Music/Volume Skip Mod
Colors (Notification and Toolbox buttons)
Colors ... part 2 (Toolbox edit button text)
All QS Tiles visible (Default was 9)
Step Counter ON/OFF in Lockscreen
Colors ... part 3 (Keyguard Clock and Date)
Colors ... part 4 (Notification Panel - Axis Text)
Colors ... part 5 (Header Panel Clock, Date, Week)
Colors ... part 6 (Carrier Label in Notification Panel)
Colors ... part 7 (Shortcuts not displayed)
Colors ... part 8 (Edit DONE and CANCEL Buttons)
Colors ... part 9 (QS Tiles)
...
Mods tested on Android 7.0:
Immersive Mode
All Rotation (360°)
Colors ... part 1 (Keyguard Clock and Date)
Colors ... part 2 (Keyguard Charge and Owner info)
Lockscreen rotation
Colors ... part 3 (Statusbar Clock)
App Twin - All apps in Settings menu
Launcher: Home layout and Auto-rotate
Colors ... part 4 (Back and Reset)
Volume rocker Wake
Music/Volume Skip Mod
...
Navbar - hide virtual key
Tested on Android 6.0 (L21C432B170)
Settings
smali\com\android\settings\VirtualKeySettings.smali
Code:
.method private initVirtualKeyStatus()V
.locals 5
const/4 v1, 0x1
const/4 v2, 0x0
const-class v0, Lcom/android/settings/HwCustVirtualKeySettings;
new-array v3, v1, [Ljava/lang/Object;
aput-object p0, v3, v2
invoke-static {v0, v3}, Lcom/huawei/cust/HwCustUtils;->createObj(Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/android/settings/HwCustVirtualKeySettings;
iput-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;
invoke-static {}, Lcom/android/settings/Utils;->isChinaArea()Z
move-result v0
if-eqz v0, :cond_22
iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;
if-eqz v0, :cond_2e
iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;
invoke-virtual {v0}, Lcom/android/settings/HwCustVirtualKeySettings;->isFrontFingerPrint()Z
move-result v0
if-eqz v0, :cond_2e
:cond_22
iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;
if-eqz v0, :cond_58
iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;
invoke-virtual {v0}, Lcom/android/settings/HwCustVirtualKeySettings;->isShowNavigationBarSwitch()Z
move-result v0
if-eqz v0, [B][COLOR="Red"]:cond_58[/COLOR][/B]
:cond_2e
const-string v0, "virtual_key"
invoke-virtual {p0, v0}, Lcom/android/settings/VirtualKeySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/SwitchPreference;
iput-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;
iget-object v3, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;
invoke-virtual {p0}, Lcom/android/settings/VirtualKeySettings;->getActivity()Landroid/app/Activity;
move-result-object v0
invoke-virtual {v0}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "hide_virtual_key"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-lez v0, :cond_56
move v0, v1
:goto_4b
invoke-virtual {v3, v0}, Landroid/preference/SwitchPreference;->setChecked(Z)V
iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;
iget-object v1, p0, Lcom/android/settings/VirtualKeySettings;->mPreferenceChangedListener:Landroid/preference/Preference$OnPreferenceChangeListener;
invoke-virtual {v0, v1}, Landroid/preference/SwitchPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
:goto_55
return-void
:cond_56
move v0, v2
goto :goto_4b
[B]:cond_58[/B]
const-string v0, "virtual_key"
invoke-virtual {p0, v0}, Lcom/android/settings/VirtualKeySettings;->[B]removePreference[/B](Ljava/lang/String;)V
const/4 v0, 0x0
iput-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;
goto :goto_55
.end method
change :cond_58 with
Code:
if-eqz v0, [B][COLOR="DarkGreen"]:cond_2e[/COLOR][/B]
cond_2e show the toggle...
cond_58 remove the toggle.
Launcher Stock
Tested on Android 6.0
HwLauncher6
smali\com\huawei\android\launcher\Settings.smali
Home Layout 5x5
Find 4x4,4x5
there are 3 results
Edit all with 4x4,4x5,5x5
Code:
[...]
.field private static final DEFAULT_CELL_OPTIONS:Ljava/lang/String; = "4x4,4x5,5x5"
[...]
const-string v3, "4x4,4x5,5x5"
[...]
const-string v8, "4x4,4x5,5x5"
[...]
Rotation Toggle
Code:
# direct methods
.method static constructor <clinit>()V
.locals 4
const/4 v3, -0x1
const/4 v2, 0x1
const/4 v1, 0x0
[...]
sput-boolean [B][COLOR="Red"]v1[/COLOR][/B], Lcom/huawei/android/launcher/Settings;->sOrientationEnable:Z
[...]
Edit v1 with v2
Code:
sput-boolean [B][COLOR="DarkGreen"]v2[/COLOR][/B], Lcom/huawei/android/launcher/Settings;->sOrientationEnable:Z
Music Player on Lockscreen
Tested on Android 6.0
Only a few Music Player are displayed on Lockscreen...
but we can add all Music Player that we want!
Keyguard.apk
smali\com\android\huawei\music\HwMusic.smali
Code:
.method private isSupportMusic(Ljava/lang/String;)Z
.locals 2
.param p1 # Ljava/lang/String;
const-string v0, "com.android.mediacenter"
invoke-virtual {v0, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1e
[COLOR="Red"] const-string v0, "com.google.android.music"
invoke-virtual {v0, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1e[/COLOR]
[B][COLOR="Red"]## HERE WE CAN ADD ALL MUSIC APP. FOLLOW THE EXAMPLE IN RED[/COLOR][/B]
iget-object v0, p0, Lcom/android/huawei/music/HwMusic;->mHwCustHwMusic:Lcom/android/huawei/music/HwCustHwMusic;
if-eqz v0, :cond_20
iget-object v0, p0, Lcom/android/huawei/music/HwMusic;->mHwCustHwMusic:Lcom/android/huawei/music/HwCustHwMusic;
iget-object v1, p0, Lcom/android/huawei/music/HwMusic;->mContext:Landroid/content/Context;
invoke-virtual {v0, v1, p1}, Lcom/android/huawei/music/HwCustHwMusic;->isPackageInWhiteMusicList(Landroid/content/Context;Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_20
:cond_1e
const/4 v0, 0x1
:goto_1f
return v0
:cond_20
const/4 v0, 0x0
goto :goto_1f
.end method
I added, for test, VLC and PI Music Player...
Code:
[COLOR="DarkGreen"]const-string v0, "[B]org.videolan.vlc[/B]"
invoke-virtual {v0, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1e [/COLOR]
[COLOR="Navy"]const-string v0, "[B]com.Project100Pi.themusicplayer[/B]"
invoke-virtual {v0, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1e[/COLOR]
That's a nice thread, thanks for the info.
I've been furious as to why I was unable to de/compile Huawei APKs.
I hope we're able to de/compile more than just framework-res.apk in the future!
The problem is that nobody works on a modded apktool for Huawei/Honor
So we have to use old tools...
apktool 2.2.1, 2.2.2 and the last 2.2.3 don't work...
smali/baksmali is the same
We need a developer
How to translate or edit KangVip?
We haven't problem with kangvip-res.apk ...
we are able to decompile and recompile without problems with TMA (Tickle My Android) and apktool 2.2.3!
But we have a lot of problems with KangVIPTools.apk
We can only decompile it... but not recompile!
How to solve it?
Decompile with TMA...
Open AndroidManifest.xml...
at the end of line 4 you have
Code:
android:qihoo="activity"
Delete it or you can't recompile!
Now you have a recompiled apk file... but it isn't good! ... it crashes!
So you have to open Original and Recompiled File...
from Recompiled apk take resources.arsc (if you edited values folder), layout/*.xml, xml/*.xml, ecc ...
Put resources.arsc and other modded files in Original apk (overwrite original file)...
Now you have a good apk to insert in Device /system/framework folder
...or kep2008 Procedure:
You can also copy from original .apk META-INF folder and AndroidManifest.xml and move them to a modified .apk (I do this with 7zip).
Click to expand...
Click to collapse
https://forum.xda-developers.com/showpost.php?p=73039858&postcount=21
IMPORTANT:
Not all modifications are good ... you have to try!
Aren't you able to hide some things?
Here is a solution
Tested by me on my VNS-L21C432B170
Hey that's some good work I will try it for p10 lite
Can you post the contents of res/values/config.xml from your decompiled framework-res.xml? Thanks!
In res/values there isn't config.xml
I have:
attr-privates
Arrays
Attrs
Bools
Colors
Dimens
Drawables
Fractions
Ids
Integers
Plurals
Public
Strings
Styles
Alright. Can you try doing a search for "config_statusBarIcons"?
I found it in arrays.xml
Code:
<string-array name="config_statusBarIcons">
<item>managed_profile</item>
<item>ime</item>
<item>sync_failing</item>
<item>sync_active</item>
<item>cast</item>
<item>location</item>
<item>bluetooth</item>
<item>powersavingmode</item>
<item>earphone</item>
<item>nfc</item>
<item>tty</item>
<item>speakerphone</item>
<item>zen</item>
<item>mute</item>
<item>volume</item>
<item>wifi</item>
<item>cdma_eri</item>
<item>data_connection</item>
<item>phone_evdo_signal</item>
<item>phone_signal</item>
<item>battery</item>
<item>alarm_clock</item>
<item>secure</item>
<item>clock</item>
<item>volte_call</item>
<item>unicom_call</item>
<item>eyes_protect</item>
</string-array>
Thank you! Now if only I can get the comparable list from a Huawei device running Nougat. Want to try decompiling my framework-res.apk from Mate 9?
Upload your framework
My framework-res is from Marshmallow ...I use it at the moment.
If you need, I can decompile P9 lite Nougat framework-res also
millo1978 said:
Upload your framework
My framework-res is from Marshmallow ...I use it at the moment.
If you need, I can decompile P9 lite Nougat framework-res also
Click to expand...
Click to collapse
Yes! Please decompile the P9 Lite Nougat framework-res and look for that string again. It would be a great help for an app I'm making
I tested all release of apktool, but nothing
I'm not able to decompile Nougat apks
Advanced Power Menu
Reboot Menu
ORIGINAL THREAD:
https://forum.xda-developers.com/galaxy-s5/themes-apps/app-t2996278
Thanks to @daxgirl
It isn't simple to have an Advanced Power Menu editing service.jar ...
But daxgirl helped us with this wonderful app!
daxgirl (original app was for Lollipop) gave us the source code...
so now we can build this app for Marshmallow or Nougat also... we have only to make some edits.
Android Studio on Windows is needed.
We have to import the source code and update all things that Android Studio need...
now we are ready to start!
What I edited on Android 6.0?
(same for Android 7)
build.gradle
DialogRebootFragment.java
strings.xml
In build.gradle I set version 23 for Marshmallow, instead of 21 for Lollipop.
Then I also modified the version of the Tool, as proposed by the Android Studio.
In the DialogRebootFragment I had to make some changes, as the Hot Reboot and Download Mode worked.
I edited
Code:
busybox killall zygote
Instead of
Code:
busybox killall system_server
to have Hot Reboot working.
I edited
Code:
pm.reboot("bootloader");
Instead of
Code:
pm.reboot("download");
to have Download Mode working.
If you want to hide the icon, you have to add "//"
Code:
builder.setTitle(R.string.dialog_title)
// .setIcon(R.mipmap.ic_launcher)
You can translate it in all languages!
How to port KangVIP
SOURCE
Thanks to HRT Team - kangvip
How to do?
Exactly I don't know! There aren't in internet informations about it!
...and no one wants to share what he knows.
I like sharing information...
So we can improve everyone
How did I do it?
I searched a ROM with Kangvip tools...
a ROM with same OS (in my case Android 6.0 EMUI 4.1.2) and a similar Phone (Honor 5C).
I tried, File for File, to understand what were important ... but at the end, getting various errors, I was forced to take all the files in the framework folder.
(is it right? I don't know, but it works!)
What other files are needed?
app folder:
HwFloatCalculator (floating app)
HwFloatCalendar (floating app)
HwFloatNotePad (floating app)
HwLauncher6 (to have advanced options)
etc/permissions folder:
com.google.android.dialer.support.xml
etc folder:
k.set (needed? I don't know)
priv-app folder:
IncallUI (needed? I have to test it)
Keyguard (to have lockscreen advanced settings)
SystemUI (to have SystemUI advanced settings)
Settings (to have k-settings in menu)
WiFiPW (to display Wifi passwords)
Other files needed:
...
(I don't know)
I'll complete this post with new informations.
Now I have a working Kangvip tools... but not complete.
This is a great starting point.
We can correct it, translate, edit menu, edit layout, hide chinese, unwanted or not working parts, etc...
https://forum.xda-developers.com/showpost.php?p=72846664&postcount=9
Everyone's help is welcome

Categories

Resources