[TOOL] Public ID Converter - Android Software Development

Public ID Converter​
What is it?
If you've ever messed with smali files you have probably come across a line like this:
Code:
const v0, 0x7f040001
When you come across this you know that you have to search the public.xml of the apk you're porting from and the public.xml of the apk you're porting to in order to find the correct reference. This can get overwhelming when you have multiple references.
This tool will easily replace all public.xml references in a smali file with the public.xml you're porting to.
How to use it:
(As of now, this tool will not add anything to the public.xml)
The decompiled apk must have all of the neccessary resource files added to the public.xml.
You can do this by adding the resources(drawables, strings, ids, etc.) and then compiling the apk. Then decompile the new apk and copy the public.xml.
Open this app and select the files (can be opened for GUI or run from command line)
Convert the smali file
The new modified file will be at the same location of the original smali file with the same name but with "-MODIFIED" appended to it
If it was unable to find the reference in either public.xml it will add the word MISSING so you can easily search the smali file after.
Example:
Everything going smoothly:
Smali:
Code:
const v0, 0x7f040001
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
Source public.xml:
Code:
<public type="xml" name="pref_lockscreen" id="0x7f040001" />
Port public.xml:
Code:
<public type="xml" name="pref_lockscreen" id="0x7f041234" />
New modified smali:
Code:
const v0, 0x7f041234 # type="xml" name="pref_lockscreen"
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
Everything going poorly:
Smali:
Code:
const v0, 0x7f040001
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
const v0, 0x7f040002
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
const v0, 0x7f040003
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
Source public.xml:
Does not contain 0x7f040003
Code:
<public type="xml" name="pref_display" id="0x7f040001" />
<public type="xml" name="pref_lockscreen" id="0x7f040002" />
<public type="xml" name="pref_navigation_bar" id="0x7f040004" />
Port public.xml:
Does not contain type="xml" name="pref_lockscreen"
Code:
<public type="xml" name="pref_display" id="0x7f041234" />
<public type="xml" name="pref_navigation_bar" id="0x7f041235" />
New modified smali:
Code:
const v0, 0x7f041234 # type="xml" name="pref_display"
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
const v0, 0x7f040002 # MISSING: type="xml" name="pref_lockscreen"
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
const v0, 0x7f040003 # MISSING: Not found in source public.xml
invoke-virtual {p0, v0}, Lcom/example/SettingsActivity;->addPreferencesFromResource(I)V
Notes:
It is recommended that you convert the source smali file before trying to port any code to your apk. This will avoid issues of searching the source public.xml for an already correct id and replacing it with an incorrect one.
I've added the ability for this to be run with a GUI or from the command line. The command line arguments are as follows:
Code:
usage: public_id_convert f[ind] [options] <source public.xml> <source smali>
public_id_convert c[onvert] [options] <source public.xml> <source smali> <port public.xml>
-f Search for framework IDs
Download:
https://github.com/loserskater/PublicIDConverter/releases
Source:
https://github.com/loserskater/PublicIDConverter
{
"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"
}
XDA:DevDB Information
Public ID Converter, Tool/Utility for all devices (see above for details)
Contributors
loserskater
Source Code: https://github.com/loserskater/PublicIDConverter
Version Information
Status: Testing
Created 2015-03-25
Last Updated 2015-03-25

Reserved

Winnerskater! nice job man. looks awessssssoooooommeeee!

Update to 0.2
Use regex when searching smali.
Remove custom search and add option for framework.

awesome tool sir :good:

thankyou for share, gonna try soon

qoejohn said:
awesome tool sir :good:
Click to expand...
Click to collapse
ocoot said:
thankyou for share, gonna try soon
Click to expand...
Click to collapse
Have you used it yet? Any feedback?

yes sir .. I think it works well and is very helpful

Nice tool, sir, but it`s dont want search id`s in framework-res

awesome sir.. very helpful :good:

loserskater said:
Have you used it yet? Any feedback?
Click to expand...
Click to collapse
This is running on windows?

lijianjunyonghu said:
This is running on windows?
Click to expand...
Click to collapse
yes

qoejohn said:
yes
Click to expand...
Click to collapse
How to start this tool?

lijianjunyonghu said:
How to start this tool?
Click to expand...
Click to collapse
If using windows you can run it from the command line with
Code:
java -jar public_id_port.jar
Or if you want the GUI, add the jdk path to the system PATH. Plenty of guides out there if you need help with that.

it`s dont want search id`s in framework-res

It is fantastic, I'll spare time

@loserskater
this is a fantastic tool - big big thx for that :good:

Very useful tool.
Well done, @loserskater

awesome tool
wow bro @loserskater
you saved my ass
Thank you bro

I wanna via public. Xml ID to replace smail ,can it finish?

Related

[Q] How to make sizable notification button in CM7 ?

