Today again a new mod ( i collected this from great cataclysm rom )
You should be having Stock deodexed settings.apk
1. Decompile the settings
2. Open settings.apk/res/values/attrs.xml
Add this code
Code:
<attr name="type" format="integer" />
3. Open settings.apk/res/values/strings.xml
Add this code
Code:
<string name="window_animation_scale_title">Window animation scale</string>
<string name="transition_animation_scale_title">Transition animation scale</string>
<string name="animator_duration_scale_title">Animator duration scale</string>
4. Add this code to any of your settings like (display_settings.xml or as you wish )
Code:
<PreferenceScreen android:title="@string/animation_speeds_title" android:key="animation_speeds" android:summary="@string/animation_speeds_summary" android:fragment="com.android.settings.AnimationSpeeds" />
5. Add these ids in settings.apk/res/values/ids.xml
Code:
<item type="id" name="seek_bar_pref_unit_right">false</item>
<item type="id" name="seek_bar_pref_value">false</item>
<item type="id" name="seek_bar_pref_unit_left">false</item>
<item type="id" name="seek_bar_pref_bar_container">false</item>
6. Now download this View attachment settings.zip
and merge codes
Main Part Continued in Post #2
Final part and Result
Here comes a critical Part but not difficult
We had added new integer so we have to define in setting activity
i will explain in simple code just follow it
7. Now open settings.apk/smali/com/android/settings/R$styleable.smali
Find this code
Code:
.field public static final IntentPreference:[I
Below this add
Code:
.field public static final MySeekBarPreference:[I
Now look for
Code:
sput-object v0, Lcom/android/settings/R$styleable;->PercentageBarChart:[I
Below Add this code
Code:
.line 12360
new-array v0, v3, [I
const v1, 0x7f010044
aput v1, v0, v2
sput-object v0, Lcom/android/settings/R$styleable;->MySeekBarPreference:[I
So here you had define the integer
8. Compile and decompile so you get new public ids
From that in R$styleable.smali
Replace the Public code :- 0x7f010044 #<public type="attr" name="type" id="0x7f010044" />
and in MySeekBarPreference.smali and in AnimationSpeeds.smali compare with my public ids and replace them
9. Oh god... just compile and replace your settings.apk and enjoy the mod ( check the below image on what mod you did........... )
{
"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"
}
Don't forget to mention in if you used my work
Awesome bro ^^
“Sent From MWE V7.0.0 On My Z3”
6. Now download this settings.zip
and merge codes
Click to expand...
Click to collapse
hi venkat, i tried your guide, all is fine except the step mentioned ahead.
i compared the public.xml from the rom i use and your public(compare).xml with WinMerge and there are many differences (on both sides)
So what to do?
Tried to simple copy your xml into the values folder, but then recompiling failed.
And the second thing i don´t understand:
8. Compile and decompile so you get new public ids
Click to expand...
Click to collapse
where is this new public ids?
From that in R$styleable.smali
Replace the Public code :- 0x7f010044 #<public type="attr" name="type" id="0x7f010044" />
and in MySeekBarPreference.smali and in AnimationSpeeds.smali compare with my public ids and replace them
Click to expand...
Click to collapse
i get a new public code and must replace the similar code in R$styleable.smali?
And also in MySeekBarPreference.smali and AnimationSpeed.smali? Right?
Thx for your help.
I love this mod, so i want to try it on my own.
Add new animation?
How can I add the same animation that was on kitkat when you open an app or while you tap thumbnail on multitasking view? This animation in lollipop is missing
Can you help me to know what i did wrong?
dark90 said:
Can you help me to know what i did wrong?
Click to expand...
Click to collapse
You need to define seekbar preferences then you will get all
Another great tutorial from master @venkat kamesh :good:
venkat kamesh said:
You need to define seekbar preferences then you will get all
Click to expand...
Click to collapse
Thanks i got it.
The problem following you tut step by step is that you have 12seek_bar_preference.xml (defined in seekbarpreference.smali) and seek_bar_preference.xml (defined in myseekbarpreference.smali) and we only have seek_bar_preference.xml (defined on seekbarpreference.smali) and Just comparing the public id didnt gonnna work
dark90 said:
Thanks i got it.
The problem following you tut step by step is that you have 12seek_bar_preference.xml (defined in seekbarpreference.smali) and seek_bar_preference.xml (defined in myseekbarpreference.smali) and we only have seek_bar_preference.xml (defined on seekbarpreference.smali) and Just comparing the public id didnt gonnna work
Click to expand...
Click to collapse
In my settings I had 2 to 3 different seekbar bro
For this mod the seek bar out value should be px
The one in tut I have and the one 12seekbar are same brother.. You can compare
Any how it worked for you bro
Happy to hear
for that ppl that cant make it work (just the ppl who did all the things in op), just:
-download, uncompres and copy this file to your settings.apk/res/layout folder
-compile and decompìle to get the new public id
-open you settings.apk/res/value/public.xml and search <public type="layout" name="seekbar_preference" id
-open settings.apk/smali/com/android/settings/rz/myseekbarpreference.smali and go to the line 92 " const v1, 0x7f040103 # type="layout" name="seek_bar_preference "
-change the id for the one you find before in public.xml
-now compile and sign and you got it now working, well i hope xD
Great Job venkat
Sorry I forget modify some lines all works like a charm thanks bro
@dark90 mate
Thanks. Ur solution works like a charm..
dark90 said:
for that ppl that cant make it work (just the ppl who did all the things in op), just:
-download, uncompres and copy this file to your settings.apk/res/layout folder
-compile and decompìle to get the new public id
-open you settings.apk/res/value/public.xml and search <public type="layout" name="seekbar_preference" id
-open settings.apk/smali/com/android/settings/rz/myseekbarpreference.smali and go to the line 92 " const v1, 0x7f040103 # type="layout" name="seek_bar_preference "
-change the id for the one you find before in public.xml
-now compile and sign and you got it now working, well i hope xD
Click to expand...
Click to collapse
@dark90
This aint work bro, when i add your xml and try to compile, i have error cant find the ids in public.xml and i send you a pm btw.
I have it all except the switches
deleted
Related
[HOW TO] Extended Power Menu (reboot / download / recovery) with no header
This HOW TO is rewritten from a French tutorial (HERE) itself rewritten from a XDA tutorial (HERE, and modified using this other one : HERE
Thanks to :
Okarin
untermensch
PaoloM70
Click to expand...
Click to collapse
warnings :
- This tutorial is for people who know what they will do, a mistake can fit your phone unusable so ...
- A modification of system files is always a delicate operation, pay attention and do not rush
Click to expand...
Click to collapse
Prerequisites :
First and foremost, you must master the decompilation / recompilation of APK and JAR using APK_Manager and smali/baksmali.
Click to expand...
Click to collapse
Mod the power menu :
Here is the way to add the options "Reboot", "Recovery" and "Download" to the Power menu (long press the power button)
For this part, we will work on 2 files:
framework res.apk
android.policy.jar
Click to expand...
Click to collapse
You can decompile the first with APK Manager, and the second with baksmali.
1/ framework-res.apk :
Extract it with APK_Manager (extracted in /project folder)
a/ Then, before going any further, you will have to find three new .PNG images to be displayed in the power menu, and name them :
"ic_lock_reboot.png" for reboot menu
"ic_lock_recovery.png" to enter recovery
"ic_lock_download.png" for download Mode
Click to expand...
Click to collapse
Place these 3 images in the : APK_Manager/project/framework-res.apk/res/drawable-hdpi
where you will find the other pictures already in the menu concerned.
It is easier for beginners to add customised icons (like for power off, silent or plane modes icons )after recompilation, using 7zip for example. .
b/ With NotePad + +, edit the file " res/values/strings.xml "
Go to the end of the file, and add before the last line "</resources>", the three lines:
Code:
<string name="reboot_recovery">Recovery</string>
<string name="reboot_download">Download</string>
<string name="reboot">Reboot</string>
This should give you something like this:
{
"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"
}
c/ Save your file.
d/ Now you can recompile the file "framework-res.apk" with APK Manager.
Remember that this is an APK system and delete the "keep/resources.arsc", since we have modified an XML file.
You will have a your moded apk here : "place-apk-here-for-modding/unsignedframework-res.apk"
Warning: You should not have errors when you re-compil. don't forget to add 3 new icons;
e/ using APK-Manager, decompil "place-apk-here-for-modding/unsignedframework-res.apk".
*Go to res/values/public.xml and edit with Notepad ++
*public.xml is auto-generated from others modifications during APK_MANAGER re-compilation. 6 new lines have been added, with 6 new Hex numbers. You will need these numbers later ...
Look for :
Code:
<public type="string" name="reboot" id="[B]0x01040488[/B]" />
<public type="string" name="reboot_recovery" id="[B]0x01040489[/B]" />
<public type="string" name="reboot_download" id="[B]0x0104048a[/B]" />
and for :
Code:
<public type="drawable" name="ic_lock_reboot" id="[B]0x010803d2[/B]" />
<public type="drawable" name="ic_lock_recovery" id="[B]0x010803d3[/B]" />
<public type="drawable" name="ic_lock_download" id="[B]0x010803d4[/B]" />
f/ Now you just have to rename "place-apk-here-for-modding/unsignedframework-res.apk" to "framework-res.apk" and voila!
Edit : never sign a system File using APK_Manager.
Here is the first part ended.
A tip, try this file on your phone, if it restarts fine, then the mod is correct, otherwise you can start over
It is important to test step by step, because it lets you know exactly from witch file comes the error.
2/ Now, we attack the second file "android.policy.jar".
Once decompiled with baksmal, edit the "out/com/android/internal/policy/impl/GlobalActions.smali."
Caution: Do not confuse it with the file "GlobalActions$Action.Smali"
a/ Find the line ".method private createDialog()Landroid/app/AlertDialog;"
then a few lines below, replace "const/4 v9, 0x4" with "const/4 v9, 0x7".
This line indicates the number of menu entries of extinction, we move from 4 to 7 (3 mor entries). You should have this after the changes made:
b/ Then find the line "
Code:
invoke-static {v0}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
" and insert just above:
Code:
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
const v3, 0x10803d2
const v4, 0x1040488
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, 0x10803d3
const v4, 0x1040489
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
const/4 v1, 0x6
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$10;
const v3, 0x10803d4
const v4, 0x104048a
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
You will notice in the code, the previous hex numbers generated. You have to modify the hex numbers quoted with the hex numbers you found in step 2 after decompilation of unsignedframework-res.apk
Warning in this code, the hex numbers have a 0 in less after the "0x" like : 0x1234567... and not 0x011234567 like in string.xml[/COLOR]...
Please not in the code you just added the GlobalActions$8, GlobalActions$9, GlobalActions$10 : you will add files .smali with same name later. If in your firmware GlobalActions$8 is already existing, then modify the "$X" to follow last used number
To help, here's what you should have:
3/ If you want to remove the header of the extended power menu, not having to scroll,
a/ search for ".method private prepareDialog()",
then look a few lines below, you should find "const v4, 0x104014a"
where This hexadecimal digit corresponds to the entry "<public type="string"name="global_actions" id="0x0104014a" /> in the "public.xml" file, which itself refers to the text of the menu in" string.xml " :
b/ find the corresponding hexadecimal number 0xXXXXX to the entry "<string name="config_tether_apndata" />" in the "string.xml" file. This entry has no text.
Now replace in "const v4, 0x104014a" with "const v4, 0xXXXXX," so it will not show anything in the power menu.
Save the file.
c/ Come on, we're almost there ...
Now copy the "out/com/android/internal/policy/impl/GlobalActions$4.Smali" to "out/com/android/internal/policy/impl/GlobalActions$8.Smali".
We choose #4 because it is one that contains the shutdown of the phone. We will rename it 8 because it's 8 in the next free issue ...
Remember this if ever in a future version of the files they are change.
d/ Now open the new file "out/com/android/internal/policy/impl/GlobalActions$8.Smali" and replace in, all occurrences of "\GlobalActions$4" with "\GlobalActions$8"
Then, Replace :
Code:
const/4 v1, 0x1
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
With :
Code:
const/4 v1, 0x1
const-string v2, "now"
invoke-static {v0, v2, v1}, Lcom/android/internal/app/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
e/ Save the file and copy it to "out/com/android/internal/policy/impl/GlobalActions$9.Smali"
Open it and replace in, all occurrences of "\GlobalActions$8" with "\GlobalActions$9
and
const-string v2, "now" with const-string v2, "recovery"
f/ Save the file and copy it to "out/com/android/internal/policy/impl/GlobalActions$10.Smali"
Open it and replace in, all occurrences of "\GlobalActions$9" with "\GlobalActions$10
and
const-string v2, "recovery" with const-string v2, "download"
Save the file and then ... compile it all!
The result, you will see that I also forgot to replace an icon:
Thanks you! finally someone willing to write a tutorial on this.
great tutorial.
thanx, we all need help sometimes
Excellent. Now for a tutorial on how to get the mobile data toggle in the notification bar and we can all build custom roms.
Sent from my GT-I9100 using Tapatalk
Wow, u really went the whole 9 yards explaining this, thanks, as always grateful for ur sharing....
Seems like you put a lot of time and effort in this post.
Very good and clear instructions on something I wanted to add to my custom rom for a long time. (without just adding some files)
Thank you very much.
No credit for the how to you copied this from?
what a shame
http://forum.xda-developers.com/showthread.php?t=811532
Nice guide. Two things when using apkmanager:
1) Never ever edit the public.xml
2) When Recompiling: Never sign system files. Copy their signature!
Sent from my GT-I9100 using XDA Premium App
designgears said:
No credit for the how to you copied this from?
what a shame
http://forum.xda-developers.com/showthread.php?t=811532
Click to expand...
Click to collapse
as Cognition user i can only agree with "my" developer, that most of the statings above are simply coppied - Ctrl+a--->Ctrl+V ---> well done
_JKay_ said:
Nice guide. Two things when using apkmanager:
1) Never ever edit the public.xml
2) When Recompiling: Never sign system files. Copy their signature!
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
If we don't edit Public.xml, how are going to achieve this? I keep getting errors while recompiling using apkmanager? They sometimes don't even extract the resources.arsc and throw a lot of errors.
I'm working on adding a few options in the settings apk and neither apkmanger nor apktool is letting me decompile settings apk. It always throws errors. I need to decompile to edit a few xml in values which i don't find if i unzip it with 7-zip or winrar! Editing smali files is not a prob for now!
Any solutions?
@ sicopat
All three options call the Shutdown thread and present the "Your phone will shutdown" dialog. How do we change this?
And i also want to add the subtext in all three options in the main options, where are those located?
Ghostbustersin said:
If we don't edit Public.xml, how are going to achieve this? I keep getting errors while recompiling using apkmanager? They sometimes don't even extract the resources.arsc and throw a lot of errors.
I'm working on adding a few options in the settings apk and neither apkmanger nor apktool is letting me decompile settings apk. It always throws errors. I need to decompile to edit a few xml in values which i don't find if i unzip it with 7-zip or winrar! Editing smali files is not a prob for now!
Any solutions?
Click to expand...
Click to collapse
public.xml is auto-generated! Try add a string or a png and compile then decompile again. You will see that the new resources has been added to the public.xml
The ids MUST be unique and increased by one! Its all done in the apktool!
designgears said:
No credit for the how to you copied this from?
what a shame
http://forum.xda-developers.com/showthread.php?t=811532
Click to expand...
Click to collapse
You are totaly right.
I didn't find lines to modify,
I just built a new How To, from a french one I found here : http://www.galaxys-team.fr/viewtopic.php?f=6&t=14562
I believe this french How To took its inspiration from this thread : http://forum.xda-developers.com/showthread.php?t=811532
I didn't found this thread myself, you found it for me.
I finished to write this thread at 1h30 AM and I am going just now correct this mistake ...
Sorry for this
_JKay_ said:
Nice guide. Two things when using apkmanager:
1) Never ever edit the public.xml
2) When Recompiling: Never sign system files. Copy their signature!
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
1/ Why never edit public.xml ?
2/ You are right for that
_JKay_ said:
public.xml is auto-generated! Try add a string or a png and compile then decompile again. You will see that the new resources has been added to the public.xml
The ids MUST be unique and increased by one! Its all done in the apktool!
Click to expand...
Click to collapse
Ok but i never had errors using this How To and so, modifing public.xml.
But I will add your recommandation for people to try this How To, without modifing public.xml.
Thanks
sicopat said:
I insist on it here: only perform additions, never modify the images during the decompilation / recompilation of APK with APK_Manager.
Thanks
Click to expand...
Click to collapse
Why this statement? I'd rather say ONLY edit PNGs when decompiled!
_JKay_ said:
Why this statement? I'd rather say ONLY edit PNGs when decompiled!
Click to expand...
Click to collapse
Cause when using Apk manager, during re-compilation a keep folder is created and if you don't delete every files (and png) you modified in this keep folder, then after recompilation you will have olds .png from the keep folder and not your new png from your project folder.
It is easier to just push your new .png after recompilation.
I am just a noob who want to help a little with my short experience.
I am ready to learn and to optimise my how to
Sent from my GT-I9100 using XDA Premium App
sicopat said:
Cause when using Apk manager, during re-compilation a keep folder is created and if you don't delete every files (and png) you modified in this keep folder, then after recompilation you will have olds .png from the keep folder and not your new png from your project folder.
It is easier to just push your new .png after recompilation.
I am just a noob who want to help a little with my short experience.
I am ready to learn and to optimise my how to
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
Its true you need to delete the files you modify from the keep folder. But you should never try and modify 9patch pngs if they are not decompiled!!
_JKay_ said:
Its true you need to delete the files you modify from the keep folder. But you should never try and modify 9patch pngs if they are not decompiled!!
Click to expand...
Click to collapse
Yes i agree with you.
But in this How to, you don't need to edit 9patch.png
For begginers i think it's easier to push the customised reboot, power off, download mode icons ... after recompilation.
Sent from my GT-I9100 using XDA Premium App
sicopat said:
Yes i agree with you.
But in this How to, you don't need to edit 9patch.png
For begginers i think it's easier to push the customised reboot, power off, download mode icons ... after recompilation.
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
Ok...... But I think this could make beginners believe that this is always the case and how it should always be done. I rather teach them the right way
Hello guys today iam going to teach you how to add lidroid toggles in grid view in AOSP/CM/Stock roms.
Maybe i have forgot something so dont blame me Let me know it first and i will change it.
Things REQUIRED.
1.Patience [Heavily Needed]
2.Lots of time.
3.My provided files.Here: Public.xml and Lidroid_Resources.zip
4.Notepad++ etc.
The guide is divide into two parts.
1.XML PART [Includes xml editing ]
2.SMALI PART [ Includes smali editing ]
Lets start with XML PART first.
STEP 1
Open ids.xml under res/values foler and add these in last above
Code:
<item type="id" name="quickpanel_button">false</item>
<item type="id" name="quickpanel_text">false</item>
<item type="id" name="quickpanel_image">false</item>
<item type="id" name="quickpanel_indicator">false</item>
<item type="id" name="Lidroid">false</item>
STEP 2
Open dimens.xml under res/values foler and add these in last above
Code:
</resources>
Code:
quickpanel_button_height">79.0px
STEP 3
Open strings.xml under res/values foler and add these in last above
Code:
<string name="quickpanel_wifi_text">Wi-Fi</string>
<string name="quickpanel_bluetooth_text">Bluetooth</string>
<string name="quickpanel_gps_text">GPS</string>
<string name="quickpanel_sound_text">Sound</string>
<string name="quickpanel_sound_vibration_text">"Sound Vibration"</string>
<string name="quickpanel_silent_text">Silent</string>
<string name="quickpanel_vibration_text">Vibration</string>
<string name="quickpanel_rotation_text">"Auto rotation"</string>
<string name="quickpanel_shutdown_text">Phone will be shutdown</string>
<string name="quickpanel_shutdown_confirm">Shutdown</string>
<string name="quickpanel_sound_vibrate">Vibrate</string>
<string name="quickpanel_sound_sound">Sound</string>
<string name="quickpanel_sound_silent">Silent</string>
<string name="quickpanel_sound_sound_vibrate">Sound Vibrate</string>
<string name="quickpanel_sync">Sync</string>
<string name="quickpanel_wifiap">Wifi Ap</string>
<string name="quickpanel_wifi">Wifi</string>
<string name="quickpanel_rotation">Auto Rotate</string>
<string name="quickpanel_airplane">Airplane</string>
<string name="quickpanel_bluetooth">Bluetooth</string>
<string name="quickpanel_brightness">Brightness</string>
<string name="quickpanel_flashlight">Flashlight</string>
<string name="quickpanel_gps">GPS</string>
<string name="quickpanel_lockscreen">Lockscreen</string>
<string name="quickpanel_mobiledata">Data</string>
<string name="quickpanel_reboot">Reboot</string>
<string name="quickpanel_reboot_text">Phone will reboot</string>
<string name="quickpanel_screen_timeout">Screen Timeout</string>
<string name="quickpanel_recovery">Recovery</string>
STEP 5
Delete these if they are already present
Code:
<string name="quickpanel_wifi_text">Wi-Fi</string>
<string name="quickpanel_bluetooth_text">Bluetooth</string>
<string name="quickpanel_gps_text">GPS</string>
<string name="quickpanel_sound_text">Sound</string>
<string name="quickpanel_sound_vibration_text">"Sound Vibration"</string>
<string name="quickpanel_silent_text">Silent</string>
<string name="quickpanel_vibration_text">Vibration</string>
<string name="quickpanel_rotation_text">"Auto rotation"</string>
STEP 6
Merge attached files with your SystemUI.apk
STEP 7
Recompile Your App.
STEP 8
Decompile it again.
STEP 9
Open Statusbar_expanded.xml or any other xml where you want to place lidroid toggles.
STEP 10
And Add this where you want to place the lidroid toggles.
Code:
<com.lidroid.systemui.quickpanel.PowerWidget android:id="@id/Lidroid" android:layout_width="fill_parent" android:layout_height="wrap_content" />
Now lets complete the SMALI PART
SMALI PART
STEP 11
Open com/android/systemui/statusbar/StatusBarService.smali
STEP12
In
Code:
# instance fields
Below
Code:
.field mPositionTmp:[I
Add this line
Code:
.field mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
STEP 13
In
Code:
.method private makeStatusBarView(Landroid/content/Context;)V
Add this in last above
Code:
.line (A numeric value will be there)
return-void
.line 656
iget-object v5, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;
const v6, 0x7f090039
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object v5, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v6}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
STEP 14
Open your public.xml
Search for "Lidroid" id and copy its public id and replace it with id of above code i.e with "0x7f090039"
STEP 15
OPEN Statusbarservice.smali again
STEP 16
In
Code:
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
Add this in last above
Code:
.line (A numeric value will be there)
return-void
Code:
.line 1900
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->updateWidget()V
NOTE..
Here "0x7f090039" is the public id of id "Lidroid"
STEP17
Now open all files in com/lidroid/systemui/quickpanel folder
Search "0x7f" Copy the whole id .
Open my provided public.xml
Search for that id in my public.xml
Copy the text of that id.
Like if my Public id is "0x7f030011"
Then i will copy "quickpanel_button".
Now find same text in your public.xml
Copy its public id .
And replace the id of all smali files with your public.xml's id.
Similarly do this with all smali files available in quickpanel folder.
STEP 18
Now open your apps Android-Manifest.xml.
And add this in last above
Code:
</application>
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" />
Since You have edited Android-Manifest.xml you need to sign apk file.
STEP 19
Recompile it .
STEP 20
Sign it.
And push to system/app
CREDITS;;
ryanfebriyadi
PineappleOwl
MuSaddiq
Lidroid
serajr
{
"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"
}
Reserved for more....
Reserved
Edit : If i want to place it in ROM, so i must sign all the apk of my ROM ?
Sent from my GT-S5360 using xda app-developers app
Thanks for sharing!
Please help me.. After i flash costum kernel Merruk v.2.5 ,, i have problem charge batrai pada saat hp off tidak ada gambar batrai charger.. Please help me... Sorry i bad english
awesome guide sir!!!!!!
HAS anyone tried?
Sent from my GT-S5360 using Tapatalk 2
aemier said:
Please help me.. After i flash costum kernel Merruk v.2.5 ,, i have problem charge batrai pada saat hp off tidak ada gambar batrai charger.. Please help me... Sorry i bad english
Click to expand...
Click to collapse
I cant undersrtand what are u saying?
Sent from my GT-S5360 using Tapatalk 2
Hi. U guided me once. And it works but toogles are misplaced. I looked at every file but cant see anything wrong. Here is my systemui, so if u have time , could you take a look at it? TIA
hi sir san, what if we already have a lidroid toggles and we want to make it grid?
Sent from my GT-S5360 using xda premium
m4RinKo2 said:
Hi. U guided me once. And it works but toogles are misplaced. I looked at every file but cant see anything wrong. Here is my systemui, so if u have time , could you take a look at it? TIA
Click to expand...
Click to collapse
The problem is in Powerwidget.smali
the id if dimens file us misplaced.
Sent from my GT-S5360 using Tapatalk 2
markmellarpes said:
hi sir san, what if we already have a lidroid toggles and we want to make it grid?
Sent from my GT-S5360 using xda premium
Click to expand...
Click to collapse
If lidroid toggles are with lidroid-res.apk and was by lidroid's guide then you need to follow whole guide.
Sent from my GT-S5360 using Tapatalk 2
After change the kernel merruk v.2.5 ..when the battery charge at the time of hp off I can not see the picture batrai charging... Please help me.. .. Sorry i bad english
Sent from my GT-S5360 using xda premium
@san
there is an even easier easier way to add lidroid.
use the smali by mariozawa
and also assign all layoutsnpngs ids and such all in the lidroid res apk.
so the newbies dont need to fix the const values and only need to add the smali folders and add 1 line to layout
Sent from my S500 using xda app-developers app
public.xml can't download...
please give me another link
what do you use for signing? XD can you teach mo how to sign? please.
Aleemk9 said:
public.xml can't download...
please give me another link
Click to expand...
Click to collapse
It works fine.Try downloading with other browsers.
Luwiji said:
what do you use for signing? XD can you teach mo how to sign? please.
Click to expand...
Click to collapse
I cant say i use lots of apps.
You an google any one which u like
Btw i mostly use signapk ++
Sent from my GT-S5360 using Tapatalk 2
san122 said:
It works fine.Try downloading with other browsers.
I cant say i use lots of apps.
You an google any one which u like
Btw i mostly use signapk ++
Sent from my GT-S5360 using Tapatalk 2
Click to expand...
Click to collapse
downloaded.
now All thing is ready for following your guide.
success... but not showing brightness slider.
anyway plz tell me how to mov this lidroid taggels to quick panel button ??
First of all: this guide is based off the guide by @lukakas found here http://forum.xda-developers.com/showthread.php?t=2460877
I tweaked it to get it to work on CM11, comparing the files of the Z2 system dump, the 4.3 resources provided in the guide by @lukakas and compared the difference with CM11 files.
In this guide I am using OPENsemc rom beta 3, wich is CyanogenMod 11 / Android KitKat
Before flashing the files, perform a FULL BACKUP in case something goes wrong!
Code:
I will NOT be held responsible if something happens to your device while or after flashing any of these files! All flashing is done at your OWN RISK.
I recommend using Virtuous Ten Studio for editing the files. It can be downloaded from: http://www.virtuous-ten-studio.com/index.php/downloads
Setting up Virtuous Ten Studio
Click on “File” then on “Open Settings” then proceed to ApkTool, and install Framework-res.apk from the rom you are trying to port SmallApps to by clicking on “Add single framework”
{
"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"
}
Android.policy.jar
Click on “Open” then on “New Project” and import anroid.policy.jar as shown below:
(note, in properties/settings click on “Smali” and make sure the API is set to 4.4 KitKat)
Now open smali\com\android\internal\policy\impl\PhoneWindowManager.smali and select checkAddPermission from the dropdown menu
Find and alter the following lines of code: (added code is marked in green)
.method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;[I)I
(Lines of code not needed in the part of the tutorial has been cut, do not delete them though)
:cond_1
const/4 v0, 0x0
.line 1609
.local v0, permission:Ljava/lang/String;
sparse-switch v1, :sswitch_data_0
(Lines of code not needed in the part of the tutorial has been cut, do not delete them though)
:sswitch_1
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
.line 1627
const/16 v3, 0x18
aput v3, p2, v2
goto :goto_1
.line 1397 - This number should be a new number and should not be found elsewhere in this document
:sswitch_2
const-string v0, "com.sony.smallapp.permission.SMALLAPP"
.line 1398 - This number should be a new number and should not be found elsewhere in this document
goto :goto_1
.line 1609 - This number must match the number above the line.local v0, permission:Ljava/lang/String;
nop
:sswitch_data_0
.sparse-switch
0x7d2 -> :sswitch_1
0x7d3 -> :sswitch_1
0x7d5 -> :sswitch_0
0x7d6 -> :sswitch_1
0x7d7 -> :sswitch_1
0x7da -> :sswitch_1
0x7db -> :sswitch_0
0x7dd -> :sswitch_0
0x7e7 -> :sswitch_0
0xbb5 -> :sswitch_2
0xbb6 -> :sswitch_2
.end sparse-switch
.end method
Press control s to save the document and recompile it: (use right click on android.policy and click “Build project”
Framework2.jar
For this step, import and decompile Framework2.jar like in steps show above. Right click on “framework2” and select “Open in windows explorer”
In the explorer screen, navigate to Data/smali/com, copy and paste the “sony” folder provided in the resources zip. Once done, right click on “framework2” and select “Reload project”
Once the project has reloaded, right click on “framework2” and select “Build project”
Framework-res.apk
Import framework-res.apk into the project.
Note: make sure before importing that in the Apk-Tool section you select “Use newest ApkTool” and that you select the Framework tag. (Remember you installed framework-res.apk earlier?)
Once framework-res.apk has imported, open AndroidManifest.XML
Add the lines marked in green like below.
<permission android:name="com.sony.smallapp.permission.CONTROL_SMALLAPP" androidrotectionLevel="system|signature" />
<permission android:label="@string/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" androidrotectionLevel="dangerous" android:description="@string/permdesc_smallapp" />
<permission android:label="@string/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" androidrotectionLevel="signatureOrSystem" android:description="@string/permdesc_taskSwitcherPluginView" />
<permission android:name="com.sonymobile.permission.ACCESS_BEACON_MANAGER" androidrotectionLevel="system|signature" />
Don’t forget to save the modifications you just made.
Next up: open res/values/ and open “strings.xml”
At the end of the file, copy the green lines:
<string name="permlab_smallapp">Small application overlay</string>
<string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>
<string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string>
<string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher</string>
Save your modifications and and “Build project”
SystemUI.apk
This part can be the trickiest and can cause a lot of headache. Import SystemUI.apk and open AndroidManifest.xml
Note: make sure before importing that in the Apk-Tool section you select “Use newest ApkTool” and that you select the Framework tag.
Add the lines marked in green like below.
<uses-permission android:name="com.sonymobile.permission.XSSM_PROVIDER" />
<uses-permission android:name="com.sonymobile.permission.XSSM" />
<uses-permission android:name="android.permission.BIND_APPWIDGET" />
<uses-permission android:name="com.sony.smallapp.app.widget.permission.BIND_SMALLAPP_WIDGET_MANAGER" />
<uses-permission android:name="com.sony.smallapp.permission.SMALLAPPMANAGER_CONTROL" />
<uses-permission android:name="com.sony.smallapp.launcher.permission.ACCESS_DATABASE" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<permission android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" androidrotectionLevel="normal" />
Add the lines marked in green like below. (in Recents Activity)
<action android:name="com.android.systemui.recent.action.OPEN_RECENTS_INTENT_FROM_SMALL_APP_LAUNCHER" />
Now navigate to res/values/ and open “attrs.xml”
Add the line marked in green at the end of the file:
<attr name="lookupKey" format="string" />
Now navigate to res/values/ and open “ids.xml”
Add the line marked in green at the end of the file:
<item type="id" name="recent_wipe_app">false</item>
<item type="id" name="recents_inject_custom_view">false</item>
<item type="id" name="recents_layout">false</item>
<item type="id" name="recents_pluginview_container">false</item>
Now navigate to res/values/ and open “public.xml”
Since we will be working with hex id’s, a word of advice.
Always create a new hex id in this file. Duplicating other hex number will result in a fail when trying to recompile
As an example:
<public type="attr" name="maxSize" id="0x7f010008" />
<public type="attr" name="holdTime" id="0x7f010009" />
<public type="attr" name="decayTime" id="0x7f01000a" />
<public type="attr" name="orientation" id="0x7f01000b" />
<public type="attr" name="singleRow" id="0x7f01000c" />
<public type="attr" name="lookupKey" id="0x7f01000d" />
Notice that all the hex number are sequential? All these numbers are only found once in the entire document. If I were to add another line below LookupKey it would look like this:
<public type="attr" name="Tutorial" id="0x7f01000e" />
When in doubt as to if the number you assigned to a line, just copy the hex number and use control f to search for it. When you can’t find another line with that number, you know that your hex number is one of a kind.
Let’s get started shall we.
First of all locate the last “attr” line and add the line below marked in green:
<public type="attr" name="lookupKey" id="PUT_HEX_HERE" />
Locate the last “layout” line (like where you put LookupKey in the example above) and add line below marked in green:
<public type="layout" name="plugin_view" id="PUT_HEX_HERE" />
Locate the last “id” line and do the same with the line below
<public type="id" name="recents_inject_custom_view" id=" PUT_HEX_HERE" " />
<public type="id" name="recents_layout" id=" PUT_HEX_HERE" " />
<public type="id" name="recents_pluginview_container" id=" PUT_HEX_HERE" " />
Now copy and paste (and overwrite) the files in the resources to res/layout and res/layout-land.
Now copy and paste (and overwrite) the .smali files in the resources to com/android/systemui and com/android/systemui/recent
Before going any further, don’t forget to save ALL the modifications you made and after that you need to right click on “SystemUI” and click on “Reload project”
Now open up RecentsActivity.smali
Virtuous Ten Studio helps you in which lines you need to alter. Every line that has an hex id will be marked by a little blue box
In the example above, 0x7f07007f represents “recents_pluginview_container” you need to change that hex number to the number you assigned to it earlier in “public.xml”
You need to change every hex number in this file to match the hex numbers you assigned earlier.
These are:
recents_pluginview_container
recents_layout
plugin_view
status_bar_recent_panel
recents_root
config_recent_item_min_alpha
recents_pluginview_container
recents_return_to_launcher_enter
recents_return_to_launcher_exit
Note that the list above is in the same order as the lines containing the hex numbers in RecentsActivity.smali. This means that “recents_pluginview_container” represents the first hex number, “recents_layout” the second, “plugin_view” the third etc. etc.
Once that is done, save the file and open R$styleable.smali.
Find line: sput-object v0, Lcom/android/systemui/R$styleable;->RecentsPanelView:[I
Change that hex id to match the id for LookupKey, you added that in “public.xml”.
Save all modifications and build your project.
Zip up all the files in a flashable zip and start flashing
These are all the steps I made to get it working, I hope this guide will help others to port SmallApps/Taskswitcher.
nice i will try when i come home.
thanks the guide
Sent from my LT26i using xda app-developers app
Well done!
@Kevin-0100, mate where to find Recent Activity? is it in the " smali\com\android\systemui\recent " ??
EDIT: found it already :3
@Kevin-0100
EDIT: im having these errors while doing the last step mate. pls help
In the top bar in VTS, click on view log. There you will find which lines are causing the build error. Are you trying to port it tot OmniRom? If so you should not copy and paste the .smali files in my resources as they come from another ROM (opensemc). Try using the .smali files from the OmniRom
Sent from my Xperia S using XDA Premium 4 mobile app
Ohh ok tnx mate
Sent from my LT26ii using xda premium
Error on
\res\layout\status_bar_recent_panel.xml:11: error: Error: No resource found that matches the given name (at 'id' with value '@id/recents_clear').'
\res\layout-land\status_bar_recent_panel.xml:11: error: Error: No resource found that matches the given name (at 'id' with value '@id/recents_clear').'
what should I do
Using Beanstalk ROM
I found similar error and fix by find some similar picture
I already change @drawable/ic_recents_clear to @drawable/ic_notify_clear_normal in both status_bar_recent_panel.xml
@MaDMaT80 can you add this taskswitcher and small apps to your 4.4 kitkat rom..it would be awsome..
Sent from my LT28h using Tapatalk
nut27455 said:
Error on
\res\layout\status_bar_recent_panel.xml:11: error: Error: No resource found that matches the given name (at 'id' with value '@id/recents_clear').'
\res\layout-land\status_bar_recent_panel.xml:11: error: Error: No resource found that matches the given name (at 'id' with value '@id/recents_clear').'
what should I do
Using Beanstalk ROM
I found similar error and fix by find some similar picture
I already change @drawable/ic_recents_clear to @drawable/ic_notify_clear_normal in both status_bar_recent_panel.xml
Click to expand...
Click to collapse
You need to go to res/values/ids and make a new value for recents_clear. That should fix it
Sent from my C1905 using XDA Premium 4 mobile app
Kevin-0100 said:
You need to go to res/values/ids and make a new value for recents_clear. That should fix it
Sent from my C1905 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Thank you it work for build.
But FC when open recent in phone.
Anyway thank you for sharing this.
If you get a logcat you could try finding the reason for the FC
Sent from my C1905 using XDA Premium 4 mobile app
Got it
I/dalvikvm(3258): Could not find method com.android.systemui.recent.RecentsActivity.dismissAndDoNothing, referenced from method com.android.systemui.recent.RecentsPanelView.dismissAndDoNothing
W/dalvikvm(3258): VFY: unable to resolve virtual method 4171: Lcom/android/systemui/recent/RecentsActivity;.dismissAndDoNothing ()V
There is an error in your RecentsActivity.smali. Open that file and search for PanelView and see if everything is correct. I think the FC may be caused by an error in the PanelView section.
Sent from my C1905 using XDA Premium 4 mobile app
@Kevin-0100
I can't understant last step.In oldu version. 10.1 Op write the line which we must past the hex code at the public. Find the blué line in RecentsActivity.smali but which is the "recents_pluginview_container" or "recents_layout" cant find.
You will not find "recents_activity" etc. In Recentsactivity.smali the names are replaced with hex numbers. Follow the last step precisely (using virtuous ten studio) and you will find which lines to edit
Sent from my C1905 using XDA Premium 4 mobile app
Good working i'll be add my rom. Thanks
Kevin-0100 said:
First of all: this guide is based off the guide by @lukakas found here http://forum.xda-developers.com/showthread.php?t=2460877
I tweaked it to get it to work on CM11, comparing the files of the Z2 system dump, the 4.3 resources provided in the guide by @lukakas and compared the difference with CM11 files.
In this guide I am using OPENsemc rom beta 3, wich is CyanogenMod 11 / Android KitKat
Before flashing the files, perform a FULL BACKUP in case something goes wrong!
Code:
I will NOT be held responsible if something happens to your device while or after flashing any of these files! All flashing is done at your OWN RISK.
I recommend using Virtuous Ten Studio for editing the files. It can be downloaded from: http://www.virtuous-ten-studio.com/index.php/downloads
Setting up Virtuous Ten Studio
Click on “File” then on “Open Settings” then proceed to ApkTool, and install Framework-res.apk from the rom you are trying to port SmallApps to by clicking on “Add single framework”
Android.policy.jar
Click on “Open” then on “New Project” and import anroid.policy.jar as shown below:
(note, in properties/settings click on “Smali” and make sure the API is set to 4.4 KitKat)
Now open smali\com\android\internal\policy\impl\PhoneWindowManager.smali and select checkAddPermission from the dropdown menu
Find and alter the following lines of code: (added code is marked in green)
.method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;[I)I
(Lines of code not needed in the part of the tutorial has been cut, do not delete them though)
:cond_1
const/4 v0, 0x0
.line 1609
.local v0, permission:Ljava/lang/String;
sparse-switch v1, :sswitch_data_0
(Lines of code not needed in the part of the tutorial has been cut, do not delete them though)
:sswitch_1
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
.line 1627
const/16 v3, 0x18
aput v3, p2, v2
goto :goto_1
.line 1397 - This number should be a new number and should not be found elsewhere in this document
:sswitch_2
const-string v0, "com.sony.smallapp.permission.SMALLAPP"
.line 1398 - This number should be a new number and should not be found elsewhere in this document
goto :goto_1
.line 1609 - This number must match the number above the line.local v0, permission:Ljava/lang/String;
nop
:sswitch_data_0
.sparse-switch
0x7d2 -> :sswitch_1
0x7d3 -> :sswitch_1
0x7d5 -> :sswitch_0
0x7d6 -> :sswitch_1
0x7d7 -> :sswitch_1
0x7da -> :sswitch_1
0x7db -> :sswitch_0
0x7dd -> :sswitch_0
0x7e7 -> :sswitch_0
0xbb5 -> :sswitch_2
0xbb6 -> :sswitch_2
.end sparse-switch
.end method
Press control s to save the document and recompile it: (use right click on android.policy and click “Build project”
Framework2.jar
For this step, import and decompile Framework2.jar like in steps show above. Right click on “framework2” and select “Open in windows explorer”
In the explorer screen, navigate to Data/smali/com, copy and paste the “sony” folder provided in the resources zip. Once done, right click on “framework2” and select “Reload project”
Once the project has reloaded, right click on “framework2” and select “Build project”
Framework-res.apk
Import framework-res.apk into the project.
Note: make sure before importing that in the Apk-Tool section you select “Use newest ApkTool” and that you select the Framework tag. (Remember you installed framework-res.apk earlier?)
Once framework-res.apk has imported, open AndroidManifest.XML
Add the lines marked in green like below.
<permission android:name="com.sony.smallapp.permission.CONTROL_SMALLAPP" androidrotectionLevel="system|signature" />
<permission android:label="@string/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" androidrotectionLevel="dangerous" android:description="@string/permdesc_smallapp" />
<permission android:label="@string/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" androidrotectionLevel="signatureOrSystem" android:description="@string/permdesc_taskSwitcherPluginView" />
<permission android:name="com.sonymobile.permission.ACCESS_BEACON_MANAGER" androidrotectionLevel="system|signature" />
Don’t forget to save the modifications you just made.
Next up: open res/values/ and open “strings.xml”
At the end of the file, copy the green lines:
<string name="permlab_smallapp">Small application overlay</string>
<string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>
<string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string>
<string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher</string>
Save your modifications and and “Build project”
SystemUI.apk
This part can be the trickiest and can cause a lot of headache. Import SystemUI.apk and open AndroidManifest.xml
Note: make sure before importing that in the Apk-Tool section you select “Use newest ApkTool” and that you select the Framework tag.
Add the lines marked in green like below.
<uses-permission android:name="com.sonymobile.permission.XSSM_PROVIDER" />
<uses-permission android:name="com.sonymobile.permission.XSSM" />
<uses-permission android:name="android.permission.BIND_APPWIDGET" />
<uses-permission android:name="com.sony.smallapp.app.widget.permission.BIND_SMALLAPP_WIDGET_MANAGER" />
<uses-permission android:name="com.sony.smallapp.permission.SMALLAPPMANAGER_CONTROL" />
<uses-permission android:name="com.sony.smallapp.launcher.permission.ACCESS_DATABASE" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<permission android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" androidrotectionLevel="normal" />
Add the lines marked in green like below. (in Recents Activity)
<action android:name="com.android.systemui.recent.action.OPEN_RECENTS_INTENT_FROM_SMALL_APP_LAUNCHER" />
Now navigate to res/values/ and open “attrs.xml”
Add the line marked in green at the end of the file:
<attr name="lookupKey" format="string" />
Now navigate to res/values/ and open “ids.xml”
Add the line marked in green at the end of the file:
<item type="id" name="recent_wipe_app">false</item>
<item type="id" name="recents_inject_custom_view">false</item>
<item type="id" name="recents_layout">false</item>
<item type="id" name="recents_pluginview_container">false</item>
Now navigate to res/values/ and open “public.xml”
Since we will be working with hex id’s, a word of advice.
Always create a new hex id in this file. Duplicating other hex number will result in a fail when trying to recompile
As an example:
<public type="attr" name="maxSize" id="0x7f010008" />
<public type="attr" name="holdTime" id="0x7f010009" />
<public type="attr" name="decayTime" id="0x7f01000a" />
<public type="attr" name="orientation" id="0x7f01000b" />
<public type="attr" name="singleRow" id="0x7f01000c" />
<public type="attr" name="lookupKey" id="0x7f01000d" />
Notice that all the hex number are sequential? All these numbers are only found once in the entire document. If I were to add another line below LookupKey it would look like this:
<public type="attr" name="Tutorial" id="0x7f01000e" />
When in doubt as to if the number you assigned to a line, just copy the hex number and use control f to search for it. When you can’t find another line with that number, you know that your hex number is one of a kind.
Let’s get started shall we.
First of all locate the last “attr” line and add the line below marked in green:
<public type="attr" name="lookupKey" id="PUT_HEX_HERE" />
Locate the last “layout” line (like where you put LookupKey in the example above) and add line below marked in green:
<public type="layout" name="plugin_view" id="PUT_HEX_HERE" />
Locate the last “id” line and do the same with the line below
<public type="id" name="recents_inject_custom_view" id=" PUT_HEX_HERE" " />
<public type="id" name="recents_layout" id=" PUT_HEX_HERE" " />
<public type="id" name="recents_pluginview_container" id=" PUT_HEX_HERE" " />
Now copy and paste (and overwrite) the files in the resources to res/layout and res/layout-land.
Now copy and paste (and overwrite) the .smali files in the resources to com/android/systemui and com/android/systemui/recent
Before going any further, don’t forget to save ALL the modifications you made and after that you need to right click on “SystemUI” and click on “Reload project”
Now open up RecentsActivity.smali
Virtuous Ten Studio helps you in which lines you need to alter. Every line that has an hex id will be marked by a little blue box
In the example above, 0x7f07007f represents “recents_pluginview_container” you need to change that hex number to the number you assigned to it earlier in “public.xml”
You need to change every hex number in this file to match the hex numbers you assigned earlier.
These are:
recents_pluginview_container
recents_layout
plugin_view
status_bar_recent_panel
recents_root
config_recent_item_min_alpha
recents_pluginview_container
recents_return_to_launcher_enter
recents_return_to_launcher_exit
Note that the list above is in the same order as the lines containing the hex numbers in RecentsActivity.smali. This means that “recents_pluginview_container” represents the first hex number, “recents_layout” the second, “plugin_view” the third etc. etc.
Once that is done, save the file and open R$styleable.smali.
Find line: sput-object v0, Lcom/android/systemui/R$styleable;->RecentsPanelView:[I
Change that hex id to match the id for LookupKey, you added that in “public.xml”.
Save all modifications and build your project.
Zip up all the files in a flashable zip and start flashing
These are all the steps I made to get it working, I hope this guide will help others to port SmallApps/Taskswitcher.
Click to expand...
Click to collapse
when i recompile, erro RecentsActivity$1.smali show screenshotView attachment 2715043
You should use apktool 1.5.2 and not 2.0 beta (you are probably using he beta version
Kevin-0100 said:
You should use apktool 1.5.2 and not 2.0 beta (you are probably using he beta version
Click to expand...
Click to collapse
Can you prapere video. i think better than this. Thanks.
carlito-lt26i said:
when i recompile, erro RecentsActivity$1.smali show screenshotView attachment 2715043
Click to expand...
Click to collapse
+1
Hello today I am Bring My first thread how to ad AF Volume Panel to Android Mobile Its Very Easy Methods to Do it. I have waste many time to do make some smali codes so don't kang this smali .ok Lets Start
Requirement:
Apktool http://forum.xda-developers.com/showthread.php?t=1755243
Framework.jar from ur phone
Framework-res.apk from ur phone
Nice Brain to Understand
Instructions:
Step 1 :- Decompile Framework-res.apk
Step 2 :- Open decompiled folder / values / ids.xml and Merged down the Framework-res.zip with ur Decompiled Folder
Step 3 :-
Code:
<item type="id" name="warning_message_af">false</item>
before </resources>
Step 4 :- Open layout/volume_adjust.xml Remove All lines
Step 5 :- Add This
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:background="@drawable/panel_background" android:layout_width="300.0dip" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/message" android:layout_width="0.0dip" android:layout_height="0.0dip" />
<TextView android:textAppearance="?textAppearanceSmall" android:id="@id/additional_message" android:layout_width="0.0dip" android:layout_height="0.0dip" />
<LinearLayout android:gravity="left|center" android:orientation="horizontal" android:layout_width="280.0dip" android:layout_height="45.0dip" android:layout_marginTop="6.0dip" android:layout_marginBottom="6.0dip">
<ImageView android:id="@id/other_stream_icon" android:padding="0.0dip" android:layout_width="42.0dip" android:layout_height="32.0dip" />
<ImageView android:id="@id/ringer_stream_icon" android:padding="0.0dip" android:layout_width="42.0dip" android:layout_height="32.0dip" />
<ProgressBar android:id="@id/level" android:layout_width="215.0dip" android:layout_height="32.0dip" android:layout_marginRight="16.0dip" android:progressDrawable="@drawable/progress_volume_adjust" style="?android:attr/progressBarStyleHorizontal" />
<TextView android:textAppearance="?textAppearanceSmall" android:id="@id/warning_message_af" android:layout_width="195.0dip" android:layout_height="wrap_content" android:layout_marginLeft="15.0dip" android:layout_marginTop="3.0dip" android:layout_marginRight="15.0dip" android:layout_marginBottom="5.0dip" />
</LinearLayout>
</LinearLayout>
Step 6 :- Recompile the framework-res.apk
Step 7 :- Decompile The Output framework-res.apk one
Step 8 :- Open values/public.xml
Step 9 :- Search for
Code:
<public type="id" name="warning_message"
Step 10 :- Note Down public id we need
Step 11 :- Decompile framework.jar
Step 12 :- Downloads The Attachment and merged with ur Decompiled folder
Step 13 :- Open smali / android / view
Step 14 :- Open VolumePanel
Step 15 :- Search for 0x1020263
Step 16 :- You will See
HTML:
.line 148
const v4, 0x1020263
invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v4
check-cast v4, Landroid/widget/TextView;
iput-object v4, p0, Landroid/view/VolumePanel;->mWarningMessage:Landroid/widget/TextView;
Step 17 :- Change smali codes first list five digit like if my warning_message_af is 0x01020265] Volume Panel ids is 0x1020263
then we have replace waring public codes id to volume panel ids only last five digit
Step 18 :- Recompile The Framework.jar
Step 19 :- Sign The The Two apps
Step 20:- Push to ur phone
Step 21 :- Happy Modding
Result:
{
"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"
}
hey sir @AndroidFire i got error at [email protected]_volume_adjust
Mranggapo said:
hey sir @AndroidFire i got error at [email protected]_volume_adjust
Click to expand...
Click to collapse
Give me Logs of Your Error
Edit: Follow These Guide http://forum.xda-developers.com/showthread.php?t=2806060
@op Can i add your guide on my thread ?
Sure
AbhiLP said:
@op Can i add your guide on my thread ?
Click to expand...
Click to collapse
:good: Yeah Sure by pressing Thanks and Giving Proper Credit check my other guide maybe useful for u http://forum.xda-developers.com/showpost.php?p=53960404&postcount=2
Hi
Thanks alot
I change my volume panel
--------------
Is a way to add sound setting to volume panel??
Excuse me For MY Bad ENGLISH
danial199 said:
Hi
Thanks alot
I change my volume panel
--------------
Is a way to add sound setting to volume panel??
Excuse me For MY Bad ENGLISH
Click to expand...
Click to collapse
Thx
I have already try I have make it when I implemented to the system it is exception and so I drop this project
Sent from my SM-G530H using XDA Free mobile app
AndroidFire said:
Thx
I have already try I have make it when I implemented to the system it is exception and so I drop this project
Sent from my SM-G530H using XDA Free mobile app
Click to expand...
Click to collapse
So there isnt any way??
You dont try again?
Do not do another one?
Excuse me for bad English
This mod will add a Calculator to your SystemUI.
I recommend that you use mods that will provide additional layouts space/tabs to your SystemUI such as SystemUI Tabs.
Note: Smali files were decompiled using apktool_2.0.0b9, so pls use the same apktool version in decompiling and recompiling your SystemUI.apk
Adding the calculator on SystemUI:
Steps:
1. Decompile your SystemUI.apk
2. Download the attachment (Use the latest version, It contains the needed smali files).
3. Extract the zip file to your decompiled SystemUI.apk folder (/SystemUI.apk/here).
Note: Starting v0.2, you have the option to customize the appearance of your calculator, If you don't want to customize it just extract the SMALI files ONLY, but if you want to customize it further, extract the RES and SMALI folders from the zip file.
4. Open your status_bar_expanded.xml (/SystemUI.apk/res/layout/status_bar_expanded.xml).
5. Insert this code:
Code:
<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.jeremypacabis.statusbarmods.CalculatorOnSystemUI android:layout_width="match_parent" android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
after
Code:
xmlns:android="http://schemas.android.com/apk/res/android">
OR anywhere in your layout where there is a free space or free layout such as a Tab in your SystemUI.
6. Recompile your SystemUI.apk
7. Push of Flash your SystemUI.apk
Now, you are done adding the calculator on your SystemUI, If you want to customize it (starting CalcOnSystemUI_v0,2), proceed with the next steps:
Customizing the appearance of calculator on SystemUI:
1. Extract the RES folder from the attachment (if you have not extracted it from the previous steps above) into /SystemUI.apk/here.
2. Recompile your SystemUI.apk
3. Decompile your SystemUI.apk into a new location
4. Open public.xml (/SystemUI.apk/res/values/public.xml) and take note of these public ids:
Code:
<public type="drawable" name="calc_display" id="0x7f020179" />
<public type="drawable" name="btnc" id="0x7f020172" />
<public type="drawable" name="btn" id="0x7f02016c" />
Note: These public ids MIGHT BE DIFFERENT from what you will get after recompiling and decompiling your SystemUI.apk, its ok, just take note of them.
5. Open CalculatorOnSystemUI,smali (/SystemUI.apk/smali/com/jeremypacabis/statusbarmods/CalculatorOnSystemUI.smali) and search for these:
Code:
const v0, 0x1080004 # Replace 0x1080004 with your customized number button drawable public id, by default it is android.R.drawable.btn_default
const v0, 0x1080005 # Replace 0x1080005 with your customized operation button drawable public id, by default it is android.R.drawable.btn_default_small
const v0, 0x108001c # Replace 0x108001c with your customized advanced op button drawable public id, by default it is android.R.drawable.gallery_thumb
const v0, 0x1080016 # Replace 0x1080016 with your customized display drawable public id, by default it is android.R.drawable.edit_text
Replace 0x1080004 with the public id you get from <public type="drawable" name="btnc" id="0x7f020172" /> which is 0x7f020172.
Replace 0x1080005 with the public id you get from <public type="drawable" name="btn" id="0x7f02016c" /> which is 0x7f02016c.
Replace 0x108001c with the public id you get from <public type="drawable" name="btn" id="0x7f02016c" /> which is 0x7f02016c.
Replace 0x1080016 with the public id you get from <public type="drawable" name="calc_display" id="0x7f020179" /> which is 0x7f020179.
SO my new code based from the public ids I get after recompiling and decompiling is:
Code:
const v0, 0x7f020172 # Replace 0x1080004 with your customized number button drawable public id, by default it is android.R.drawable.btn_default
const v0, 0x7f02016c # Replace 0x1080005 with your customized operation button drawable public id, by default it is android.R.drawable.btn_default_small
const v0, 0x7f02016c # Replace 0x108001c with your customized advanced op button drawable public id, by default it is android.R.drawable.gallery_thumb
const v0, 0x7f020179 # Replace 0x1080016 with your customized display drawable public id, by default it is android.R.drawable.edit_text
6. Save your edited CalculatorOnSystemUI.smali
7. Recompile your new SystemUI.apk
8. Push of Flash your SystemUI.apk
Screenshots:
v0.1 - basic calculator only
{
"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"
}
v0.2 - calculator with some advance functions (not customized)
v0.2 - calculator with some advance functions (customized)
Needed Files:
View attachment CalcOnSystemUI.zip v0.1
-Basic calculator only
View attachment CalcOnSystemUI_v0.2.zip v0.2
-Added some advanced functions
-Can be customized further
Source Codes?
You want to play with the code? Add functions? Explore and Learn? Copy method snippets? You can check it at my GitHub.:good::
Suggestions? Comments? Bugs (I hope none)?
Just post a reply here and I will try to attend to it. (The word "try" always has a "catch" Exception, iykwim.)
How to change the calculator .png?
the_vanya1 said:
How to change the calculator .png?
Click to expand...
Click to collapse
I already thought of changing the background of buttons sir, Its already in my source code, but when I compiled the APK and decompiled for the SMALI, my method did not work. This code from CalculatorOnSystemUI.smali should take care of the button png,
Code:
.field private static final BTN_NUM_BG:I = 0x1080004 # Public drawable id for numbers button
.field private static final BTN_OP_BG:I = 0x1080005 # Public drawable id for operations button
but it did not work. I already have custom buttons but unfortunately did not work so I did not include it.
I will update the smali, so that we can customize the buttons, I will also include some scientific function in the update.
EDIT: I have updated the SMALI with new functions and you can customize it now