Related
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] 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.
{TUTORIAL}[How To] 4-Way Reboot + Theminig MediaTeK Devices - MTK & Low End Device
Hello Everyone,
First Of All and Everything, Let me Thank Some People First To made it possible what I am posting Today.
Credits@iBotPeaches - Without Him Decompiling and Recompiling any apk is a dream. So we must thank him for this (ApkTool).
@Ticklefish - For His Wonderful Tool TMA. Just loving to work with that at ease,
@Adi Aisiteru Reborn - A Wonderful Person, Very Helpful and have so many nice guides to go through and learn.
@majdinj- A wonderful Guide to get 4-way reboot method.
@bombaybadboy - A nice person and a really a nice contributor to this community.
@joehanh88 - A Good Guide to follow and will help you in everything you do.
@akash akya- A good friend who helped me in doing some nice thing for MediaTek Device and So many guides are also by him to follow with.
@ XDA Forum - Can't Say anything, As Its my school and being a student I will never like to hear anything wrong related to it.
@ To All Other Dev Who Made It possible or If I am including anything from yours so please PM to mention your name in Credits. Please....
Now Let's Star With this Guide :-
-: Transparent Status bar & Notification Full Down:-
The Most Common thing to get first but then also a difficult thing to figure it out.
Decompile your SystemUI.apk and go to SystemUI/res/values--
So the First thing is Changing the "Drawables.xml" -
Find this
Code:
<item type="drawable" name="status_bar_background">#[COLOR=Red]3f000000[/COLOR]</item>
Change this RED Values with anything that you want to as accordingly with the HEX Color values.
Wait we are not done with that.
Now Copy these lines at the end of drawable before this line "</resources>"
Code:
<item type="drawable" name="notification_header_bg">#[COLOR=Red]88000000[/COLOR]</item>
<item type="drawable" name="notification_panel_bg">#[COLOR=Red]88000000[/COLOR]</item>
<item type="drawable" name="status_bar_bg_tile">#[COLOR=Red]00000000[/COLOR]</item>
Again Same Change RED values with what your need is.
Now Open "Colors.xml"
and change this line -
Code:
<color name="notification_panel_solid_background">#[COLOR=Red]3f000000[/COLOR]</color>
The Transparency Values are like :-
Code:
#00000000 - black with 100% transparency
#3F000000 - black with 75% transparency
#7F000000 - black with 50% transparency
#BF000000 - black with 25% transparency
Now You need to find some ".9.png" and delete it.
So Go to - SystemUI/res/drwable-hdpi (as per the resolution of your devices).
Notification_panel_bg.9.png
Status_bar_bg_tile.9.png
Notification_header_bg.9.png
Delete this image where ever you find it in your SystemUI.apk
"Notification_panel_bg.9.png"
Deleting this will give you your notification panel transparency.
Now Lets Move To Editing Smali. So now go to SystemUI/smali/com/android/systemui/statusbar/phone/
And Open "PhoneStatusBar$FastColorDrawable.smali"
Find this
Code:
.parameter "canvas"
And in that method change this line
Code:
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;->mColor:I
To This
Code:
const v0, 0x[COLOR=Red]00000000[/COLOR]
. Again change RED to the transparency level to suit your need.
Now Decompile your "android.policy.jar"
And go to android.poliy.jar.out/smali/com/android/internal/policy/impl/---
Open "PhoneWindowManager.smali"
There do like mentioned below.
Delete RED Lines
Code:
.line 2627 ------*******
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I ------ Find This line.
[COLOR=Red]
.line 3061
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3063
:goto_1a
return v0
.line 3062
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
[/COLOR]
.line 3063 ------- *****This line number can be different in yours .
:cond_26
const/4 v0, 0x0
[COLOR=Blue]goto :goto_1a[/COLOR] -------- Change this to "[COLOR=Blue]return v0[/COLOR]"
.end method
Make Sure that the line marked with "******" will have a difference of 3.
So After Doing this it will look like this
Code:
.line 2627
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 2630
:cond_1
const/4 v0, 0x0
return v0
.end method
Now Recompile your SystemUI.apk & android.policy.jar and flash it.
4-Way Reboot Menu - Thanks to majdinj sir
Decompile Your "android.policy.jar"
Go To android.poliy.jar.out/smali/com/android/internal/policy/impl/
Open GlobalActions$3.smali and find this-***
Code:
invoke-interface {v0, v1}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->reboot(Z)V
If its there then proceed and if not then find above line in all files with name "GlobalActions$#.smali" where "#" will be number.
Ok you find that so lets proceed.
Now in the same folder open "GlobalActions.smali"
And Change the lines (There will be two lines only) -
Code:
Lcom/android/internal/policy/impl/GlobalActions$3
Please Note :- You have to find the number same as in which you find the above *** mentioned lines.
So please make sure for this.
Now Change the "3" or "#" to "99" where "#" is the number in which you find the *** lines.
Done That.
Now Open - "GlobalActions$SinglePressAction.smali"
And Do like given -
Add the BLUE lines in that like its given below
Code:
# 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=Blue][COLOR=Black] -----------------------Make Sure the gap will be of 2(two) lines[/COLOR]
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
[COLOR=Blue][COLOR=Black] -----------------------Make Sure the gap will be of 2(two) lines[/COLOR][/COLOR]
# instance fields
.field private final mIcon:Landroid/graphics/drawable/Drawable;
Now Find "#direct methods"
and paste these lines just after this and whithout any gap between "#direct methods" and the lines you pasted.
Code:
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Soft Reboot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Hard Reboot"
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
Now Download the given zip file and extract it. Copy all the files of the zip to -
"android.poliy.jar.out/smali/com/android/internal/policy/impl/ here" (here=files downloaded from this guide).
Done That. Now Recompile it and Flash it. Make sure to make a backup before you flash any MOD.
You Successfully Modded these things then Don't Forget To Hit "THANKS" Button for all the persons mentioned in the "CREDITS" section and to Me Also p) and Rate This Thread 5 star.
If you Got in Trouble then post it here. I will be there to help you out. I work as machine but very Unfortunate to say that I am also a human being and I too have Office work, personal life, friends, families, etc. So please have patience. The Time I will see your post, I promise, I will try my best to help you out.
Need More Guides- Find those in post #3.
Want To See My Contributions [ SuperDroid-BOND ]
Though I know, I haven't contributed much to the Community, but here are few of my Works:-
Older Ones (Till 2015)
External Apps Modded :-
SlimKat Camera for CM11 & CM12 ROMs
ROM :-
TURBO-Zet™ ROM for Micromax A110
SLT-Nexus-TSUNAMI for Micromax A110
SLT-HYBRID-Rainbow for Micromax A110
RECOVERY :-
Carliv Touch Recovery & CWM Recovery 6.0.4.0 for Micromax A110 | Cynus T2 | Wiko Cing King
Cannibal Open Touch [COT] Recovery for Micromax A110 | Cynus T2 | Wiko Cing King
MODS :-
1) Sony Xperia Small App For 4.2.2
2) Sony Small Apps For 4.1.1
3) The Hybrid-UI MOD
4) The Transparency MOD
5) The Lockscreen MOD
GUIDES :-
1) The Power Menu + Screenshot GUIDE
2) The 4-Way Reboot Menu Guide
3) The Extra Theme to Device and Moving Toggles to Bottom
#@# My Dev-Host Account
Newer Ones [Since 2017]
MODs :-
1) Sultan SnapCam
ROMs :-
1) Vanir AOSP for OnePlus 3/T Unified
2) ColtOS for OnePlus 3/T Unified
Usefull Links - For MediaTek Buddies & Other Low End Devices
1) MTK Referrence Thread By @akash akya
2) Moving Toggles To the Bottom of Pull Down Menu By BOND1987.
More Will be Added After wards. Just Have Patience......:victory::victory::victory:
BOND1987 said:
1) MTK Referrence Thread By @akash akya
2) Moving Toggles To the Bottom of Pull Down Menu By BOND1987.
More Will be Added After wards. Just Have Patience......:victory::victory::victory:
Click to expand...
Click to collapse
good one... :good:
small tip, also make sure in dimensions (res/values/dimen.xml) :
Code:
<item type="dimen" name="status_bar_icon_drawing_alpha">100.0%</item>
else transparency look bit odd...
Nice work m8 and a well put together guide, here is your first 5☆ :thumbup:
Sent from my GT-I9100 using xda premium
bombaybadboy said:
Nice work m8 and a well put together guide, here is your first 5☆ :thumbup:
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
All of your works sir but with MTK modification.
akash akya said:
good one... :good:
small tip, also make sure in dimensions (res/values/dimen.xml) :
Code:
<item type="dimen" name="status_bar_icon_drawing_alpha">100.0%</item>
else transparency look bit odd...
Click to expand...
Click to collapse
Will add that also brother. I know it's auto dimming feature by "daxgirl".
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
Hi Bond, Very nice guide.. Now i'll also give it a try.. :good:
Implementing Auto-Close SystemUI feature
@ Devs @BOND1987 , @akash akya ,
There is no need to edit any thing else but only systemuiservice.smali.....
I have taken these resources from Suvi v12 rom by bsuhas. So actual credits to bsuhas
Just Replace your entire OnClick Method by the below method:-
Code:
[B][COLOR="black"].method public [COLOR="red"]SettingsButton[/COLOR](Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "[COLOR="Red"]com.android.settings[/COLOR]"
const-string v2, "[COLOR="red"]com.android.settings.Settings[/COLOR]"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
[COLOR="red"]invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V[/COLOR]
.line 1720
return-void
.end method[/COLOR][/B]
and then make the following changes
* replace red ones with the following -
in the 1st line, give any name to the button u want to define . eg:- .method public ProfileButton(Landroid/view/ViewV
in const-string v1, " * put target class name here*
in const - string v2, " * put the target class name as well as an activity to call it *
for eg:-
in const - string v1 ----- target class is to call the complete app ---------> com.android.contacts
and in const - string v2 ----- add package name + an activity to call it --------> com.android.contacts.activities.PeopleActivity
Lets take an example for defining a method and calling it . i'll call Settings here
Code:
.method public [COLOR="red"]settingsButton[/COLOR](Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "[COLOR="red"]com.android.settings[/COLOR]"
const-string v2, "[COLOR="red"]com.android.settings.Settings[/COLOR]"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
after this we have to call it on clicking a tile . so lets define it in the quickpanel_quick_settings_space.xml
Add this wherever you want the tile to appear .
Code:
<RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="125.0px" android:layout_height="150.0px" android:layout_weight="1.0">
<Button android:layout_gravity="center_horizontal" android:background="@drawable/set" android:layout_width="wrap_content" android:layout_height="wrap_content" [COLOR="Red"][SIZE="4"]android:onClick="settingsButton"[/SIZE][/COLOR] />
<TextView android:textSize="14.0dip" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:layout_marginBottom="3.0px" android:text="Settings" android:singleLine="true" android:layout_alignParentBottom="true" />
</RelativeLayout>
Video to Confirm it working. :highfive:
Sorry if the above explaination is too long :fingers-crossed::fingers-crossed:
easy & nice tut...
@BOND1987
-: Transparent Status bar & Notification Full Down:-
Click to expand...
Click to collapse
4-Way Reboot Menu - Thanks to majdinj sir
Click to expand...
Click to collapse
I've successfully made my own transparent statusbar & 4 way rebooter according to ur guide & works very charm on my stock deodex rom.
thanks alot bro... :good::good:
1 question: how to increase statusbar height?
sir
recovery reboot doesn't work please help
Hi, I tried the 4-way reboot menu and it just replaced the shutdown function on the dialog box. It says reboot, but when I tap it, phone shutsdown. I'm on MT6575 running GB 2.3.6 which doesn't have reboot/restart function.
iZLeeP said:
Hi, I tried the 4-way reboot menu and it just replaced the shutdown function on the dialog box. It says reboot, but when I tap it, phone shutsdown. I'm on MT6575 running GB 2.3.6 which doesn't have reboot/restart function.
Click to expand...
Click to collapse
OK brother,
Upload you android policy. Jar and I'll try to solve this in my free time.
WinchyHanepp said:
recovery reboot doesn't work please help
Click to expand...
Click to collapse
Brother,
Regarding your problem, I asked my ""MAGIC BOWL"" that what's the problem, but....
Come on Guys,
I'm not a astrologer to judge what's gone wrong. I need logs and apps for checking what's the problem.
Sent from my A110 using Tapatalk
SuperDroid-BOND said:
OK brother,
Upload you android policy. Jar and I'll try to solve this in my free time.
Attached file as requested. Thanks mate.
Click to expand...
Click to collapse
Hey @SuperDroid-BOND sir... I tried for transparency but when i recompile the apk then gets this error.. Please can you help me.. Hope you will help me..
See error here :::-
{
"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"
}
Abhinav_Rocks said:
Hey @SuperDroid-BOND sir... I tried for transparency but when i recompile the apk then gets this error.. Please can you help me.. Hope you will help me..
See error here :::-
Click to expand...
Click to collapse
Brother,
You have mentioned notification_header_bg two times in your drawable.xml inside the values folder.
Try deleting it. It will recompile easily.
Sent from my A110 using Tapatalk
SuperDroid-BOND said:
Brother,
You have mentioned notification_header_bg two times in your drawable.xml inside the values folder.
Try deleting it. It will recompile easily.
Sent from my A110 using Tapatalk
Click to expand...
Click to collapse
No sir.. Its only one time, See ::
Abhinav_Rocks said:
No sir.. Its only one time, See ::
Click to expand...
Click to collapse
If it's not there then how apktool is giving it's entries 2 times at line number 3 and 14.
If it's not there then get to compile it and if error occurs then give screenshot of the full error.
Sent from my A110 using Tapatalk
SuperDroid-BOND said:
If it's not there then how apktool is giving it's entries 2 times at line number 3 and 14.
If it's not there then get to compile it and if error occurs then give screenshot of the full error.
Sent from my A110 using Tapatalk
Click to expand...
Click to collapse
Sorry sir i m doing mistake.. really sorry.. mistake is that you say.. sorry again.. and now SystemUI.apk is recompiling done..
But in jar file recompiling this error, please help me out ::-
Here is my android.policy.jar file ::- Download
---------- Post added at 01:46 AM ---------- Previous post was at 12:54 AM ----------
Now trying once again.. working awesome.. Thanks a lot bro.. I m beginner and you are GURU of mine and i m CHELA.. I have learn so much from you.. Thanks again sir for this awesome thread with simple steps..
---------- Post added at 02:41 AM ---------- Previous post was at 01:46 AM ----------
Sir.. Can you please tell me whats the work of these lines.. please sir.. and check screen that i m right or wrong..?? If i m wrong then please guide me.. Thanks in advance sir..
Sir please reply.. its only take 2 mint.. Please..
SuperDroid /QUOTE said:
..\Decompiled_jar\android.policy\com\android\internal\policy\impl\GlobalActions$99$1.smali[27,4] Error for input '.parameter': Invalid directive
..\Decompiled_jar\android.policy\com\android\internal\policy\impl\GlobalActions$99$1.smali[42,4] Error for input '.parameter': Invalid directive
..\Decompiled_jar\android.policy\com\android\internal\policy\impl\GlobalActions$99$1.smali[43,4] Error for input '.parameter': Invalid directive
..\Decompiled_jar\android.policy\com\android\internal\policy\impl\GlobalActions$99$1.smali[42,15] mismatched input '"dialog"' expecting END_METHOD_DIRECTIVE
..\Decompiled_jar\android.policy\com\android\internal\policy\impl\GlobalActions$99.smali[78,4] Invalid literal value: 260. Low 16 bits must be zeroed out.
hmmm any advice?
Click to expand...
Click to collapse
Hello Everyone,
Here, being on XDA, is like learning new things in a school and getting project homework on daily basis. And Speaking for this, I really like it.
So here is the project that I cleared today morning at around 4.30 AM IST (Indian Standard Time).
But before beginning for project let me THANK few IDOLS of XDA.
@tdunham - You are the master of Power menu Sir. Compared files with your guide. @Adi Aisiteru Reborn - The GOD of MOD & Guides for CM / AOSP / AOKP @ankurbata- For the files I used for comparing.
@Dzol Cp- You are the One brother who taught me these things.
@bombaybadboy-Awesome Thread by You Sir. Got everything working whenever I take help from your thread.
@Goldieking- For helping me in rectifying error.
@Ticklefish- Awesome and Simplest tool for Themers and noobs like me.
@My Wife - My Life's Companion, Dearest Friend, My Love & Encouragement. I love you Sweet-Heart. @Xda Forum- The School for New born Techie child like me.
Before beginning to this guide, please make sure that you followed this guide by tdunham line by line and you failed doing so.
I tried this on my Stock ROMs and Other ported ROMs of My Device forum and got this working.
PART-1
1st Step:-
Decompile Your framework-res.apk and go to - res/value/strings.xml
add this line at the end.
Code:
<string name="global_action_screenshot_txt">Screenshot</string>
<string name="global_action_recovery_txt">BOND Recovery</string>
And add the png attached in this thread to - res/value/drawable-hdpi/mdpi/xhdpi (any one folder you can choose to add the images as according to your device resolution).
Step-2
Now recompile the framework-res.apk and then again decompile the newly compiled framework-res.apk
Then go to - res/values/public.xml and leave it open.
PART-2
Step-1
Now Decompile your stock "android.policy.jar" and add the attached "android.policy" files to - "android.policy.jar\smali\com\android\internal\policy\impl"
Now open GlobalActions.smali.
and find this lines.
Code:
.field private mRingerModeReceiverRegistered:Z
Just below this line make space for a line just like as its there (One space above the line & One space below)
Then Add these lines
Code:
.field mScreenshotConnection:Landroid/content/ServiceConnection;
.field final mScreenshotLock:Ljava/lang/Object;
.field final mScreenshotTimeout:Ljava/lang/Runnable;
Now find this line
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
Add these line below that.
Code:
.line 315
new-instance v4, Ljava/lang/Object;
invoke-direct {v4}, Ljava/lang/Object;-><init>()V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
.line 317
const/4 v4, 0x0
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
.line 318
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$12;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$12;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
Now Find This line -
Code:
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
.parameter "x0"
.prologue
.line 68
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->handleShow()V
return-void
.end method
And Add the line below end method.
Code:
.method static synthetic access$1900(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
.parameter "x0"
.prologue
.line 64
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->takeScreenshot()V
return-void
.end method
Now find this line
Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
And add this line below this method and above the line starting with-".line XXX"
Code:
.line 232
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080691 [COLOR=Lime]<-------- This is the ID of "bond_screenshot"[/COLOR]
const v4, 0x1040516 [COLOR=Red] <-------- This is the ID of "global_action_screenshot_txt"[/COLOR]
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$14;
const v3, 0x1080692[COLOR=Lime] <-------- This is the ID of "bond_recovery"[/COLOR]
const v4, 0x1040517 [COLOR=Red]<-------- This is the ID of "global_action_recovery_txt"[/COLOR]
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$14;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Now Find this line--
Code:
# virtual methods
And add this lines just above it with gap of 2(two) Space between "end method" & "Virtual methods"
Code:
.method private takeScreenshot()V
.locals 8
.prologue
.line 330
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
monitor-enter v4
.line 331
:try_start_0
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
if-eqz v3, :cond_0
.line 332
monitor-exit v4
.line 391
:goto_0
return-void
.line 334
:cond_0
new-instance v0, Landroid/content/ComponentName;
const-string v3, "com.android.systemui"
const-string v5, "com.android.systemui.screenshot.TakeScreenshotService"
invoke-direct {v0, v3, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
.line 336
.local v0, cn:Landroid/content/ComponentName;
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
.line 337
.local v2, intent:Landroid/content/Intent;
invoke-virtual {v2, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
.line 338
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$BondB;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/GlobalActions$BondB;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
.line 386
.local v1, conn:Landroid/content/ServiceConnection;
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
const/4 v5, 0x1
invoke-virtual {v3, v2, v1, v5}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
move-result v3
if-eqz v3, :cond_1
.line 387
iput-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
.line 388
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
const-wide/16 v6, 0x2710
invoke-virtual {v3, v5, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
.line 390
:cond_1
monitor-exit v4
goto :goto_0
.end local v0 #cn:Landroid/content/ComponentName;
.end local v1 #conn:Landroid/content/ServiceConnection;
.end local v2 #intent:Landroid/content/Intent;
:catchall_0
move-exception v3
monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v3
.end method
Few Things to remeber:-
1) The ID's Need to be Same as in public.xml or else boot loop will shake your hands.
2) The register values like - v0,v1,v2.... need to be managed like what it is in your GlobalActions.smali. For the Comparison I have attached My-GlobalActions.smali for comparison.
Just change the extention from zip to smali.
3) I am also human and will be here after my daily life. So please have patience. I will try to get you out of your problem, if and only if you have a adb logcat.
4) If you find any difficulties then post it in the thread.
The Results after successful completion of this will be same as screenshot.
http://dl.xda-developers.com/attach.../7/6/5/2/2/Screenshot_2013-08-09-02-00-21.jpg
Last But Not Least - Don't get bothered to hit thanks. It will not cost you anything but will surely increase my courage to work and try new things.
Awesome Guide My Brother!!
Happy Eid Mubarak to You and rest of your family
Dzol Cp said:
Awesome Guide My Brother!!
Happy Eid Mubarak to You and rest of your family
Click to expand...
Click to collapse
Thanks a lot brother...
Happy EID to you and The whole XDA family of ours brother...
"""Hitting Thanks Don't Cost You Anything So Why Don't You Try Hitting It......."""
Sent From Mind Blowing Canvas Using SUVI-Heart Rom.....<3<3<3
"Happy EID to you all and the whole XDA Family "
Hey, i want to ask something. What is the meaning of line 315 on this ".line315 new-instance v4, Ljava/lang/Object;"? Sorry, just want to know a bit java programming Thanks for your help
i manage to make it bro..sadly after pressing screenshot my phone reboots..but recovery is working just fine..great tut..
BOND1987 said:
Thanks a lot brother...
Happy EID to you and The whole XDA family of ours brother...
"""Hitting Thanks Don't Cost You Anything So Why Don't You Try Hitting It......."""
Sent From Mind Blowing Canvas Using SUVI-Heart Rom.....<3<3<3
Click to expand...
Click to collapse
I did as your followers. click on the menu button to display the power source immediately my phone reboot
Looking forward to your help
vuong95vjpboy said:
I did as your followers. click on the menu button to display the power source immediately my phone reboot
Looking forward to your help
Click to expand...
Click to collapse
Upload you global actions.smali and public.xml of framework....
"" Hitting Thanks Will Not Cost You Anything, So, Why Don't You Try Hitting It Once.....""
Sent While Checking The "AMOI 4.2.2 Beast".....
BOND1987 said:
Upload you global actions.smali and public.xml of framework....
"" Hitting Thanks Will Not Cost You Anything, So, Why Don't You Try Hitting It Once.....""
Sent While Checking The "AMOI 4.2.2 Beast".....
Click to expand...
Click to collapse
Hi sir, my GlobalActions.smali has different with your file, so i dont know put the code in what line
Can you help me? I attach my original GlobalActions.smali, can you mod the code help me? Thanks!
The id in my framework is:
Code:
<public type="drawable" name="bond_recovery" id="0x010805ef" />
<public type="drawable" name="bond_screenshot" id="0x010805f0" />
<public type="string" name="global_action_screenshot_txt" id="0x010404d5" />
<public type="string" name="global_action_recovery_txt" id="0x010404d6" />
My phone was use MTK chipset, ICS 4.0.4. Here is my power menu screenshot
Thanks!
^
^
@BOND1987 Can you help me sir? Thanks!
sieuan said:
^
^
@BOND1987 Can you help me sir? Thanks!
Click to expand...
Click to collapse
Yes brother,
Of course I'll help you. Yesterday night I corrupted my windows so brother you have to wait for today and tomorrow I'll do this for you.
BOND1987 said:
Yes brother,
Of course I'll help you. Yesterday night I corrupted my windows so brother you have to wait for today and tomorrow I'll do this for you.
Click to expand...
Click to collapse
Thanks sir!
After follow the guide in this thread: http://forum.xda-developers.com/showthread.php?t=2225970, I succes add 3-Way boot to Power Menu, and it work good
Before:
After:
Now, can you help me add screenshot option into Power Menu, sir? Here is my GlobalActions.smali. Thanks!
sieuan said:
Thanks sir!
After follow the guide in this thread: http://forum.xda-developers.com/showthread.php?t=2225970, I succes add 3-Way boot to Power Menu, and it work good
Before:
After:
Now, can you help me add screenshot option into Power Menu, sir? Here is my GlobalActions.smali. Thanks!
Click to expand...
Click to collapse
I absolutely love your set up. What ROM / Theme is that?
babalonius508 said:
I absolutely love your set up. What ROM / Theme is that?
Click to expand...
Click to collapse
A Vietnamese ROM, for a Chinese phone, modify by me with light holo theme, apex launcher and miui v5 icon pack.
That's a very cool setup! Thanks!
I can't seem to open the GlobalActions.smali in the OP for comparison because it says its corrupt? Any one else have this problem?
babalonius508 said:
That's a very cool setup! Thanks!
I can't seem to open the GlobalActions.smali in the OP for comparison because it says its corrupt? Any one else have this problem?
Click to expand...
Click to collapse
Brother,
Change the extension of zip to .Smali.
Or try opening with notepad++ and you will be able to coordinate with the guide as well.
If you get any problems further to this, just let me know by post it in this thread.
BOND1987 said:
Brother,
Change the extension of zip to .Smali.
Or try opening with notepad++ and you will be able to coordinate with the guide as well.
If you get any problems further to this, just let me know by post it in this thread.
Click to expand...
Click to collapse
Thanks a lot man! I missed that part of the instructions. Does this modification work for all devices?
babalonius508 said:
Thanks a lot man! I missed that part of the instructions. Does this modification work for all devices?
Click to expand...
Click to collapse
I think brother,
Other than TouchWiz, it will work on all AOSP based devices. Though I'm not sure for this but you can try. If you are in trouble, just let me know.
BOND1987 said:
I think brother,
Other than TouchWiz, it will work on all AOSP based devices. Though I'm not sure for this but you can try. If you are in trouble, just let me know.
Click to expand...
Click to collapse
Thank you for all your help!
For some reason, after I finish the modification, I hold the power button and my phone just reboots. I'm not sure what I'm doing wrong.
Here is my framework-res.apk: https://db.tt/xy0QGFiH
And my androidpolicy.jar: https://db.tt/IOe6JAkn
And a logcat: https://db.tt/EiN6Qcot
Thank you again!
babalonius508 said:
Thank you for all your help!
For some reason, after I finish the modification, I hold the post menu and my phone just reboots. I'm not sure what I'm doing wrong.
Here is my framework-res.apk: https://db.tt/xy0QGFiH
And my androidpolicy.jar: https://db.tt/IOe6JAkn
And a logcat: https://db.tt/EiN6Qcot
Thank you again!
Click to expand...
Click to collapse
Brother,
Give me 24 hours only to take look on your files. And I will revert you back as soon as possible. Thanks for posting it here. I appreciate your support brothers.
That sounds great! Thank you! I really hope I can get it working.
Sent from my Nexus 4
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