Hi,
I want made button like this with indicators :
{
"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"
}
For the background, no problem, i modify the 9-patch png like this :
For the "on" and "off" button, i create 9-patch png :
stat_bluetooth_off.9.png
stat_bluetooth_on.9.png
Now, how i can replace "stat_bluetooth_off.png" with "stat_bluetooth_off.9.png" into SystemUI.apk in order to see the 9-patch png, because i can't see it ?
Thanks
what program are you using to make the .9.pngs?
theme chooser would be easy or try making a cwm flash.
After decompiling SystemUI.apk with Apk_Manager_UOT, i use psp7
to add 9-patch black pixels around the png, then i save it and compil it.
Then i make CWR zip to flash it.
Maybe i must use draw9patch.jar from android sdk ?
i have only had success with photoshop (way easier) or the draw9patch. not sure psp can or cannot. though the draw9patch is really annoying but it works.
try the draw9patch and see. if you run into trouble, post the images and i can see if i can help. good luck.
Guys,
don't go that way!.
make this for cm7 theme manager. that would be the best idea!
mickey-r said:
Hi,
I want made button like this with indicators :
For the background, no problem, i modify the 9-patch png like this :
For the "on" and "off" button, i create 9-patch png :
stat_bluetooth_off.9.png
stat_bluetooth_on.9.png
Now, how i can replace "stat_bluetooth_off.png" with "stat_bluetooth_off.9.png" into SystemUI.apk in order to see the 9-patch png, because i can't see it ?
Thanks
Click to expand...
Click to collapse
Can you tell me from where did you get those png's?
@vijaysapkota
each time i compile cm7 theme, i have a missing asset for my device
and if i apply anyway all the theme isn't load (missing notification button
and some other graphics ...)
the png come from sense widgets.
mickey-r said:
@vijaysapkota
each time i compile cm7 theme, i have a missing asset for my device
and if i apply anyway all the theme isn't load (missing notification button
and some other graphics ...)
the png come from sense widgets.
Click to expand...
Click to collapse
i realize you weren't writing to me but since i have spent many an hour with compiling for cm7 i would chirp in.
if you are compiling on Windows, you will always get the missing asset message. only way around it is using linux.
as for the not working, there are a million reasons from your manifest to icon names to image deficiencies.
have you read the following?:
http://forum.xda-developers.com/showthread.php?t=964391
that is a fantastic guide.
also, if you want to post your apk and we can take a look.
cheers.
thanks jsmccabe78,
i already try to compile theme by this way, but i receive unproperly compiled theme when i want to apply.
i will retry asap but i'm french and it's not so easy to anderstand every subtilities ...
if you have a good and step by step link to a linux theme compiling ...
i will try by this way too
in other way, i made a CWR theme working right but it seem that button
can't be sizable (9-patch ok for all button, i can see it but not sizable
maybe the notification script don't include this possibility)
thanks
no problem; glad to help.
i have yet to be successful resizing things. sometimes bigger / smaller but those look distorted. as you are assuming, the sizes are set not in the image but in some xml and are not easily edited (haven't seen any.)
as for compiling - i don't know a good guide for linux, but assume it is fairly similar to windows. there is nothing you are doing that should give you an unusable theme from compiling on windows; i have edited those images with my theme just fine and i use windows. so not sure linux would help or give you a better result.
if you want, post the apk and i can take a look. other than that, i would start over reading the link i gave you. sorry, not many other ideas.
ok, i'm back ...
i decompile the systemui.apk of TyphooN nand (because i use this nand ...)
i saw that the notification power button use "stat_bgon_custom.9.png" like
indicator in both state on and off.
i'm looking for "stat_bgon_custom" into files of systemui.apk and i found it
into smali\com\android\systemui\R$drawable.smali :
Code:
.field public static final stat_bgoff:I = 0x7f020027
.field public static final stat_bgon:I = 0x7f020028
.field public static final stat_bgon_custom:I = [COLOR="Red"]0x7f020029[/COLOR]
next, i'm looking for address 0x7f020029 into same files and i found it
into smali\com\android\systemui\statusbar\powerwidget\PowerButton$1.smali :
Code:
.line 130
iget-object v10, p0, Lcom/android/systemui/statusbar/powerwidget/PowerButton$1;->this$0:Lcom/android/systemui/statusbar/powerwidget/PowerButton;
const v11, [COLOR="red"]0x7f020029[/COLOR]
invoke-static {}, Lcom/android/systemui/statusbar/powerwidget/PowerButton;->access$100()Landroid/graphics/PorterDuff$Mode;
move-result-object v12
invoke-virtual {v5, v11, v7, v12}, Landroid/content/res/Resources;->getDrawable(IILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/drawable/Drawable;
move-result-object v11
invoke-static {v10, v2, v11}, Lcom/android/systemui/statusbar/powerwidget/PowerButton;->access$200(Lcom/android/systemui/statusbar/powerwidget/PowerButton;ILandroid/graphics/drawable/Drawable;)V
.line 135
.end local v0 #buttonIcon:I
.end local v1 #buttonLayer:I
.end local v2 #buttonState:I
.end local v3 #context:Landroid/content/Context;
.end local v4 #indic:Landroid/widget/ImageView;
.end local v5 #res:Landroid/content/res/Resources;
.end local v6 #sColorMaskBase:I
.end local v7 #sColorMaskInter:I
.end local v8 #sColorMaskOff:I
.end local v9 #sColorMaskOn:I
:cond_0
:goto_1
return-void
.line 109
.restart local v0 #buttonIcon:I
.restart local v1 #buttonLayer:I
.restart local v2 #buttonState:I
.restart local v3 #context:Landroid/content/Context;
.restart local v4 #indic:Landroid/widget/ImageView;
.restart local v5 #res:Landroid/content/res/Resources;
:cond_1
const/4 v10, 0x0
invoke-virtual {v4, v10}, Landroid/widget/ImageView;->setVisibility(I)V
goto :goto_0
.line 122
.restart local v6 #sColorMaskBase:I
.restart local v7 #sColorMaskInter:I
.restart local v8 #sColorMaskOff:I
.restart local v9 #sColorMaskOn:I
:pswitch_0
iget-object v10, p0, Lcom/android/systemui/statusbar/powerwidget/PowerButton$1;->this$0:Lcom/android/systemui/statusbar/powerwidget/PowerButton;
const v11, [COLOR="red"]0x7f020029[/COLOR]
invoke-static {}, Lcom/android/systemui/statusbar/powerwidget/PowerButton;->access$100()Landroid/graphics/PorterDuff$Mode;
move-result-object v12
invoke-virtual {v5, v11, v9, v12}, Landroid/content/res/Resources;->getDrawable(IILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/drawable/Drawable;
move-result-object v11
invoke-static {v10, v2, v11}, Lcom/android/systemui/statusbar/powerwidget/PowerButton;->access$200(Lcom/android/systemui/statusbar/powerwidget/PowerButton;ILandroid/graphics/drawable/Drawable;)V
goto :goto_1
.line 126
:pswitch_1
iget-object v10, p0, Lcom/android/systemui/statusbar/powerwidget/PowerButton$1;->this$0:Lcom/android/systemui/statusbar/powerwidget/PowerButton;
const v11, [COLOR="red"]0x7f020029[/COLOR]
invoke-static {}, Lcom/android/systemui/statusbar/powerwidget/PowerButton;->access$100()Landroid/graphics/PorterDuff$Mode;
move-result-object v12
invoke-virtual {v5, v11, v8, v12}, Landroid/content/res/Resources;->getDrawable(IILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/drawable/Drawable;
move-result-object v11
invoke-static {v10, v2, v11}, Lcom/android/systemui/statusbar/powerwidget/PowerButton;->access$200(Lcom/android/systemui/statusbar/powerwidget/PowerButton;ILandroid/graphics/drawable/Drawable;)V
goto :goto_1
.line 120
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
.end packed-switch
.end method
i think this portion of code is used to change the indicator display ?
my question : it is possible to replace in first case 0x7f020029 by 0x7f020027 (stat_bgoff)
and in second case 0x7f020029 by 0x7f020028 (stat_bgon) and add PowerButton$1.smali into templatebread and compile it?
mickey-r said:
...my question : it is possible to replace in first case 0x7f020029 by 0x7f020027 (stat_bgoff)
and in second case 0x7f020029 by 0x7f020028 (stat_bgon) and add PowerButton$1.smali into templatebread and compile it?
Click to expand...
Click to collapse
i don't know. i haven't messed with smali.
my question: why not simply try it? what's the worse that could happen?
or post in the thread i mentioned previously; bigger audience to ask.
Finally it's working by modify "smali\com\android\systemui\statusbar\powerwidget\PowerButton$1.smali " into systemui.apk
i ask my question to the thread you mentioned me to include this modification into cm7 theme
thank for all

[TUTORIAL] How to transform your settings.apk in perfect Honami Settings UPDATE 27/11

Many people are asking me how to clone Honami settings. Changing some png is not difficult at all but when we need to edit the smali files it's different.
So I will explain some differents parts such:
How to have black text on google account settings.
How to add Auto Synch Switcher.
How to add your personal sub menu settings.
How to add any applications in settings.
How to have black text on google account settings.
Many are thinking that the color of this text is defined by an xml in styles.xml or with a color. That's why no body exepting me as been able to have the correct text color.
This text color is in fact defined by the google account and the color is white by default. Modding the text color inside google applications is not a good solution for Sony dev as an update would have change the color again.
Sony have choose to convert the white text color to black inside the smali files of settings, so even if the user update the google app, the text will always have the right color.
{
"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"
}
Instructions
1) Copy GenericSettingsFragment.smali in smali/com/sonymobile/settings
2) Copy ProxyPreferenceRootAdapter in smali/com/sonymobile/settings/preference
3) In smali/com/android/settings/accounts/ManageAccountsSettings.smali
Replace full method addAuthenticatorSettings()V
Code:
.method private addAuthenticatorSettings()V
.locals 3
.prologue
.line 357
iget-object v1, p0, Lcom/android/settings/accounts/ManageAccountsSettings;->mAccountType:Ljava/lang/String;
invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v2
invoke-virtual {p0, v1, v2}, Lcom/android/settings/accounts/ManageAccountsSettings;->addPreferencesForType(Ljava/lang/String;Landroid/preference/PreferenceScreen;)Landroid/preference/PreferenceScreen;
move-result-object v0
.line 358
.local v0, prefs:Landroid/preference/PreferenceScreen;
if-eqz v0, :cond_0
.line 359
invoke-direct {p0, v0}, Lcom/android/settings/accounts/ManageAccountsSettings;->updatePreferenceIntents(Landroid/preference/PreferenceScreen;)V
.line 361
:cond_0
return-void
.end method
by
Code:
.method private addAuthenticatorSettings()V
.locals 4
.prologue
.line 364
iget-object v2, p0, Lcom/android/settings/accounts/ManageAccountsSettings;->mAccountType:Ljava/lang/String;
invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v3
invoke-virtual {p0, v2, v3}, Lcom/android/settings/accounts/ManageAccountsSettings;->addPreferencesForType(Ljava/lang/String;Landroid/preference/PreferenceScreen;)Landroid/preference/PreferenceScreen;
move-result-object v0
.line 365
.local v0, prefs:Landroid/preference/PreferenceScreen;
if-eqz v0, :cond_0
.line 366
invoke-direct {p0, v0}, Lcom/android/settings/accounts/ManageAccountsSettings;->updatePreferenceIntents(Landroid/preference/PreferenceScreen;)V
.line 372
:cond_0
new-instance v1, Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;
invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v3
invoke-virtual {v3}, Landroid/preference/PreferenceScreen;->getRootAdapter()Landroid/widget/ListAdapter;
move-result-object v3
invoke-direct {v1, v2, v3}, Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;-><init>(Landroid/content/Context;Landroid/widget/ListAdapter;)V
.line 375
.local v1, proxyAdapter:Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;
invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getListView()Landroid/widget/ListView;
move-result-object v2
invoke-virtual {v2, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V
.line 376
return-void
.end method
How to add Auto Synch Switcher
The Honami settings introduce a new switcher that you can use the same way as Wifi and Bluetooth, the Auto Synch Switcher.
I will show you an easy way to add it but I will have to teach you how are working the ID first
Little introduction to ID
What are the ID?
To tell you what they are, first I must tell you where they are... Open public.xml found in res/value and you will see something like that:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="attr" name="state_encrypted" id="[COLOR="Red"]0x7f010000[/COLOR]" />
<public type="attr" name="icon" id="0x7f010001" />
<public type="attr" name="emptyColor" id="0x7f010002" />
<public type="attr" name="minTickWidth" id="0x7f010003" />
<public type="attr" name="optimalWidth" id="0x7f010004" />
<public type="attr" name="optimalWidthWeight" id="0x7f010005" />
<public type="attr" name="sweepDrawable" id="0x7f010006" />
<public type="attr" name="followAxis" id="0x7f010007" />
<public type="[COLOR="DarkOrange"]drawable[/COLOR]" name="preview" id="0x7f0200b8" />
<public type="drawable" name="appwidget_button_center" id="0x7f020001" />
<public type="drawable" name="appwidget_button_left" id="0x7f020002" />
<public type="drawable" name="appwidget_button_right" id="0x7f020003" />
<public type="drawable" name="btn_check_buttonless_on" id="0x7f020014" />
<public type="drawable" name="data_sweep_left" id="[COLOR="Lime"]0x7f[/COLOR]020018" />
<public type="mipmap" name="ic_launcher_settings" id="0x7f[COLOR="Magenta"]03[/COLOR]0000" />
<public type="layout" name="account_preference" id="0x7f040001" />
<public type="layout" name="account_sync_screen" id="0x7f040002" />
<public type="layout" name="add_account_screen" id="0x7f04[COLOR="Silver"]0003[/COLOR]" />
I've added some color to explain what are the different parts:
In Red you have the full ID, the long number will be used in the differents smali files as a shortcut.
In Dark Orange you have the type of ID, there are many differents type such as drawable, layout, styles, id, ...
In Lime you can see that the 4 first characters are always 0x7f, all IDs used by an apk who are inside this apk are starting by that.
In Magenta you can see two more characters, these two are related to the type saw earlier, for example type drawable 02, type layout 04, ...
In Silver you have the last 4 characters who are related to different names used for a same type. These numbers are in hexadecimal.
I need to show you an other place where you can find ID, inside framework-res.apk, Open public.xml found in res/value and you will see something like that:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="attr" name="theme" id="[COLOR="Red"]0x01010000[/COLOR]" />
<public type="attr" name="label" id="0x01010001" />
<public type="attr" name="icon" id="0x01010002" />
<public type="attr" name="name" id="[COLOR="Lime"]0x010[/color]10003" />
<public type="attr" name="manageSpaceActivity" id="0x01010004" />
<public type="attr" name="allowClearUserData" id="0x01010005" />
<public type="attr" name="permission" id="0x01010006" />
<public type="id" name="background" id="0x01020000" />
<public type="id" name="checkbox" id="0x01020001" />
<public type="id" name="content" id="0x01020002" />
<public type="id" name="edit" id="0x01[COLOR="Magenta"]02[/color]0003" />
<public type="id" name="empty" id="0x01020004" />
<public type="style" name="Animation" id="0x01030000" />
<public type="style" name="Animation.Activity" id="0x01030001" />
<public type="style" name="Animation.Dialog" id="0x01030002" />
<public type="style" name="Animation.Translucent" id="0x01030003" />
<public type="style" name="Animation.Toast" id="0x01030004" />
<public type="style" name="Theme" id="0x01030005" />
<public type="style" name="Theme.NoTitleBar" id="0x0103[COLOR="Silver"]0006[/color]" />
I have used the same colors as before because this is exactly working the same way with some little variations.
The first characters are now 0x01 instead of 0x7, that means that these ID are inside framework-res.apk
BUT be carefull, when the IDs are used inside the smali files of an APK, the first zero after the x is always removed.
Example: 0x01030002 found in public.xml of framework-res.apk will be wrote inside a smali of an APK -> 0x1030002
Instructions
Now I can finally start
1) Copy AutoSyncEnabler.smali, AutoSyncDialogFragment.smali, AutoSyncDialogFragment$1.smali and AutoSyncDialogFragment$2.smali in smali/com/android/settings/
2) Open AutoSyncDialogFragment.smali with notepad++ and search "0x7" without the quote.
You will found 4 ID as explained, these ID are related to MY Settings.apk, that means that inside your apk, these "Shortcuts" may not be the good one...
I have include the public.xml found in MY settings.apk and called it public-settings.xml, open it too with notepad++ and in the same time open YOUR public.xml found in YOUR settings.apk
Let's do it for the first ID found in the smali: 0x7f0b067a, search now the full ID inside my public.xml, you will found this:
Code:
<public type="string" name="data_usage_auto_sync_off_dialog_title" id="[COLOR="Red"]0x7f0b067a[/COLOR]" />
So this ID is a shortcut for the "string" named "data_usage_auto_sync_off_dialog_title"
Now search in YOUR public.xml: "data_usage_auto_sync_off_dialog_title" without the quote and check if the full ID is the same. If the ID is different, use this one inside the smali files.
Do the same with all ID starting by 0x7
3) Copy Settings$HeaderAdapter.smali in smali/com/android/settings/ and open it with notepad++
Do a search for all ID starting by 0x7 and check between MY public.xml and YOUR public.xml
Do also a search for all ID starting by 0x1 (ID related to framework-res.apk) (You must found 5 different ID)
The first one found is 0x1010208
As I told you ID related to framework-res.apk found in smali are slightly different when they are in the public.xml of framework-res.apk (Remember the first character after the x ? )
I have include the public.xml found in MY framework-res.apk and called it public-framework-res.xml. Open MY public-framework-res.xml and YOUR public.xml of YOUR framework-res.apk
Do a search for "0x01010208" without the quote (I have added a zero after the x ) in MY public.xml and you will found that:
Code:
<public type="attr" name="listSeparatorTextViewStyle" id="0x01010208" />
Now search "listSeparatorTextViewStyle" inside YOUR public.xml and check if the ID are the same, if different replace with the correct one (Don't forget to remove the zero in the smali).
reserved
last one
That´s my friend!!! Awesome bro... :good:
Thank u so much!!
This is a great guide bro @niaboc79
very good
just keep doing your things, im happy with this !!
Thanks for this.
Quick question, how about porting Quick Settings ?
Reason i'm asking is, i have a Xperia C, it's quick settings are the ancient type, unlike the one from Xperia Z onwards where you can have 2 rows of customizable settings.
I've saw how you can edit the Settings.apk and link it to a Toolsetting.apk, where you can choose which quick setting to appear.
But you will still need to edit SystemUI.apk, which i guess that's the hardest part with all the smali edit.
Hope you can help.
Thanks.
Pandemic said:
This is a great guide bro @niaboc79
very good
just keep doing your things, im happy with this !!
Click to expand...
Click to collapse
I will complete when time
Envoyé de mon C6603 en utilisant Tapatalk
takagen said:
Thanks for this.
Quick question, how about porting Quick Settings ?
Reason i'm asking is, i have a Xperia C, it's quick settings are the ancient type, unlike the one from Xperia Z onwards where you can have 2 rows of customizable settings.
I've saw how you can edit the Settings.apk and link it to a Toolsetting.apk, where you can choose which quick setting to appear.
But you will still need to edit SystemUI.apk, which i guess that's the hardest part with all the smali edit.
Hope you can help.
Thanks.
Click to expand...
Click to collapse
Are you on JB or ICS?
Envoyé de mon C6603 en utilisant Tapatalk
niaboc79 said:
Are you on JB or ICS?
Envoyé de mon C6603 en utilisant Tapatalk
Click to expand...
Click to collapse
I'm on JB.
takagen said:
I'm on JB.
Click to expand...
Click to collapse
I will post a new tutorial about systemUI when I will have finished thos one
Envoyé de mon C6603 en utilisant Tapatalk
niaboc79 said:
I will post a new tutorial about systemUI when I will have finished thos one
Envoyé de mon C6603 en utilisant Tapatalk
Click to expand...
Click to collapse
That's great. Thanks.
Congratulations! You tutorial is on XDA Portal: http://www.xda-developers.com/android/change-your-google-account-font-color-in-honami-based-roms/
Btw the settings inside your ROM already has these features, right?
cities516 said:
Congratulations! You tutorial is on XDA Portal: http://www.xda-developers.com/android/change-your-google-account-font-color-in-honami-based-roms/
Btw the settings inside your ROM already has these features, right?
Click to expand...
Click to collapse
Yeah twice on 2 weeks on portal
Yes all my eXistenZ are including it.
Envoyé de mon C6603 en utilisant Tapatalk
can you help me how to full white backup and restore app?
tnx
Thank you for your TUT. It's very useful.
And I have interest how to port honami camera.
I know it maybe very difficult or hard to say.
Can you make a TUT for this?
problem recompiling
bro @niaboc79. i am using honami rom for tx by EXR.MING group. i am getting error while compiling. i am attaching my log. i also have this kind of view in settings/enhaced mode/xposed framework. please help
problem recompiling
bro @NiObac. i am using honami rom for tx by EXR.MING group. i am getting error while compiling. i am attaching my log. i also have this kind of view in settings/enhaced mode/xposed framework. please help
You need to spam @romeoofair ??
Change the framework in apktool with the one from the rom you using now and try again !!
Sent from my LT22i using Tapatalk
Pandemic said:
You need to spam @romeoofair ??
Change the framework in apktool with the one from the rom you using now and try again !!
Sent from my LT22i using Tapatalk
Click to expand...
Click to collapse
but i always install the framework which i use at that instant. i already installed the new framework i am using now. nut i got the error. check my log.any solution? i already posted my files up there

How to add android M Developer Preview Easter Egg In your ROM .

How to add android M Developer Preview Easter Egg In your ROM .​
{
"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"
}
​ Hi friends .How are you. I am Back with another Guide .How to add Android M Platlogo in your Roms.
Well I Made it from Scratch . So it working on GingerBread too .
[FONT=Arial, Helvetica, sans-serif]Disclaimer : I and AndroStarkDeveloper are not responsible for any Meteor attacks :laugh:[/FONT]
[FONT=Arial, Helvetica, sans-serif]if you got Success . and Not responsible for any Nuclear Bomb Blast From Google:laugh: .[/FONT]​ ​
Requirements :
1.framework2.jar from your Rom ( for Kitkat ROMS).
2.framework.jar for (GB + ROM).
3.Have Knowledge How To Decompile and compile jar file
and i also attaching jar decompiler Romtoolpcv3 .
​
My advice is to use Romtoolpcv3 because may be you got .parameter erors while recompiling .
Easter Egg app Attached Below.
And Most Important Have Intention Never to Give up.:highfive:
Lets Stop Laughing hahaha. Time to Start and Focus on our Task.​
1. Decompile framework2.jar if you adding Mplatlogo In your Kikat ROM. if you are using GB+ device then you have to decompile framework.jar ok friends.
2. Go to smali/com/android/internal/app
and open PlatLogoActivity.smali
3. Select all and replace it with this code:
[FONT=Arial, Helvetica, sans-serif]
[/FONT]
Code:
.class public Lcom/android/internal/app/PlatLogoActivity;
.super Landroid/app/Activity;
.source "PlatLogoActivity.java"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 12
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
return-void
.end method
# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
.registers 7
.parameter "savedInstanceState"
.prologue
.line 16
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
.line 18
new-instance v1, Landroid/content/Intent;
const-string v2, "android.intent.action.MAIN"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 19
.local v1, intent:Landroid/content/Intent;
new-instance v2, Landroid/content/ComponentName;
const-string v3, "com.androstark.droidbuster.mplatelogo"
const-string v4, "com.androstark.droidbuster.mplatelogo.MainActivity"
invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
.line 23
:try_start_16
invoke-virtual {p0, v1}, Lcom/android/internal/app/PlatLogoActivity;->startActivity(Landroid/content/Intent;)V
:try_end_19
.catch Landroid/content/ActivityNotFoundException; {:try_start_16 .. :try_end_19} :catch_1d
.line 39
:goto_19
invoke-virtual {p0}, Lcom/android/internal/app/PlatLogoActivity;->finish()V
.line 41
return-void
.line 31
:catch_1d
move-exception v0
.line 35
.local v0, e:Landroid/content/ActivityNotFoundException;
const-string v2, "First install that app Droidbuster told you to!"
const/4 v3, 0x0
invoke-static {p0, v2, v3}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v2
invoke-virtual {v2}, Landroid/widget/Toast;->show()V
goto :goto_19
.end method
[FONT=Arial, Helvetica, sans-serif]4. Recompile framework.jar[/FONT][FONT=Arial, Helvetica, sans-serif] Push it into system/framework[/FONT][FONT=Arial, Helvetica, sans-serif] Set correct permissions(rw-r--r--)[/FONT]
[FONT=Arial, Helvetica, sans-serif] 5. Install this app by me, it Contain important the Easter Egg code and that smali above redirects to it:[/FONT]
​[FONT=Arial, Helvetica, sans-serif]Download Android M Developer Preview Easter Egg = MDeveloperEasterEgg.apk[/FONT]
[FONT=Arial, Helvetica, sans-serif]If you want to taste sample of this easter egg then try this sample app = MdeveloperEasterEggSample.apk[/FONT]
[FONT=Arial, Helvetica, sans-serif]Download Source Code of this Easter Egg = https://github.com/Droidbuster/Android-M-Easter-Egg
[/FONT]​
​
Enjoy In your Rom and Dont forget for Giving Credits .Friends if you are using in your ROM[FONT=Arial, Helvetica, sans-serif]. [/FONT]​ ​
If you want to Join our Fb community https://www.facebook.com/groups/1457587231221310/
Contributors
Droidbuster,
ROM OS Version: 2.3.x Gingerbread
Version Information
Status: Stable
Current Beta Version: 1.0
Created 2015-06-10
Last Updated 2015-06-10
Help!
Sir.. I need ur help
I want to add l or k nav bars in my GB "Karboon A1+"
I have added this easter egg :good:
Just awesome.....
Can u help me???
Sir .... video of ur creation http://youtu.be/VSrTQetCRKE :good:
will this work on TW ROMs on my samsung tab 4?
---------- Post added at 02:06 AM ---------- Previous post was at 01:51 AM ----------
i dont have classes.dex file in my jar file i cant do anything plz help???????
emoboy (Official Name!) said:
will this work on TW ROMs on my samsung tab 4?
---------- Post added at 02:06 AM ---------- Previous post was at 01:51 AM ----------
i dont have classes.dex file in my jar file i cant do anything plz help???????
Click to expand...
Click to collapse
which android version?
Droidbuster said:
which android version?
Click to expand...
Click to collapse
4.4.2 kitkat
yes
emoboy (Official Name!) said:
4.4.2 kitkat
Click to expand...
Click to collapse
yes
Droidbuster said:
yes
Click to expand...
Click to collapse
What?
Man you don't help me

[GUIDE][AOSP][CM12/12.1]How To Port Fully Featured Sony Phonebook,Dialer & InCallUI

[GUIDE][AOSP][CM12/12.1]How To Port Fully Featured Sony Phonebook,Dialer & InCallUI
Quick Guide To Port Xperia Z5,Z4,Z3,Z2,Z1,Z etc. Fully Featured Sony Phonebook,Dialer & InCallUI . For Many Phones Running AOSP,CM12,CM12.1. I Hope Everyone Like & Enjoy It.
{
"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"
}
Guide & Download Link Is On 2nd Post
Screenshots On 3rd Post
Cheers U Can Post Screenshots Too & I'll Add To This Thread
If U Like My Work Dont Forgot To Press Thanks Button
Guide For AOSP,CM12,CM12.1
1. Extract framework.jar Decompile classes.dex
2. Go to android/telephony/TelephonyManager.smali add this method before .method public handlePinMmi
PHP:
.method public getVoicemailString()Ljava/lang/String;
.registers 3
.prologue
.line 3592
iget-object v0, p0, Landroid/telephony/TelephonyManager;->mContext:Landroid/content/Context;
if-nez v0, :cond_6
const/4 v0, 0x0
.line 3593
:goto_5
return-object v0
:cond_6
iget-object v0, p0, Landroid/telephony/TelephonyManager;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x1040051
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v0
goto :goto_5
.end method
3.To Port InCallUI add this method in android/telecom/Call.smali
PHP:
.method public getNotificationCode()I
.registers 2
.prologue
.line 415
iget v0, p0, Landroid/telecom/Call;->mNotificationCode:I
return v0
.end method
.method public getNotificationType()I
.registers 2
.prologue
.line 410
iget v0, p0, Landroid/telecom/Call;->mNotificationType:I
return v0
.end method
& Add This Instance Fields
PHP:
.field private mNotificationCode:I
.field private mNotificationType:I
4. Go To android/telecom/Phone.smali Add This Field at line 55
PHP:
.field private mSomcInCallAdapterExtend:Landroid/telecom/SomcInCallAdapterExtend;
5. Add This method before .method public switchToOtherActiveSub
PHP:
.method public final somcGetCommand(ILjava/lang/String;)Ljava/lang/String;
.registers 5
.parameter "commandId"
.parameter "option"
.prologue
.line 386
const/4 v0, 0x0
.line 387
.local v0, result:Ljava/lang/String;
iget-object v1, p0, Landroid/telecom/Phone;->mSomcInCallAdapterExtend:Landroid/telecom/SomcInCallAdapterExtend;
if-eqz v1, :cond_b
.line 388
iget-object v1, p0, Landroid/telecom/Phone;->mSomcInCallAdapterExtend:Landroid/telecom/SomcInCallAdapterExtend;
invoke-virtual {v1, p1, p2}, Landroid/telecom/SomcInCallAdapterExtend;->somcGetCommand(ILjava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 389
:cond_b
return-object v0
.end method
6. Download & Extract SomcInCallAdapterExtend.zip from attachments move SomcInCallAdapterExtend.smali to android/telecom folder
7. Recompile & Move Modify classes.dex In framework.jar
Done (Remember Superusermod & Deodex Rom Require)
Now CM12.1,AOSP Users Can Flash This http://www.mediafire.com/download/eokbox8h6otz5s5/EnfriarZ5Dialer.zip
Screenshots
How to and where to edit the files
@xperiaz2 awesome , thank yoooou so much for sharing this to us...
---------- Post added at 02:23 PM ---------- Previous post was at 01:51 PM ----------
Decompile Framework.apk
and add
<string name="config_voicemail_string" /> to string.xml
<public type="string" name="config_voicemail_string" id="#Number#" /> to Public.xml
Number in Public is like this 0x01040054 #Number is a example
You need to replace number in following code like this 0x1040054
PHP:
.method public getVoicemailString()Ljava/lang/String;
.registers 3
.prologue
.line 3592
iget-object v0, p0, Landroid/telephony/TelephonyManager;->mContext:Landroid/content/Context;
if-nez v0, :cond_6
const/4 v0, 0x0
.line 3593
:goto_5
return-object v0
:cond_6
iget-object v0, p0, Landroid/telephony/TelephonyManager;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x1040054
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v0
goto :goto_5
.end method
add this code before .method public handlePinMmi
wolfmannight said:
@xperiaz2 awesome , thank yoooou so much for sharing this to us...
---------- Post added at 02:23 PM ---------- Previous post was at 01:51 PM ----------
Decompile Framework.apk
and add
<string name="config_voicemail_string" /> to string.xml
<public type="string" name="config_voicemail_string" id="#Number#" /> to Public.xml
Number in Public is like this 0x01040054 #Number is a example
You need to replace number in following code like this 0x1040054
Click to expand...
Click to collapse
most welcome bro yeah correct :good:
I cant find .method public switchToOtherActiveSub in Phone.smali
To CM12.1 users: the 'telecom' folder can be found at /smali_classes2/android (at least in my case).
wolfmannight said:
I cant find .method public switchToOtherActiveSub in Phone.smali
Click to expand...
Click to collapse
i think we should add this also
PHP:
.method public switchToOtherActiveSub(Ljava/lang/String;Z)V
.registers 4
.param p1, "subId" # Ljava/lang/String;
.param p2, "retainLch" # Z
.prologue
.line 287
iget-object v0, p0, Landroid/telecom/Phone;->mInCallAdapter:Landroid/telecom/InCallAdapter;
invoke-virtual {v0, p1, p2}, Landroid/telecom/InCallAdapter;->switchToOtherActiveSub(Ljava/lang/String;Z)V
.line 288
return-void
.end method
in the end
wolfmannight said:
I cant find .method public switchToOtherActiveSub in Phone.smali
Click to expand...
Click to collapse
its last line if not there add that method at end
.method public switchToOtherActiveSub(Ljava/lang/String;Z)V
.registers 4
.parameter "subId"
.parameter "retainLch"
.prologue
.line 276
iget-object v0, p0, Landroid/telecom/Phone;->mInCallAdapter:Landroid/telecom/InCallAdapter;
invoke-virtual {v0, p1, p2}, Landroid/telecom/InCallAdapter;->switchToOtherActiveSub(Ljava/lang/String;Z)V
.line 277
return-void
.end method
wolfmannight said:
i think we should add this also
Click to expand...
Click to collapse
yes
@xperiaz2 Where should I put the fields in Call.smali? In static or instance fields?
elmkzgirxp said:
@xperiaz2 Where should I put the fields in Call.smali? In static or instance fields?
Click to expand...
Click to collapse
instance fields
If Compile error try this attachment with latest smali jar
or
use smali jar 1.3.3 with developer added attchment
wolfmannight said:
If Compile error try this attachment with latest smali jar
or
use smali jar 1.3.3 with developer added attchment
Click to expand...
Click to collapse
try using romtoolspc no error
Hi, awesome work man! You're like on of the first porting this Can you port Conversations as well?
Deleunes254 said:
Hi, awesome work man! You're like on of the first porting this Can you port Conversations as well?
Click to expand...
Click to collapse
wow thanks alot bro yeah i will port Conversations too
You serious? Alright Awesome!!!!
I'm getting errors when smaling Phone.smali.
Code:
framework.jar.out\smali_classes2\android\telecom\Phone.smali[828,4] Error for input '.parameter': Invalid directive
framework.jar.out\smali_classes2\android\telecom\Phone.smali[829,4] Error for input '.parameter': Invalid directive
framework.jar.out\smali_classes2\android\telecom\Phone.smali[828,15] mismatched input '"commandId"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/telecom/Phone.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:71)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:372)
at brut.androlib.Androlib.buildNonDefaultSources(Androlib.java:316)
at brut.androlib.Androlib.build(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:256)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
My framework.jar is only 309 bytes what should I do?
m on cm12.1 lollipop 5.1.1
@xperiaz2
I've flashed this in AICP for Huashan (Xperia SP) and I'm getting contacts FC. Taken a log of the fc by repeatedly opening dialer.
The thing is, contacts opens up and can use it for a while ( Google account contacts are not there) . I try to click on import contacts and it FC's.
As for the dialer, it doesn't even open up.
So the log has a NoSuchMethodError .
Here is the link to the whole log.
http://hastebin.com/upurexegun.vhdl
Hope this helps you .

[GUIDE][MIUI ROM] Enable 4G LTE Setting [If don't have 4G LTE option]

{
"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"
}
INTRODUCTION
I was received Xiaomi Redmi Note 3 PRO (kenzo), and i see there is no 4G LTE option in setting on MIUI 7/8 GLOBAL ROM. in INDONESIA there is RULES called "TKDN" (Tingkat Kandungan Dalam Negeri) is mean (Local Content). Every Xiaomi Devices that shipped officially to INDONESIA with GLOBAL MIUI ROM don't have 4G LTE option, so i dedicated to search how to enable it permanently, and finally i found 2 solution to enable 4G LTE Option.
SOLUTION TO FIX 4G LTE OPTION
1. Edit framework.jar (Recommended)
2. Or Edit Teleservice.apk]
NOTE :
- This thread is for MODDER/THEMER/DEVELOPER ONLY.
- If you want to use this guide and implement to your ROM please mention me. you don't need to PM me. Thanks
CREDITS
XIAOMI INDONESIA FORUM/GROUP
GOOGLE
HOW TO FIX 4G LTE OPTION USING SOLUTION 1 WORK ON DEODEXED ONLY
1. Edit framework.jar
Requirements :
Follow this GUIDE to decompile and recompile framework.jar http://forum.xda-developers.com/crossdevice-dev/sony/tool-xperia-quick-decompile-recompile-t3428341
Step By Step
1. Download this tool http://forum.xda-developers.com/showpost.php?p=67952722&postcount=2
2. Decompile framework.jar (framework.jar must be deodexed)
3. Go to classout2/miui/telephony
4. Open TelephonyManager.smali using text editor like notepad++
5. Search
Code:
.method public isDisableLte(Z)Z
and you will see like this :
Code:
.method public isDisableLte(Z)Z
.registers 10
const/4 v5, 0x1
const/4 v4, 0x0
sget-boolean v6, Lmiui/os/Build;->IS_GLOBAL_BUILD:Z
if-nez v6, :cond_8
move v0, v4
:cond_7
:goto_7
return v0
:cond_8
iget-object v6, p0, Lmiui/telephony/TelephonyManager;->BUILD_OPERATOR_TYPE:Ljava/lang/String;
if-nez v6, :cond_12
invoke-static {}, Lmiui/util/Network;->getOperatorType()Ljava/lang/String;
move-result-object v6
iput-object v6, p0, Lmiui/telephony/TelephonyManager;->BUILD_OPERATOR_TYPE:Ljava/lang/String;
:cond_12
const-string v6, "id4g"
iget-object v7, p0, Lmiui/telephony/TelephonyManager;->BUILD_OPERATOR_TYPE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_1e
move v0, v4
goto :goto_7
:cond_1e
const-string v6, "ido"
sget-object v7, Lmiui/os/Build;->DEVICE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-nez v6, :cond_5a
const-string v6, "kenzo"
sget-object v7, Lmiui/os/Build;->DEVICE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-nez v6, :cond_5a
const-string v6, "kate"
sget-object v7, Lmiui/os/Build;->DEVICE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-nez v6, :cond_5a
const-string v6, "mido"
sget-object v7, Lmiui/os/Build;->DEVICE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-nez v6, :cond_5a
const-string v6, "rolex"
sget-object v7, Lmiui/os/Build;->DEVICE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-nez v6, :cond_5a
const-string v6, "royal"
sget-object v7, Lmiui/os/Build;->DEVICE:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_76
:cond_5a
move v0, v5
:goto_5b
if-eqz v0, :cond_7
if-eqz p1, :cond_7
invoke-virtual {p0}, Lmiui/telephony/TelephonyManager;->getPhoneCount()I
move-result v3
const/4 v1, 0x0
:goto_64
if-ge v1, v3, :cond_7b
invoke-virtual {p0, v1}, Lmiui/telephony/TelephonyManager;->getSimOperatorForSlot(I)Ljava/lang/String;
move-result-object v2
if-eqz v2, :cond_78
const-string v6, "510"
invoke-virtual {v2, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v6
if-eqz v6, :cond_78
move v0, v5
goto :goto_7
:cond_76
move v0, v4
goto :goto_5b
:cond_78
add-int/lit8 v1, v1, 0x1
goto :goto_64
:cond_7b
move v0, v4
goto :goto_7
.end method
6. Shrink code to
Code:
.method public isDisableLte(Z)Z
.registers 10
const/4 v4, 0x0
return v4
.end method
Save file TelephonyManager.smali
7. Compile framework
8. Flash to your MIUI ROM and Done.
HOW TO FIX 4G LTE OPTION USING SOLUTION 2 (WORK ON ODEXED AND DEODEXED ROM)
2. Edit TeleSevices.apk
Requirements :
- Apktool
- I will not explain how to decompile recompile apk MIUI ROM (Search Guide on Google to decompile apk MIUI ROM, Google is your friend)
Step by Step
1. Decompile TeleServices.apk
2. Go to res/xml and edit all files below :
preferred_network_type_3g.xml
preferred_network_type_3g_cm.xml
preferred_network_type_3g_ct.xml
preferred_network_type_lc.xml
preferred_network_type_lte.xml
preferred_network_type_lte_cm.xml
preferred_network_type_lte_ct.xml
preferred_network_type_lte_cu.xml
preferred_network_type_mtk.xml
preferred_network_type_mtk_m.xml
preferred_network_type_pinecone.xml
Click to expand...
Click to collapse
3. Replace all code in all files with this
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/preferred_network_type_title" android:key="network_type_list_gsm_umts"
xmlns:android="http://schemas.android.com/apk/res/android">
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_0" android:key="0" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_1" android:key="1" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_2" android:key="2" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_5" android:key="5" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_8" android:key="8" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_9" android:key="9" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_10" android:key="10" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_11" android:key="11" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_12" android:key="12" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_14" android:key="14" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_15" android:key="15" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_16" android:key="16" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_17" android:key="17" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_18" android:key="18" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_19" android:key="19" />
<miui.preference.RadioButtonPreference android:title="@string/lovins_preferred_network_mode_20" android:key="20" />
</PreferenceScreen>
save all files.
4. Go to res/value and open strings.xml
Add this code
Code:
<string name="lovins_preferred_network_mode_0">Prefer 3G/2G</string>
<string name="lovins_preferred_network_mode_1">2G only</string>
<string name="lovins_preferred_network_mode_2">3G only</string>
<string name="lovins_preferred_network_mode_5">CDMA only</string>
<string name="lovins_preferred_network_mode_8">Prefer 4G/CDMA</string>
<string name="lovins_preferred_network_mode_9">Prefer 4G/2G</string>
<string name="lovins_preferred_network_mode_10">Global</string>
<string name="lovins_preferred_network_mode_11">4G only</string>
<string name="lovins_preferred_network_mode_12">Prefer 4G/3G</string>
<string name="lovins_preferred_network_mode_14">3G only (TD-SCDMA)</string>
<string name="lovins_preferred_network_mode_15">4G only (TD-SCDMA)</string>
<string name="lovins_preferred_network_mode_16">2G only (TD-SCDMA)</string>
<string name="lovins_preferred_network_mode_17">Prefer 4G/2G (TD-SCDMA)</string>
<string name="lovins_preferred_network_mode_18">Prefer 3G/2G (TD-SCDMA)</string>
<string name="lovins_preferred_network_mode_19">Prefer 4G/3G (TD-SCDMA)</string>
<string name="lovins_preferred_network_mode_20">Prefer 4G/3G/2G (TD-SCDMA)</string>
save file.
5. Compile TeleServices also Sign and ZipAlign
6. Flash To your MIUI ROM, (If your ROM odexed just remove TeleServices.odex)
7. Done
Credits for reference : Indra Binuners
ADVENTAGES, BUG OR LACK
USING SOLUTION 1 :
- Only Enable 4G LTE Option (Prefer LTE)
- Network type will remain stick even after device reboot/restart
- No bugs
USING SOLUTION 2 :
- Enable other networks type too
- Network type will back to default network type after reboot/restart
- If you wipe data (not wipe cache or dalvik) after flashing TeleServices MOD you will get Force Close "com.android......" and will not be able to use you device. it may be signatures checking, but i already disable signatures checking on services.jar but still Force Close after wipe data.
So if you want to use SOLUTION 2 DO NOT TRY TO WIPE DATA!!!
Nice guide bro...
Sent from my Redmi Note 3 using Tapatalk
Master ?
Thanks for sharing
I dont have problem with miui rom , only with cm and rr but working in slim rom
Sent from my Redmi Note 3 using Tapatalk
great tutorial , thanks
awesome tutorial...
yes, editing teleservice are causing serious error if you did wiping data..
solution 1 seems the safest way.. thanks a lot..
Keep up the good work!
Thanks bro, really awesome work. Terima kasih banyak
@Rizal Lovins , i usually change the build.prop to enable the 4g (changing ro.product.name and ro.product.device from kenzo to gemini). Beside enabling the 4g , by doing that the stock miui camera now also shows "manual" mode with manual focus etc.
Maybe there's another way around that like your tutorial here (editing framework.jar).
a.marduk said:
@Rizal Lovins , i usually change the build.prop to enable the 4g (changing ro.product.name and ro.product.device from kenzo to gemini). Beside enabling the 4g , by doing that the stock miui camera now also shows "manual" mode with manual focus etc.
Maybe there's another way around that like your tutorial here (editing framework.jar).
Click to expand...
Click to collapse
Editing build.prop is not recommended, your device will identified as gemini instead of kenzo, enabling manual focus, other camera option and other feature is on miuisystem.apk/assets/kenzo.xml
there is many disabled features by Xiaomi, you should enable it (like boolean "true" or "false") you can change some of the feature from "false" to "true".
Rizal Lovins said:
Editing build.prop is not recommended, your device will identified as gemini instead of kenzo, enabling manual focus, other camera option and other feature is on miuisystem.apk/assets/kenzo.xml
there is many disabled features by Xiaomi, you should enable it (like boolean "true" or "false") you can change some of the feature from "false" to "true".
Click to expand...
Click to collapse
great ... i'll look into it, thank you
has anyone tried to replace TeleService.apk from extracted system.img (fastboot rom) with the one extracted from Mod_TeleService_MIUI8_MM_V2-By-Indra-Binunerz, repack and flash it via miflash?
Wow the legend of galaxy wonder is coming hehehe, thanks for sharing
Love you Om working perfectly and very easy tutorial for enable Preferred 4G
Thanks so much
Numpang tanya om...
Do we need to redo the #1 method everytime we update MIUI (weekly global dev), or we can just use the same modified file?
thanks
Gusagus said:
Love you Om working perfectly and very easy tutorial for enable Preferred 4G
Thanks so much
Click to expand...
Click to collapse
Hi, which method did you use? Could you share the modified framework.jar please? Thanks in advance.
Sent from my MI MAX using Tapatalk
may i share this guide to my blog(indonesia)?
of course i'll put source.

Categories

Resources