Related
Hey everyone,
I guess this can be considered my "random act of kindness" for the year since I know that it will almost certainly be kanged over and over with out thanks/credit given.
Anyway I just figured out how to display the "H" icon in the status bar properly. And by that I mean, no renaming or duplicating drawable files in framework-res.apk, and the icon will show all data states now:
GSM, GPRS, Edge, 3G, HSDPA
I've only tested it for a few minutes myself, but thankfully the signal in my bedroom can be a bit flaky, so I've seen it bounce between 3G and H already, and I disabled 3g to make sure the "E" for edge still works fine too.
Anyway, decompile services.jar, and open /com/android/server/status/StatusBarPolicy.smali
Then search for ".method private final updateDataNetType(I)V" in and replace the entire method with this:
Code:
.method private final updateDataNetType(I)V
.registers 3
.parameter "net"
.prologue
.line 1381
packed-switch p1, :pswitch_data_30
.line 1409
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
.line 1412
:goto_7
return-void
.line 1383
:pswitch_8
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_e:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1386
:pswitch_d
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_3g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1391
:pswitch_12
iget-boolean v0, p0, Lcom/android/server/status/StatusBarPolicy;->mHspaDataDistinguishable:Z
if-eqz v0, :cond_1b
.line 1392
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_h:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1394
:cond_1b
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_3g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1399
:pswitch_20
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_1x:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1402
:pswitch_25
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_1x:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1406
:pswitch_2a
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_3g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1381
nop
:pswitch_data_30
.packed-switch 0x2
:pswitch_8
:pswitch_d
:pswitch_20
:pswitch_2a
:pswitch_2a
:pswitch_25
:pswitch_12
:pswitch_12
:pswitch_12
.end packed-switch
.end method
And if you haven't noticed by now, I HATE this samsung bs and would kill for an AOSP or CM rom, lol.
Cheers, =)
P.S., next up (hopefully) a user selectable setting to hide the AM/PM flag from the status bar clock.
Wow nicely done. Thank you so much!
Sent from my SGH-T959 using Tapatalk
Great find, sonique!
And yes, I agree, need aosp or cm already!
Sent from my SGH-T959
I would LOVE you to find that am and pm removal! If this is any help, the 24 hour format doesn't use am/pm (obviously lol) but I wonder if there is any code on there to help you find out how to turn it off for the 12 hour format. No idea if thays right at all, just an idea I would do it myself but I don't know how to
Sent from Bionix powered vibrant! If I helped, hit the thanks button!
It's unfortunate that's how it is S0niqu3, but definitely true.
Thanks for figuring this out and posting it here for everyone.
Is there a tutorial on how to decompile/recompile jar files? I want to learn how to do these edits.
dasunsrule32 said:
Is there a tutorial on how to decompile/recompile jar files? I want to learn how to do these edits.
Click to expand...
Click to collapse
for editing code like this, you need to download smali/baksmali jars. Then you'll need to pull out the classes.dex file out of said jar file (services.jar in this case, you can just open the apk with 7zip). I found this post to be a good reference for decompile/compile commands. Decompile. Do edits. Compile. Replace classes.dex in the jar file with the new one.
I can *try* and help you some more if you like... I'm no pro at this
birgertime said:
for editing code like this, you need to download smali/baksmali jars. Then you'll need to pull out the classes.dex file out of said jar file (services.jar in this case, you can just open the apk with 7zip). I found this post to be a good reference for decompile/compile commands. Decompile. Do edits. Compile. Replace classes.dex in the jar file with the new one.
I can *try* and help you some more if you like... I'm no pro at this
Click to expand...
Click to collapse
I will take a look at this info. Appreciated. Worked perfectly! Thanks dudes!
s0niqu3 said:
Hey everyone,
I guess this can be considered my "random act of kindness" for the year since I know that it will almost certainly be kanged over and over with out thanks/credit given.
Anyway I just figured out how to display the "H" icon in the status bar properly. And by that I mean, no renaming or duplicating drawable files in framework-res.apk, and the icon will show all data states now:
GSM, GPRS, Edge, 3G, HSDPA
I've only tested it for a few minutes myself, but thankfully the signal in my bedroom can be a bit flaky, so I've seen it bounce between 3G and H already, and I disabled 3g to make sure the "E" for edge still works fine too.
Anyway, decompile services.jar, and open /com/android/server/status/StatusBarPolicy.smali
Then search for ".method private final updateDataNetType(I)V" in and replace the entire method with this:
Code:
.method private final updateDataNetType(I)V
.registers 3
.parameter "net"
.prologue
.line 1381
packed-switch p1, :pswitch_data_30
.line 1409
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
.line 1412
:goto_7
return-void
.line 1383
:pswitch_8
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_e:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1386
:pswitch_d
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_3g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1391
:pswitch_12
iget-boolean v0, p0, Lcom/android/server/status/StatusBarPolicy;->mHspaDataDistinguishable:Z
if-eqz v0, :cond_1b
.line 1392
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_h:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1394
:cond_1b
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_3g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1399
:pswitch_20
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_1x:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1402
:pswitch_25
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_1x:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1406
:pswitch_2a
sget-object v0, Lcom/android/server/status/StatusBarPolicy;->sDataNetType_3g:[I
iput-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mDataIconList:[I
goto :goto_7
.line 1381
nop
:pswitch_data_30
.packed-switch 0x2
:pswitch_8
:pswitch_d
:pswitch_20
:pswitch_2a
:pswitch_2a
:pswitch_25
:pswitch_12
:pswitch_12
:pswitch_12
.end packed-switch
.end method
And if you haven't noticed by now, I HATE this samsung bs and would kill for an AOSP or CM rom, lol.
Cheers, =)
P.S., next up (hopefully) a user selectable setting to hide the AM/PM flag from the status bar clock.
Click to expand...
Click to collapse
Awesome work Man... But not sure If I agree with the first part of the sentence.
My Stuff is Kanged all the Time & I don't mind to be honest.
eugene373 said:
Awesome work Man... But not sure If I agree with the first part of the sentence.
My Stuff is Kanged all the Time & I don't mind to be honest.
Click to expand...
Click to collapse
I already have the services.jar edited and working on gingerclone r2, do you want it?
dasunsrule32 said:
I already have the services.jar edited and working on gingerclone r2, do you want it?
Click to expand...
Click to collapse
You can release it if you want, I never felt the need for this...
eugene373 said:
Awesome work Man... But not sure If I agree with the first part of the sentence.
My Stuff is Kanged all the Time & I don't mind to be honest.
Click to expand...
Click to collapse
Hey Eugene,
Thanks for the compliment =)
And yeah, I was a little bitter the night I released this, lol.
But yeah, I don't honestly much care about people "kanging" unless its my theme work, re-drawing graphics from scratch sucks, a lot, so credit is very much appreciated in that area. =)
Thanks for all the hard work you do, any chance you can send me some tips on replacing the touchwiz dialer and contacts? I know you managed that on 2.1 with your Hybrid rom's, and I'd love to have them back on froyo, and I don't mind doing the work myself.
Cheers, =)
eugene373 said:
You can release it if you want, I never felt the need for this...
Click to expand...
Click to collapse
Ok, I will drop on the ginger thread.
Awesome work as always s0niqu3 .. greatly appreciated. I've created a flashable of this MOD for KB1 ... I don't know if the same file work with other release or not. This will hopefully help somebody to get it installed easier.
- KB1 H-icon StatusBar MOD
- KB1 Original StatusBar
I put together two services.jar's, one includes the H hack and one includes the H hack + the AM/PM hack, for a genuinely Ginger feel. Enjoy!
Click Me
s0niqu3 said:
Hey Eugene,
Thanks for the compliment =)
And yeah, I was a little bitter the night I released this, lol.
But yeah, I don't honestly much care about people "kanging" unless its my theme work, re-drawing graphics from scratch sucks, a lot, so credit is very much appreciated in that area. =)
Thanks for all the hard work you do, any chance you can send me some tips on replacing the touchwiz dialer and contacts? I know you managed that on 2.1 with your Hybrid rom's, and I'd love to have them back on froyo, and I don't mind doing the work myself.
Cheers, =)
Click to expand...
Click to collapse
LMAO! Oh trust me, I do understand aa bitter stand point..
But yeah I'll look into the Dailer / Contacts once I get my Dev machine back up and running & send ( DM ) you what I did in 2.1 but I've not tried 2.2 yet so Def. would like to help in anyway that I can..
P.S.
Regarding my Statement, I hope it wasn't taken out of context
as that's truly not how it was suppose to come across.
~Eugene
Will it work on KA6
I posted a fix for this as a patch on top of the Fascinate lockscreen mod last month here: http://forum.xda-developers.com/showpost.php?p=10951625&postcount=44
For those who don't feel like doing all the legwork.
tjsynkral said:
I posted a fix for this as a patch on top of the Fascinate lockscreen mod last month here: http://forum.xda-developers.com/showpost.php?p=10951625&postcount=44
For those who don't feel like doing all the legwork.
Click to expand...
Click to collapse
Hi,
Do you mean you added this to the lockscreen mod, or you found something wrong with the code?
If you simply added it to the mod, would you mind at least linking back to this thread for credit in your post?
And if you found a bug, would you please share the fix so I can update the OP here.
Cheers, =)
s0niqu3 said:
But yeah, I don't honestly much care about people "kanging" unless its my theme work, re-drawing graphics from scratch sucks, a lot, so credit is very much appreciated in that area. =)
Click to expand...
Click to collapse
Absolutely.
I don't give a **** when people use the Home Haptic feedback that I figured out for Captivate, but when people start stealing my theme it pisses me off.
I had a couple people ask me how to do this. I figured I would put together a brief thread on how to accomplish this. I may expand it later if people need more help. This is intended for ROM devs only; however, that should not stop anyone from trying.
The snippet of code below will allow you to turn night mode on/off. Night mode essentially turns off all of the led lights on your phone. I believe the method setNightMode is in most, if not all, Sense roms. I do not believe it is in AOSP.
This can be added as a setting in your Display preferences with a little work. I will attach what I changed on my rom to add the setting. If your rom is based off of the stock inc rom, then you can just replace your files with mine and recompile to get the feature. In addition, you will need to add two strings (night_mode_title & night_mode_summary) to public.xml and strings.xml.
Code:
const-string v1, "power"
const/4 v2, 0x1
const/4, v3, 0x0
invoke-static {v1}, Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v1
invoke-static {v1}, Landroid/os/IPowerManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IPowerManager;
move-result-object v1
#turn on
invoke-interface {v1, [COLOR="Red"]v2[/COLOR]}, Landroid/os/IPowerManager;->setNightMode(I)V
#turn off
invoke-interface {v1, [COLOR="Red"]v3[/COLOR]}, Landroid/os/IPowerManager;->setNightMode(I)V
Reserved for future use ...
Thanks bud, Ill try my luck with it
Cool!!! I'll have to try this
Hi guys,i translated the key part of this guide,untill now,this guide is not completed ,if it updated ,i'll update this thread too
and until now,our MIUI PORT TEAM have these guys:
me,gabwerkz,redy2006
N00BY0815 and SquaDrive after read this post and if you want to join in plz let me know anyone else wants to join in are welcomed
===========================================line
1.A Sample For Smali
imagane that there's a Hello worlk application,we install the apk and open it,we can see a blackscreen and at the first line written:Hello world!
ok,this is a simple app.now we decompile it.
===================
we get a folder,then find the HelloActivity.smali,there's its content:
Code:
.class public Lcom/example/android/helloactivity/HelloActivity;
.super Landroid/app/Activity;
.source "HelloActivity.java"
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 27
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
return-void
.end method
# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
.locals 2
.parameter "savedInstanceState"
.prologue
.line 33
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
.line 37
const/high16 v1, 0x7f03
invoke-virtual {p0, v1},
Lcom/example/android/helloactivity/HelloActivity;->setContentView(I)V
.line 38
const/high16 v1, 0x7f05
invoke-virtual {p0, v1},
Lcom/example/android/helloactivity/HelloActivity;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
.line 39
.local v0, txtView:android/widget/TextView;
const/high16 v1, 0x7f04
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V
.line 40
return-void
.end method
"#" refers to notes.
begin with a dot named "annotations".
".line" means line number,it mainly used for debug.
.metho and .end method means a method's starting and endding.
more code plz goto http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
now we want to change the "Hello,world!" into "Happy,Craker!",what should we do?
in this smali
.lne 39 is
Code:
.local v0, txtView:android/widget/TextView;
const/high16 v1, 0x7f04
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V
and actually the source code is
Code:
txtView.setText(R.string.hello_activity_text_text)
here we can see it define a textview with R.string.hello_activity_text_text ,and i guess the string "Hello world!" is in it.
now we could not change the string,but we can replace it by change it directly
but how we do it in smali?
here we go
Code:
.line 39
.local v0, txtView:android/widget/TextView;
const-string v1, "Happy, Cracker!"
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
ps.i can't explane it more clearly,but we can see we replace the id with our string.
==========================
2.Porting MIUI Framework
Before starting i should tell us :all porting is based on deodexed files.and there's a stock android rom and miui rom to show you a example to understand how we make the porting work.
the main idea is change the smali code to port it.cause we can't get the souce code of miui,and by this way we can port it to our phone too.
the three files we should touch is :framework.jar ,android.policy.jar andservices.jar.they are the "core" of android system
there's an attach file download and open it we can see:
porting-miui/
|-----------------android
|------------framework.jar
|------------services.jar
|------------android.policy.jar
|------------------miui
|----------framework.jar
|----------services.jar
|----------android.policy.jar
|-----------framework-res/
|-----------framework-miui-res.apk
the android folder is from stock android ,miui folder is miui's files,and we need your phone's files here too.and in this guide we assume your phone is I9100.now we should decompile all of them and compare,to "patch" miui things to your phone.
that means ,we need to compare stock files with our files,compare stock files with miui files
i.porting resources
decompile framework-res.apk,all the resources in miui we need porting to our rom,so copy them to your compiled framework-res folder and then recompile it.
framework-miui-res.apk is a resouces package,all the miui apps need it.in our rom we can find RES_cappuccino.apk,RES_sui.apk and RES_model.apk.
usually miui's resource's id is started with 0x03,and the stock rom has two resouce package,framework-res.apk is started with 0x01 and another is started with 0x02.so if your phone has more than two package,you need contact with us.in the future we'll considering make the resouce's id started with 0x06 in miui.
ii.after we finish the decompile we can use the script rmline.sh to delete all the lines started with .line to make us more easier to compare the difference with two smali code.but backup the original decomplied files first plz.we can debug from it.
then,if you based on linux,you'd try meld to compare,if you are on windows,use beyoun compare
between stock and miui,we can see there's a lot of new classes which started with Miui,and a new miui folder,just copy those new files and folders to our stock folders(with .line)
in the attach file,there's a change-list file,which list what miui did change.maybe it's a little different with what we compared by ourselves,but it's nop (dummy instruction),it caused by apktool,so we don't need to care it,just compare listed files.
there are 3 solutions
1.ex. ActivityThread.smali,miui changed the method "getTopLevelResources",but i9100's and stock is the same,this is the easiest situation and we can replace the miui code into our files happily
2.also in ActivityThread.smali,miui changed the another method "applyConfigurationToResourcesLocked",and after comparation,we can see miui changed this method,so i9100 does.then what should we do?let's see the miui's code first
Code:
.method final applyConfigurationToResourcesLocked(Landroid/content/res/Configuration;)Z
invoke-virtual {v5, p1}, Landroid/content/res/Configuration;->updateFrom(Landroid/content/res/Configuration;)I
move-result v0
.local v0, changes:I
invoke-static {v0}, Landroid/app/MiuiThemeHelper;->handleExtraConfigurationChanges(I)V
invoke-virtual {p0, v7}, Landroid/app/ActivityThread;->getDisplayMetricsLocked(Z)Landroid/util/DisplayMetrics;
move-result-object v1
.local v1, dm:Landroid/util/DisplayMetrics;
at line 5 is what miui changed.before that,we should know some rule about smali
all the local variable is started with "v"
.locals 8 means this method use 8 local variables.
all the parameters are started by "p".and local variable and parameters started from 0.for all the nonstatic method,p0 means itself,i.e "this" pointer.
here we can see miui added a new static method,the code like this we call it linear code.it as one entry and one exit.and in compiler it called basic block.
so we just need to copy this block and paste into 9100's files at the same position,and we done.
3.for example,in Resources.smali,miui changed the "loadDrawable" method.here's the code
Code:
.method loadDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
.end local v8 #e:Ljava/lang/Exception;
.end local v13 #rnf:Landroid/content/res/Resources$NotFoundException;
:cond_6
invoke-virtual/range {p0 .. p2},
Landroid/content/res/Resources;->loadOverlayDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
move-result-object v6
if-nez v6, :cond_1
:try_start_1
move-object/from16 v0, p0
from line 6 to line 9 is what miui added.then we compare 9100 and stock android,we can find it's totally different.then how should we do now?
the key is find the added code's entry and exit.
at line 4 we see a ":cond_6",it says there should be a goto command to this :cond_6.so we got to find where used the :cond_6 and we finally got this:
Code:
const-string v15, ".xml"
invoke-virtual {v9, v15}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v15
if-eqz v15, :cond_6
read this code block carefully,and seems it is check if the string "v9" is ending with ".xml",if not,goto :cond_6 .ok ,let's go to see 9100's framework.
so we search ".xml" in the loadDrable method.find this:
Code:
const-string v17, ".xml"
move-object v0, v10
move-object/from16 v1, v17
invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v17
if-eqz v17, :cond_b
the logic is same as which in miui hmm?so goto :cond_b ,what we can see is totally same as miui's :cond_6 right? so we are sure this is where miui changed
look at the exit,miui has two exit point
one is if-nez v6, :cond_1 ,if so,goto :cond_1,if not,go on.so let's see what the :cond_1 did
here's cond_1's code
Code:
:cond_1
:goto_1
if-eqz v6, :cond_2
move-object/from16 v0, p1
iget v0, v0, Landroid/util/TypedValue;->changingConfigurations:I
and in 9100's file we can find this
Code:
:cond_1
:goto_1
if-eqz v7, :cond_2
move-object/from16 v0, p1
iget v0, v0, Landroid/util/TypedValue;->changingConfigurations:I
this time it check the v7's value,so we should add this into 9100
Code:
invoke-virtual/range {p0 .. p2},
Landroid/content/res/Resources;->loadOverlayDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
move-result-object v7
if-nez v7, :cond_1
a little dizzy hmm?take a break time and go back
iii.and the last we'll talk about inner class.
every inner class have a separete smali file.
e. ActivityThread$1.smali
if it is a Anonymous class,the name should be "outer class+$+number",else it should be "outer class+$+inner class"as its name.
if a inner class use outer class's privte method,the compiler will auto fill a static function like this:
Code:
public class Hello {
public class A {
void func() {
setup();
}
}
private void setup() {
}
we use the outer class's setup method in inner class A's "func" method.and we'll get the smali code:
part of Hello$A.smali
Code:
# virtual methods
.method func()V
.locals 1
.prologue
.line 5
iget-object v0, p0, LHello$A;->this$0:LHello;
#calls: LHello;->setup()V
invoke-static {v0}, LHello;->access$000(LHello;)V
.line 6
return-void
.end method
part of Hello.smali
Code:
.method static synthetic access$000(LHello;)V
.locals 0
.parameter
.prologue
.line 1
invoke-direct {p0}, LHello;->setup()V
return-void
.end method
we can see the compiler auto made a access$000 method,if we use a outer class's private method in a more complicate inner class,it'll made a new method,but every class may have various new class name,it changes a lot .compare it carefully,find the private method and find a name that you ever seened.
iiii.Finally there are some advices:
1.careful,find where to add miui's code
2.notice the local variable number
3.step by step,if you done a part of port,recompile it to see if it work
4.find a problem is not neccessary,use adb logcat and find what caused the problem.
5.more practice and you'll handle the smali code
==================================
because of my bad english ,if you can understand what i mean,plz point me out and i'll correct it as i can
if you think this post may help you,press the thanks button
here's the attachment:
http://www.multiupload.com/I33A07PRTF
For God Sake..
ahahahaha...
My head goin crazy...><..
maybe i need a little walk by learn..
after read those stuff i got fired up..
i want to learn Android from this..
can u guys teaching me little by little??
if so, count me on..i'm ready for testing every single build
and ready to burst my brain to learn this stuff..
SquaDrive said:
For God Sake..
ahahahaha...
My head goin crazy...><..
maybe i need a little walk by learn..
after read those stuff i got fired up..
i want to learn Android from this..
can u guys teaching me little by little??
if so, count me on..i'm ready for testing every single build
and ready to burst my brain to learn this stuff..
Click to expand...
Click to collapse
just use search...
after i tranlated this guide,i'd say i've understand a part of the "how to",and i'll gonna have a try based on v20n
dxdiag32 said:
after i tranlated this guide,i'd say i've understand a part of the "how to",and i'll gonna have a try based on v20n
Click to expand...
Click to collapse
Nice... and I'm just waiting here for your progress... LOL
Man, you got moves like jagger.
good luck dxdiag
Is there some progress?
Sent from my LG-P970 using XDA App
I would like to help, but I have too work now...
Good luck!
I think Huexxx should start porting MIUI to ours blacks xd His rom is good at this moment so he can make some break and create MIUI
doooh !
I really would offer my help but the only dev related thing I know is scripting with nsis. I don't know coding even if I'm pretty sure scripting and coding have similar principles. I don't even know what deodexing / zipaligning mean
As I learned everything by myself I know that all guides can't do 100% of the job. Learning is the key.
So I'm not sure if I can contribute but it will be a pleasure to join to your work.
Any news guys ?
Sent from my LG-P970 using xda premium
Hello Everyone,
Here, being on XDA, is like learning new things in a school and getting project homework on daily basis. And Speaking for this, I really like it.
So here is the project that I cleared today morning at around 4.30 AM IST (Indian Standard Time).
But before beginning for project let me THANK few IDOLS of XDA.
@tdunham - You are the master of Power menu Sir. Compared files with your guide. @Adi Aisiteru Reborn - The GOD of MOD & Guides for CM / AOSP / AOKP @ankurbata- For the files I used for comparing.
@Dzol Cp- You are the One brother who taught me these things.
@bombaybadboy-Awesome Thread by You Sir. Got everything working whenever I take help from your thread.
@Goldieking- For helping me in rectifying error.
@Ticklefish- Awesome and Simplest tool for Themers and noobs like me.
@My Wife - My Life's Companion, Dearest Friend, My Love & Encouragement. I love you Sweet-Heart. @Xda Forum- The School for New born Techie child like me.
Before beginning to this guide, please make sure that you followed this guide by tdunham line by line and you failed doing so.
I tried this on my Stock ROMs and Other ported ROMs of My Device forum and got this working.
PART-1
1st Step:-
Decompile Your framework-res.apk and go to - res/value/strings.xml
add this line at the end.
Code:
<string name="global_action_screenshot_txt">Screenshot</string>
<string name="global_action_recovery_txt">BOND Recovery</string>
And add the png attached in this thread to - res/value/drawable-hdpi/mdpi/xhdpi (any one folder you can choose to add the images as according to your device resolution).
Step-2
Now recompile the framework-res.apk and then again decompile the newly compiled framework-res.apk
Then go to - res/values/public.xml and leave it open.
PART-2
Step-1
Now Decompile your stock "android.policy.jar" and add the attached "android.policy" files to - "android.policy.jar\smali\com\android\internal\policy\impl"
Now open GlobalActions.smali.
and find this lines.
Code:
.field private mRingerModeReceiverRegistered:Z
Just below this line make space for a line just like as its there (One space above the line & One space below)
Then Add these lines
Code:
.field mScreenshotConnection:Landroid/content/ServiceConnection;
.field final mScreenshotLock:Ljava/lang/Object;
.field final mScreenshotTimeout:Ljava/lang/Runnable;
Now find this line
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
Add these line below that.
Code:
.line 315
new-instance v4, Ljava/lang/Object;
invoke-direct {v4}, Ljava/lang/Object;-><init>()V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
.line 317
const/4 v4, 0x0
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
.line 318
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$12;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$12;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
Now Find This line -
Code:
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
.parameter "x0"
.prologue
.line 68
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->handleShow()V
return-void
.end method
And Add the line below end method.
Code:
.method static synthetic access$1900(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
.parameter "x0"
.prologue
.line 64
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->takeScreenshot()V
return-void
.end method
Now find this line
Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
And add this line below this method and above the line starting with-".line XXX"
Code:
.line 232
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080691 [COLOR=Lime]<-------- This is the ID of "bond_screenshot"[/COLOR]
const v4, 0x1040516 [COLOR=Red] <-------- This is the ID of "global_action_screenshot_txt"[/COLOR]
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$14;
const v3, 0x1080692[COLOR=Lime] <-------- This is the ID of "bond_recovery"[/COLOR]
const v4, 0x1040517 [COLOR=Red]<-------- This is the ID of "global_action_recovery_txt"[/COLOR]
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$14;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Now Find this line--
Code:
# virtual methods
And add this lines just above it with gap of 2(two) Space between "end method" & "Virtual methods"
Code:
.method private takeScreenshot()V
.locals 8
.prologue
.line 330
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
monitor-enter v4
.line 331
:try_start_0
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
if-eqz v3, :cond_0
.line 332
monitor-exit v4
.line 391
:goto_0
return-void
.line 334
:cond_0
new-instance v0, Landroid/content/ComponentName;
const-string v3, "com.android.systemui"
const-string v5, "com.android.systemui.screenshot.TakeScreenshotService"
invoke-direct {v0, v3, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
.line 336
.local v0, cn:Landroid/content/ComponentName;
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
.line 337
.local v2, intent:Landroid/content/Intent;
invoke-virtual {v2, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
.line 338
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$BondB;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/GlobalActions$BondB;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
.line 386
.local v1, conn:Landroid/content/ServiceConnection;
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
const/4 v5, 0x1
invoke-virtual {v3, v2, v1, v5}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
move-result v3
if-eqz v3, :cond_1
.line 387
iput-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
.line 388
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
const-wide/16 v6, 0x2710
invoke-virtual {v3, v5, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
.line 390
:cond_1
monitor-exit v4
goto :goto_0
.end local v0 #cn:Landroid/content/ComponentName;
.end local v1 #conn:Landroid/content/ServiceConnection;
.end local v2 #intent:Landroid/content/Intent;
:catchall_0
move-exception v3
monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v3
.end method
Few Things to remeber:-
1) The ID's Need to be Same as in public.xml or else boot loop will shake your hands.
2) The register values like - v0,v1,v2.... need to be managed like what it is in your GlobalActions.smali. For the Comparison I have attached My-GlobalActions.smali for comparison.
Just change the extention from zip to smali.
3) I am also human and will be here after my daily life. So please have patience. I will try to get you out of your problem, if and only if you have a adb logcat.
4) If you find any difficulties then post it in the thread.
The Results after successful completion of this will be same as screenshot.
http://dl.xda-developers.com/attach.../7/6/5/2/2/Screenshot_2013-08-09-02-00-21.jpg
Last But Not Least - Don't get bothered to hit thanks. It will not cost you anything but will surely increase my courage to work and try new things.
Awesome Guide My Brother!!
Happy Eid Mubarak to You and rest of your family
Dzol Cp said:
Awesome Guide My Brother!!
Happy Eid Mubarak to You and rest of your family
Click to expand...
Click to collapse
Thanks a lot brother...
Happy EID to you and The whole XDA family of ours brother...
"""Hitting Thanks Don't Cost You Anything So Why Don't You Try Hitting It......."""
Sent From Mind Blowing Canvas Using SUVI-Heart Rom.....<3<3<3
"Happy EID to you all and the whole XDA Family "
Hey, i want to ask something. What is the meaning of line 315 on this ".line315 new-instance v4, Ljava/lang/Object;"? Sorry, just want to know a bit java programming Thanks for your help
i manage to make it bro..sadly after pressing screenshot my phone reboots..but recovery is working just fine..great tut..
BOND1987 said:
Thanks a lot brother...
Happy EID to you and The whole XDA family of ours brother...
"""Hitting Thanks Don't Cost You Anything So Why Don't You Try Hitting It......."""
Sent From Mind Blowing Canvas Using SUVI-Heart Rom.....<3<3<3
Click to expand...
Click to collapse
I did as your followers. click on the menu button to display the power source immediately my phone reboot
Looking forward to your help
vuong95vjpboy said:
I did as your followers. click on the menu button to display the power source immediately my phone reboot
Looking forward to your help
Click to expand...
Click to collapse
Upload you global actions.smali and public.xml of framework....
"" Hitting Thanks Will Not Cost You Anything, So, Why Don't You Try Hitting It Once.....""
Sent While Checking The "AMOI 4.2.2 Beast".....
BOND1987 said:
Upload you global actions.smali and public.xml of framework....
"" Hitting Thanks Will Not Cost You Anything, So, Why Don't You Try Hitting It Once.....""
Sent While Checking The "AMOI 4.2.2 Beast".....
Click to expand...
Click to collapse
Hi sir, my GlobalActions.smali has different with your file, so i dont know put the code in what line
Can you help me? I attach my original GlobalActions.smali, can you mod the code help me? Thanks!
The id in my framework is:
Code:
<public type="drawable" name="bond_recovery" id="0x010805ef" />
<public type="drawable" name="bond_screenshot" id="0x010805f0" />
<public type="string" name="global_action_screenshot_txt" id="0x010404d5" />
<public type="string" name="global_action_recovery_txt" id="0x010404d6" />
My phone was use MTK chipset, ICS 4.0.4. Here is my power menu screenshot
Thanks!
^
^
@BOND1987 Can you help me sir? Thanks!
sieuan said:
^
^
@BOND1987 Can you help me sir? Thanks!
Click to expand...
Click to collapse
Yes brother,
Of course I'll help you. Yesterday night I corrupted my windows so brother you have to wait for today and tomorrow I'll do this for you.
BOND1987 said:
Yes brother,
Of course I'll help you. Yesterday night I corrupted my windows so brother you have to wait for today and tomorrow I'll do this for you.
Click to expand...
Click to collapse
Thanks sir!
After follow the guide in this thread: http://forum.xda-developers.com/showthread.php?t=2225970, I succes add 3-Way boot to Power Menu, and it work good
Before:
After:
Now, can you help me add screenshot option into Power Menu, sir? Here is my GlobalActions.smali. Thanks!
sieuan said:
Thanks sir!
After follow the guide in this thread: http://forum.xda-developers.com/showthread.php?t=2225970, I succes add 3-Way boot to Power Menu, and it work good
Before:
After:
Now, can you help me add screenshot option into Power Menu, sir? Here is my GlobalActions.smali. Thanks!
Click to expand...
Click to collapse
I absolutely love your set up. What ROM / Theme is that?
babalonius508 said:
I absolutely love your set up. What ROM / Theme is that?
Click to expand...
Click to collapse
A Vietnamese ROM, for a Chinese phone, modify by me with light holo theme, apex launcher and miui v5 icon pack.
That's a very cool setup! Thanks!
I can't seem to open the GlobalActions.smali in the OP for comparison because it says its corrupt? Any one else have this problem?
babalonius508 said:
That's a very cool setup! Thanks!
I can't seem to open the GlobalActions.smali in the OP for comparison because it says its corrupt? Any one else have this problem?
Click to expand...
Click to collapse
Brother,
Change the extension of zip to .Smali.
Or try opening with notepad++ and you will be able to coordinate with the guide as well.
If you get any problems further to this, just let me know by post it in this thread.
BOND1987 said:
Brother,
Change the extension of zip to .Smali.
Or try opening with notepad++ and you will be able to coordinate with the guide as well.
If you get any problems further to this, just let me know by post it in this thread.
Click to expand...
Click to collapse
Thanks a lot man! I missed that part of the instructions. Does this modification work for all devices?
babalonius508 said:
Thanks a lot man! I missed that part of the instructions. Does this modification work for all devices?
Click to expand...
Click to collapse
I think brother,
Other than TouchWiz, it will work on all AOSP based devices. Though I'm not sure for this but you can try. If you are in trouble, just let me know.
BOND1987 said:
I think brother,
Other than TouchWiz, it will work on all AOSP based devices. Though I'm not sure for this but you can try. If you are in trouble, just let me know.
Click to expand...
Click to collapse
Thank you for all your help!
For some reason, after I finish the modification, I hold the power button and my phone just reboots. I'm not sure what I'm doing wrong.
Here is my framework-res.apk: https://db.tt/xy0QGFiH
And my androidpolicy.jar: https://db.tt/IOe6JAkn
And a logcat: https://db.tt/EiN6Qcot
Thank you again!
babalonius508 said:
Thank you for all your help!
For some reason, after I finish the modification, I hold the post menu and my phone just reboots. I'm not sure what I'm doing wrong.
Here is my framework-res.apk: https://db.tt/xy0QGFiH
And my androidpolicy.jar: https://db.tt/IOe6JAkn
And a logcat: https://db.tt/EiN6Qcot
Thank you again!
Click to expand...
Click to collapse
Brother,
Give me 24 hours only to take look on your files. And I will revert you back as soon as possible. Thanks for posting it here. I appreciate your support brothers.
That sounds great! Thank you! I really hope I can get it working.
Sent from my Nexus 4
hi guys,
anyone an idea to disable (hack, apk, ...) the wifi popup notification whenever wifi is connected.
This drives me crazy ...
This notification is absolutely senseless, when connection is on i see it in the notification bar ...
I found a description but only for S III Verizon.
JackoMJ
JackoMJ said:
hi guys,
anyone an idea to disable (hack, apk, ...) the wifi popup notification whenever wifi is connected.
This drives me crazy ...
This notification is absolutely senseless, when connection is on i see it in the notification bar ...
I found a description but only for S III Verizon.
JackoMJ
Click to expand...
Click to collapse
Hi! Try this:
- decompile secsettings.apk
- go to file "smali\com\android\settings\wifi\WifiStatusReceiver.smali"
- open in notepad++ and find this code:
Code:
.line 194
invoke-virtual {v3}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v1
const v4, 0x102000b
invoke-virtual {v1, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/TextView;
.line 195
const/16 v4, 0x11
invoke-virtual {v1, v4}, Landroid/widget/TextView;->setGravity(I)V
.line 196
[COLOR="Red"]invoke-virtual {v3}, Landroid/widget/Toast;->show()V[/COLOR]
goto :goto_1a3
And change it to (just add # before it):
Code:
[COLOR="Red"]#invoke-virtual {v3}, Landroid/widget/Toast;->show()V[/COLOR]
Thats all - save, recompile, copy to phone, restart and hope
somin.n said:
Hi! Try this:
- decompile secsettings.apk
- go to file "smali\com\android\settings\wifi\WifiStatusReceiver.smali"
- open in notepad++ and find this code:
Code:
.line 194
invoke-virtual {v3}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v1
const v4, 0x102000b
invoke-virtual {v1, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/TextView;
.line 195
const/16 v4, 0x11
invoke-virtual {v1, v4}, Landroid/widget/TextView;->setGravity(I)V
.line 196
[COLOR="Red"]invoke-virtual {v3}, Landroid/widget/Toast;->show()V[/COLOR]
goto :goto_1a3
And change it to (just add # before it):
Code:
[COLOR="Red"]#invoke-virtual {v3}, Landroid/widget/Toast;->show()V[/COLOR]
Thats all - save, recompile, copy to phone, restart and hope
Click to expand...
Click to collapse
Hi somin mf,
WHAT THE HELL IS GOING ON?
you are the best. Works perfect. No f****** popup any more.
How do you know or find this out because i think it´s not easy to make it.
JackoMJ
JackoMJ said:
How do you know or find this out because i think it´s not easy to make it.
Click to expand...
Click to collapse
Hehe, you are true, it is not so easy, maybe it was luck that I find it. How I find it?
- i was looking for wifi is connected to bla,bla,bla string in system apk's
- then I find its public id in public.xml file
- then I was looking for this id in *.smali files
- and then it was luck that I find proper line "invoke-virtual {XX}, Landroid/widget/Toast;->show()V", I just know that this line is making toast messages
There was some bad tests, but one of my try was working. And here is result
somin.n said:
Hehe, you are true, it is not so easy, maybe it was luck that I find it. How I find it?
- i was looking for wifi is connected to bla,bla,bla string in system apk's
- then I find its public id in public.xml file
- then I was looking for this id in *.smali files
- and then it was luck that I find proper line "invoke-virtual {XX}, Landroid/widget/Toast;->show()V", I just know that this line is making toast messages
There was some bad tests, but one of my try was working. And here is result
Click to expand...
Click to collapse
Thanks for your time and patience you spent on it.
Do you make every test like me (decompile, change, compile, copy to phone, reboot)?
Hope your Powerbutton won´t break
Or is there a program you can simulate it on your pc without using your phone really?
That´s a very interesting question i think....
JackoMJ
JackoMJ said:
Thanks for your time and patience you spent on it.
Do you make every test like me (decompile, change, compile, copy to phone, reboot)?
Hope your Powerbutton won´t break
Or is there a program you can simulate it on your pc without using your phone really?
That´s a very interesting question i think....
JackoMJ
Click to expand...
Click to collapse
Yes one change and whole process with de/compile,restart,... in round. Don't know about pc sw to simulate it, but yes it would be great. And don't worry about my power button, sometimes I have to pull out my battery because of bootloop :laugh::victory: