[Q] Smali Editing - Removing check for rooted phone - Epic 4G General

I have recently rooted my phone, but ran into an issue with an app that I use for work e-mail and calendaring. The app checks to see if the phone has been rooted before fully launching.
I believe I have found the code where the app checks for compliance.
.method public getRooted()Z
.locals 1
.prologue
.line 192
iget-boolean v0, p0, Lcom/good/common/policy/ComplianceManagerPolicy;->m_checkRooted:Z
return v0
.end method
Can anyone help me return "false"?
Sorry for the noob question. I am teaching myself as I go.

Please post questions in General Section.

Code:
iget-boolean v0, p0, Lcom/good/common/policy/ComplianceManagerPolicy;->false
would be my guess. i'd need to look a bit more at the function to make sure - but that would seem at least logical.
Happy hunting.

Thanks for the reply.
I have made the change and rebuilt the apk file.
I moved the file back onto the device in the /data/app folder right over the old apk file.
Unfortunately, the app disappeared. I copied the apk to my sd-card and try to install it, but it just comes back with a message saying the application not installed.
After rebuilding the apk file, what is the correct process to get it back on the phone?
Thanks

Have to sign it...
Sent from my SPH-D700 using XDA App

Related

[Guide][ODEX/STOCK Rom only!] To get another 50% v6 Supercharged script for ICS!

Thanks to zeppelinrox and software_samurai for great tutorial of I SCream SUPERCHARGER!! and Guide Modding services.jar
And making this happening!
Credits goes to them!
Im not a developer.
Im just wanna make it easy for u.
Im not so familiar of these coding.
This should works for all android devices.
Do a Nandroid backup! In case Anything Happen!
Recommended to apply this mod to enable init.d script on stock rom.
Because when i running v6,i got a log that it didnt apply setting from 99supercharged.sh
Thus,i enabled init.d on the stock rom.
Here the steps
Step of process
1.V6 Supercharger script
2.Editing the .smali
3.Merging to the phone
4.Recovery (Wipe dalvic cache)
5.V6 Supercharger script AGAIN?
6.Violla! U Get the 100% Supercharged. If not done,repeat again. Or tell me what's the problem.
Requirement :
-For Windows Only
-Busybox 1.19.4 ! (Install using busybox installer) Thanks to xtacy for mention it.
-ODEX/STOCK ROM ONLY
-ICS
-Winrar to open .jar
-Java
-Notepad++ (Install at default location)
-Mount as MTP! or NOT STORAGE MODE
-ADB driver
-USB Debugging and Unknown source ON
Now download my batch file.
See attachment v2.1.1
Old Version
Here
STEP 1 :
Extract it to C:\ drive, the script may fail if extracted on other location.
Follow instruction in the batch and for editing,refer to this post.
STEP 2 :
When u get till "Now editing smali!!!"
p/s: If u dont get a notepad++ open a file,go edit manually this file using notepad++
Code:
.\files\frameworks\classout\com\android\server\am\ActivityManagerService.smali
Sorry if the cmd cant work for u. Im just trying to make a simple,and sometimes i cant find out how to solve it.
Follow instruction Below for editing parts :
Note:
"=======" Not to put on the file,just a break of a search.
Ignore if the ".line " mistmatch! And Ignore if u got some misvalue of the original value!
But make sure u edit according to the line.
"green" is the value to placed in
"red" is the original value
"blue" is the keyword of the search
REPLACE IT PROPERLY
Above of each line,i write the keyword to search,find it.
Search
Check in the "match case"
Now starting the editing process
======================
"visible"
======================
.line 13614
const/4 v2, 0x1
if-le v10, v2, :cond_118
.line 13615
const/4 v10, 0x3 (0x1)
.line 13616
const-string v2, "visible"
move-object/from16 v0, p1
========================
"heavy"
========================
if-ne v0, v2, :cond_154
.line 13654
const/4 v10, 0x4 (0x3)
.line 13655
const/16 v27, 0x1
.line 13656
const/4 v2, 0x0
move-object/from16 v0, p1
iput-boolean v2, v0, Lcom/android/server/am/ProcessRecord;->hidden:Z
.line 13657
const-string v2, "heavy"
move-object/from16 v0, p1
=======================
"home"
=======================
.line 13663
const/4 v10, 0x1(0x4) Note that this is for Die-Hard Launcher! To BulletProof it, make it 0x0, HTK 0x2
.line 13664
const/16 v27, 0x1
.line 13665
const/4 v2, 0x0
move-object/from16 v0, p1
iput-boolean v2, v0, Lcom/android/server/am/ProcessRecord;->hidden:Z
.line 13666
const-string v2, "home"
move-object/from16 v0, p1
=======================
"previous"
=======================
.line 13674
const/4 v10, 0x5(0x7)
.line 13675
const/16 v27, 0x1
.line 13676
const/4 v2, 0x0
move-object/from16 v0, p1
iput-boolean v2, v0, Lcom/android/server/am/ProcessRecord;->hidden:Z
.line 13677
const-string v2, "previous"
move-object/from16 v0, p1
=======================
"backup"
=======================
.line 13694
const/4 v10, 0x7(0x4)
.line 13695
const-string v2, "backup"
move-object/from16 v0, p1
=======================
"started-services"
=======================
.line 13723
const/4 v10, 0x6(0x5)
.line 13724
const-string v2, "started-services"
move-object/from16 v0, p1
========================
SAVE IT!
After Finishing editing and saving,exit it and continue to the command prompt.
REMEMBER,DONT CLOSE NOTEPAD++,IF U NOT DONE EDITING & SAVING IT YET!!!
STEP 3 :
Manually open the "services.jar" using winrar,and drag the "classes.dex" inside the "services.jar"
just click "ok"
and close it.
STEP 4 :
After a few of merge and pushing the file,now Patching! U are near close to the end!
STEP 5 :
Then reboot to recovery for wipe dalvic cache
DONE & GUDLUCK!
Tell me if u have done it,
If u get this when running v6 supercharged
==========================================
Current Minfrees = 1,1,1,1,1,1 MB
MB MB
==========================================
Click to expand...
Click to collapse
u need busybox 1.19.4 !... Thanks to xtacy! to alert me.
P/s : Sorry if my coding not correct,im noob about this,just i wanna share a easy way to u all.
P/s2 : Sometimes it doesnt work,it occur to me before,try again,mybe u got problem on editing part.
thus,start from Edit part.
P/s3 : Tell me if this work to u! if someone can polish my command,then do so and tell me.
100% Tested and working to my Xperia Pro and tablet.
Please link this post is u want to share it!
And lastly,
ALL THIS AT YOUR OWN RISK!
THANKS ME if this help u!
This script was created by zeppelinrox. I am in no way responsible for any part of this script.
This guide i created for myself and other member of other forum,and i feel wanna share what i do to get the 100% supercharged, and here it is.
And sorry for my bad english.
Wow... that's interesting indeed.
You should specify that it's for ODEX roms in the title - which makes this even more useful since the webapp along with the latest V6 Script makes it very easy for deodexed roms and there is nothing for ODEX roms (though, with the manual option, the latest V6 script will install the jar and odex files)
so during step 2,wat happen if i entered the wrong value?
This is brilliant!! Many thanks for this.
Just a small error at which my run failed..
Code:
cd %ProgramFiles%\Notepad++\
notepad++.exe %~dp0files\frameworks\classout\com\android\server\am\ActivityManagerService.smali
should be
Code:
cd [COLOR="red"]"[/COLOR]%ProgramFiles%\Notepad++\[COLOR="Red"]"[/COLOR]
notepad++.exe %~dp0files\frameworks\classout\com\android\server\am\ActivityManagerService.smali
Also, java 1.7 is not ok? I had an error there too, as the script expects java 1.6
Thanks again..
-Updated-
OK I managed to go through, but notepad++ showing weird characters.. can't read it lol.. it's gibberish..
shardul_seth said:
This is brilliant!! Many thanks for this.
Just a small error at which my run failed..
Code:
cd %ProgramFiles%\Notepad++\
notepad++.exe %~dp0files\frameworks\classout\com\android\server\am\ActivityManagerService.smali
should be
Code:
cd [COLOR="red"]"[/COLOR]%ProgramFiles%\Notepad++\[COLOR="Red"]"[/COLOR]
notepad++.exe %~dp0files\frameworks\classout\com\android\server\am\ActivityManagerService.smali
Also, java 1.7 is not ok? I had an error there too, as the script expects java 1.6
Thanks again..
Click to expand...
Click to collapse
May i know,what bit of ur os? Thanks. And can u give me,where the notepad++ be placed? Tq.
vc_stargazer said:
so during step 2,wat happen if i entered the wrong value?
Click to expand...
Click to collapse
Might got bootloop or cant get 100% supercharged.
Eugene1991 said:
-Updated-
OK I managed to go through, but notepad++ showing weird characters.. can't read it lol.. it's gibberish..
Click to expand...
Click to collapse
Weird characters? May i know?
Sent from my MK16i
My %ProgramFiles% has a space in it.. Very common cause of errors if the path is not quoted!
32-bit OS
shardul_seth said:
My %ProgramFiles% has a space in it.. Very common cause of errors if the path is not quoted!
32-bit OS
Click to expand...
Click to collapse
Oh,i see. Thanks for correcting me. But dont know y it work for me.
Nvm,i will try the code tomorrow morning. Thanks!
Sent from my mk16i
@rextor,
Brilliant work mate. This really made it simple.
I did goof up in the beginning but it was worth it to get my arc 100% Supercharged .
It might be worth mentioning that ODEX refers to the Stock ROM and you might want to stress on doing a NANDROID backup .
But I do have a question. Why do my Current Minfrees look like this?
==========================================
Current Minfrees = 1,1,1,1,1,1 MB
MB MB
==========================================
It says I'm 100% Supercharged but those are the minfree values.
Also, if I choose option 10 (Quick V6 Cust-OOMizer), if I choose to apply the values suggested by SuperMinFree Calculator, I get the following error.
/mnt/sdcard/V6_SuperCharger_for_Android-Update9_RC8.2.sh[5587]: *256: unexpected '*'
*EDIT*
Both problems solved. Changing busybox version from v1.20.1-cm9 to v1.19.4-cm9 sorted out the issue.
Thanks
xtacy! said:
@rextor,
Brilliant work mate. This really made it simple.
I did goof up in the beginning but it was worth it to get my arc 100% Supercharged .
It might be worth mentioning that ODEX refers to the Stock ROM and you might want to stress on doing a NANDROID backup .
But I do have a question. Why do my Current Minfrees look like this?
==========================================
Current Minfrees = 1,1,1,1,1,1 MB
MB MB
==========================================
It says I'm 100% Supercharged but those are the minfree values.
Also, if I choose option 10 (Quick V6 Cust-OOMizer), if I choose to apply the values suggested by SuperMinFree Calculator, I get the following error.
/mnt/sdcard/V6_SuperCharger_for_Android-Update9_RC8.2.sh[5587]: *256: unexpected '*'
*EDIT*
Both problems solved. Changing busybox version from v1.20.1-cm9 to v1.19.4-cm9 sorted out the issue.
Click to expand...
Click to collapse
Ah! i forgot that it need a custom of busybox. as it mentioned by zeppelinrox.
Thanks for remind it!
Any news to this error?
Trying merge using JDK!
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.7', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java SE Runtime Environment.
"An Error has Occured, Please merge manual way! Follow below!"
Merging Process!
Please open the services.jar using winrar
and put inside the classes.dex
(located in folder files/merge)
Click to expand...
Click to collapse
Ah, ok. Sorry. I did it already manual. Thanks for this great script!
sorry,
I'm stuck on step 2, notepad ++ doesn't open anything
I've read to look in :".\files\frameworks\classout\com\android\server\am\ActivityManagerService.smali"
But I can't find this file (it is on the computer or on the device?)
It's in the batch file you were asked to download. Navigate to that folder using Notepad ++
Swyped from my SE Xperia arc (LT15i) using Tapatalk 2
in the folder files (C:ReXs_v6/files) I have no other folder
ps: solved reinstalling java 64bit
---------- Post added at 01:01 PM ---------- Previous post was at 12:36 PM ----------
ok after reboot my device won't boot anymore
Is there a way to fix or I have to flash a new rom?
thanks
If you don't follow the instructions carefully, you'll end up with a bootloop (from personal experience. LOL! I had to reflash the fw. My mistake for not taking a nandroid backup).
So reflash the .431 fw and do the process again. Do Step 1; STOP; open Notepad++ and follow the steps.
Swyped from my SE Xperia arc (LT15i) using Tapatalk 2
All charged here. Instructions could be more clear about having to put the stuff into C-drive or else the script will fail. Also some helpful "press enter"-style prompts would be nice. I had to refer to the batch file a few times to figure out what was going on and what should I do next..
That java-version check is nasty. Here are couple of ways to find installed java path.
xtacy! said:
It's in the batch file you were asked to download. Navigate to that folder using Notepad ++
Swyped from my SE Xperia arc (LT15i) using Tapatalk 2
Click to expand...
Click to collapse
Thanks for replying for me,as im rarely online. :beer:
Barleyman said:
All charged here. Instructions could be more clear about having to put the stuff into C-drive or else the script will fail. Also some helpful "press enter"-style prompts would be nice. I had to refer to the batch file a few times to figure out what was going on and what should I do next..
That java-version check is nasty. Here are couple of ways to find installed java path.
Click to expand...
Click to collapse
I already mention it to put on c or extract it to c drive. I will put on if not,script fail.
Oh,ok i try to put on more the enter style for each what its doin,i think it uneasy to enter enter enter to much,i just put it on the important part only...
Tq! But then on the busybox shell,i dont know for each step whats going on,i dont know what code for creating a log file. Anyone know may help.
Sorry if that was a bad coding. Im just create it by reading,and referring code for just to help other people easy to supercharged their phone. If anyone got source for coding for me to guide,will be helpfull. Anyway, later i will polish it later.
Sent from my MK16i using Tapatalk 2
rexstor said:
Thanks for replying for me,as im rarely online. :beer:
Click to expand...
Click to collapse
No worries. Glad I could help.
Swyped from my SE Xperia arc (LT15i) using Tapatalk 2
Worked a treat.
Had same problem as earlier person with wrong Java installed. (Needed 64 bit)
Thanks
ICesWeak
So I followed this guide step by step, succesfully generated a services.jar file, installed via the V6SuperCharger Script, got I Scream SUPERCHARGED and said Yes to a SuperClean & Restart.
Then my phone reboots and , after a while with a pop-up "Updating Android - optimizing apps", i finally get to the home screen.
Since I've read that I should run again de V6SuperCharger Script, I found that my Ic es weak (or something like that), my question is, what am I doing wrong? maybe I shouldn't re-run the script after the wipe/reboot?
I'm sorry if this is a stupid question, but I'll really appreciate some help

[HOW TO] JB Disable increasing ringtone + Enable record feature w/o apktool

This Guide will show you how to Disable increasing ringtone and enable Record feature on Jellybean 4.1.1 without decompiling SecPhone.apk.
You will need to download the zip at the bottom of this thread and unpack folder to desktop.
Java jdk Installed and Environment Variables set correctly (if you don’t know how Google it)
SecPhone.apk for you rom (Deodexed)
Notepad ++
And 7zip.
1. Place SecPhone.apk into SecPhone Diss folder downloaded previously.
2. Hold shift and right click mouse in folder to bring up menu and click: open command prompt here.
3. Type: java -Xmx512m -jar baksmali.jar SecPhone.apk and hit Enter. When this is finished you should have a new folder called out.
4. Go to: SecPhone Diss\SecPhone.apk\smali\com\android\phone and open Ringer$1.smali with Notepad ++.
5. Search for:Landroid/media/AudioManager;->setStreamVolume(III)V .There will be 2 entries. You want the first one, it should match the code below. The v1 v6 etc may be different!
6. Delete the line marked with -- .Increasing ringtone gone!
---------------------------------------------------------------------------------------------------------
iget-object v1,v1,Lcom/android/phone/Ringer;>mAudioManager:Landroid/media/AudioManager;
-- invoke-virtual{v1, v6, v4, v5}, Landroid/media/AudioManager;->setStreamVolume(III)V
.line 573
const/4 v1, 0x7
const-wide/16 v2,0x7d0
----------------------------------------------------------------------------------------------------------
Now for the Record function. If you don’t want this function skip to step 10
7. Go to SecPhoneDiss\SecPhone.apk\smali\com\android\phone\PhoneFeature .smali and open withNotepad ++
8. Search for invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForUsa()V
9. Add the code marked with ++
----------------------------------------------------------------------------------------------------------
invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForJapan()V
.line 796
:cond_d
invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForUsa()V
.line 797
++sget-object v0, Lcom/android/phone/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
++const-string v2, "voice_call_recording"
++const/4 v4, 0x1
++invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
++move-result-object v3
++invoke-virtual {v0, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/ObjectLjava/lang/Object;
return-void
-------------------------------------------------------------------------------------------------------------------
10. Now hold shift and right click mouse in folder to bring up menu and click: open command prompt here again and this time type: java -Xmx512m -jar smali.jar out -o classes.dex when complete you will have a new file called classes.dex
11. Right click SecPhone.apk and open archive with 7zip. Inside will be a file named classes.dex replace this one with the one just made by drag drop method.
Job done!
If this helps you the please click Thanks
Be sure to checkout my rom here: http://forum.xda-developers.com/showthread.php?t=1970440
Disclaimer: Do at your own risk. I am not responsible for any damage/data loss etc from doing this Mod. No one made you do it.
Thank you! Will be trying this today.
Sent from my SCH-I535 using Tapatalk 2
gharrington said:
This Guide will show you how to Disable increasing ringtone and enable Record feature on Jellybean 4.1.1 without decompiling SecPhone.apk.
You will need to download the zip at the bottom of this thread and unpack folder to desktop.
Java jdk Installed and Environment Variables set correctly (if you don’t know how Google it)
SecPhone.apk for you rom (Deodexed)
Notepad ++
And 7zip.
1. Place SecPhone.apk into SecPhone Diss folder downloaded previously.
2. Hold shift and right click mouse in folder to bring up menu and click: open command prompt here.
3. Type: java -Xmx512m -jar baksmali.jar SecPhone.apk and hit Enter. When this is finished you should have a new folder called out.
4. Go to: SecPhone Diss\SecPhone.apk\smali\com\android\phone and open Ringer$1.smali with Notepad ++.
5. Search for:Landroid/media/AudioManager;->setStreamVolume(III)V .There will be 2 entries. You want the first one, it should match the code below. The v1 v6 etc may be different!
6. Delete the line marked with -- .Increasing ringtone gone!
---------------------------------------------------------------------------------------------------------
iget-object v1,v1,Lcom/android/phone/Ringer;>mAudioManager:Landroid/media/AudioManager;
-- invoke-virtual{v1, v6, v4, v5}, Landroid/media/AudioManager;->setStreamVolume(III)V
.line 573
const/4 v1, 0x7
const-wide/16 v2,0x7d0
----------------------------------------------------------------------------------------------------------
Now for the Record function. If you don’t want this function skip to step 10
7. Go to SecPhoneDiss\SecPhone.apk\smali\com\android\phone\PhoneFeature .smali and open withNotepad ++
8. Search for invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForUsa()V
9. Add the code marked with ++
----------------------------------------------------------------------------------------------------------
invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForJapan()V
.line 796
:cond_d
invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForUsa()V
.line 797
++sget-object v0, Lcom/android/phone/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
++const-string v2, "voice_call_recording"
++const/4 v4, 0x1
++invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
++move-result-object v3
++invoke-virtual {v0, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/ObjectLjava/lang/Object;
return-void
-------------------------------------------------------------------------------------------------------------------
10. Now hold shift and right click mouse in folder to bring up menu and click: open command prompt here again and this time type: java -Xmx512m -jar smali.jar out -o classes.dex when complete you will have a new file called classes.dex
11. Right click SecPhone.apk and open archive with 7zip. Inside will be a file named classes.dex replace this one with the one just made by drag drop method.
Job done!
If this helps you the please click Thanks
Be sure to checkout my rom here: http://forum.xda-developers.com/showthread.php?t=1970440
Disclaimer: Do at your own risk. I am not responsible for any damage/data loss etc from doing this Mod. No one made you do it.
Click to expand...
Click to collapse
Thank you.
When we're on a call and receive another call via call waiting, answering a call gives up a dialog with 2 options:
"1. Putting caller 1 on hold
2. Ending call with caller 1"
This choice imo is very stupid, since it wastes time and negates the very purpose behind call waiting.
By the time I choose an option the call gets missed.
Can you show how to set default as "put caller 1 on hold".
Sent from my GT-I9300 using xda app-developers app
Thks..that a pretty simple n straight forward guide. Tried n working on deodexed ELK4 firmware.
Sent from my GT-I9300 using xda app-developers app
Is there any guide for stock ODEXED JB rom? Please, guys, help me, really need this mode!
How should I alter these instructions for use on Ubuntu with an android development environment setup?
CorySCline said:
How should I alter these instructions for use on Ubuntu with an android development environment setup?
Click to expand...
Click to collapse
1. Insure java is installed.
2. Copy the two files downloaded baksmali.jar and smali.jar directly into home folder (remove them from SecPhone Diss folder) along with SecPhone.apk
3. Its pretty much same deal only you don't need 7zip just double click apks and they open as zip.
4.As long as the files are in home folder. instead of steps 2 + 10 just open terminal and type code.
5.In step 3 the folder created out will be created in home folder.
That should get you through if you get stuck just ask and ill try to help you. Also I just write this it might help you http://forum.xda-developers.com/showthread.php?t=2048132
its the same thing with 4.1.2 ?
F3nr1s said:
its the same thing with 4.1.2 ?
Click to expand...
Click to collapse
Yes mate will work for 4.1.2.
call recording for 4.2.1
gharrington said:
Yes mate will work for 4.1.2.
Click to expand...
Click to collapse
will work for 4.2.1?
anuar.ultimate said:
will work for 4.2.1?
Click to expand...
Click to collapse
I would say not without some modifications at least but I haven't looked yet.
What about CM10.1? Can we patch it with this? Or is it patched already out-of-the-box?
Great manual!
gharrington said:
This Guide will show you how to Disable increasing ringtone and enable Record feature on Jellybean 4.1.1 without decompiling SecPhone.apk
Click to expand...
Click to collapse
Thanks for this great manual!
DualJoe said:
What about CM10.1? Can we patch it with this? Or is it patched already out-of-the-box?
Click to expand...
Click to collapse
In CM10.1 increasing sound disabled by default
Worked on Neatrom 5.9 (SGS2). So easy and useful!
Thanks for the guide, would it be fesible to add a toggle in settings to turn increasing ring tone on and off if wanted.. Thanks again for your time
Sent from my SM-N900V using Tapatalk
Help me please
Hello,
I checked my own phone, but you said no files. Note 3 and Lollipop 5.0 installed on my phone.
What do I need to look into the file?
Thank you.

How does packed-switch work in apktool generated smali

Apologies if this belongs in other languages, I put it in Java as it's related to Java.
I just asked this over at stackoverflow.com but I'll try here too.
I'm trying to reverse engineer an apk with
Code:
apktool d
and the smali it produces contains packed-switch statements which I don't fully understand. A method contains:
Code:
packed-switch v0, :pswitch_data_0
Followed later in the code with labels like
Code:
:pswitch_X
where X is a number and at the end of the method with:
Code:
:pswitch_data_0
.packed-switch 0x7f060395
:pswitch_4
:pswitch_5
:pswitch_1
.end packed-switch
What exactly does this do? It looks like a list of places to jump to, but on what condition? What does it do with 0x7f060395?
Sent from my GT-N7100 using Tapatalk 4
RobPitt said:
Apologies if this belongs in other languages, I put it in Java as it's related to Java.
I just asked this over at stackoverflow.com but I'll try here too.
I'm trying to reverse engineer an apk with
Code:
apktool d
and the smali it produces contains packed-switch statements which I don't fully understand. A method contains:
Code:
packed-switch v0, :pswitch_data_0
Followed later in the code with labels like
Code:
:pswitch_X
where X is a number and at the end of the method with:
Code:
:pswitch_data_0
.packed-switch 0x7f060395
:pswitch_4
:pswitch_5
:pswitch_1
.end packed-switch
What exactly does this do? It looks like a list of places to jump to, but on what condition? What does it do with 0x7f060395?
Sent from my GT-N7100 using Tapatalk 4
Click to expand...
Click to collapse
I only know that the code 0x7....is an id
Sent from my GT-S5570 using xda app-developers app
I got an easy to understand reply on stackoverflow.com, from JesusFreke, I've copied it here without permission so people can see the answer within this forum:
Switches are in two parts, as you noticed. The second part you listed is the payload pseudo-instruction, that contains all the switch cases. The first part is a packed-switch instruction, which defines the register containing the value to check, and refers to a payload instruction using a label.
For a packed-switch, the case values in the payload pseudo-instruction are sequential, and only the first value is actually given (in this case, 0x7f060395)
For your example specifically, when the packed-switch instruction is executed, it will check the value of the v0 register against the 3 cases in the payload. If the value is 0x7f060395, it will jump to switch_4, if 0x7f060396, it will jump to switch_5, etc.
If the value of the register didn't match any of the cases, then execution will continue with the next instruction after the packed-switch instruction (the one with the register and label, not the payload pseudo-instruction).
The sparse-switch instruction is similar, except that its payload instruction has an explicit value associated with each case, of using sequential key values.
You can find all the nitty-gritty details in the dalvik-bytecode document.
RobPitt said:
I got an easy to understand reply on stackoverflow.com, from JesusFreke, I've copied it here without permission so people can see the answer within this forum:
Click to expand...
Click to collapse
I hereby grant you a non-revokable, unequivocal license in perpetuity to repost my SO answer here.

[Q] Add ScreenShot To EPM

i have an epm but when i want to add the screenshot its okay but went i recompile its have problem.why? this the link http://forum.xda-developers.com/showthread.php?t=2350724
That's the guide I used to add an epm to hyperion 8 rom so I know it works
You have probably done something wrong - Look at your recompile errors it will tell you
Can You Help Me
i have make it but when recompile have problem can you help me?:laugh: im using stock deodex dxlf1sir.
Like I said - It won't recompile because you have done something wrong
Without a screenshot of your Apktool error no one can help as you haven't actually said or shown why it won't recompile
Have Succesful Recompile
i have success full recompile but the mod doesnt happen
NgamTeroxx said:
i have success full recompile but the mod doesnt happen
Click to expand...
Click to collapse
I'm guessing you haven't put the public ids from the framework into the policy smali files
Read the whole first page - Post 1 AND post 2
And saying something doesn't work unfortunately you will not get a proper answer - you could have done many things wrong
all I can say I check everything you have done including putting all the codes from your public ids.xml into the smali
Thaxs for the hel sir
:laugh: thaxs alot sir
I'm guessing you haven't put the public ids from the framework into the policy smali files
Read the whole first page - Post 1 AND post 2
And saying something doesn't work unfortunately you will not get a proper answer - you could have done many things wrong
all I can say I check everything you have done including putting all the codes from your public ids.xml into the smali
Click to expand...
Click to collapse
i also tried public ids put right recompiled success but when pressing power button no option for Ss and my phone got hotboot
djraje said:
i also tried public ids put right recompiled success but when pressing power button no option for Ss and my phone got hotboot
Click to expand...
Click to collapse
if phone hot reboots chances are the wrong public ids have been used or smali been implimented wrongly
remember you have to compile and decompile the new apk to add the public ids to your public.xml
in most cases you have to remove the leading 0 when adding public ids to smali - so 0x0123456 will become 0x123456 when added to smali
also with this part remove the part in red and change the part in blue to your public ids that relate to the part marked in red in your public.xml
Code:
const/4 v1, 0x3
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$12;
const v3, [COLOR="Blue"]0x108xxxx[/COLOR] [COLOR="Red"]-> ic__lock_screenshoot.png[/COLOR]
const v4, [COLOR="Blue"]0x104xxxx[/COLOR] [COLOR="Red"]-> screencapture string[/COLOR]
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$12;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
marcussmith2626 said:
if phone hot reboots chances are the wrong public ids have been used or smali been implimented wrongly
remember you have to compile and decompile the new apk to add the public ids to your public.xml
in most cases you have to remove the leading 0 when adding public ids to smali - so 0x0123456 will become 0x123456 when added to smali
also with this part remove the part in red and change the part in blue to your public ids that relate to the part marked in red in your public.xml
Code:
const/4 v1, 0x3
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$12;
const v3, [COLOR="Blue"]0x108xxxx[/COLOR] [COLOR="Red"]-> ic__lock_screenshoot.png[/COLOR]
const v4, [COLOR="Blue"]0x104xxxx[/COLOR] [COLOR="Red"]-> screencapture string[/COLOR]
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$12;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
Click to expand...
Click to collapse
i know sir i did all things correctly but can't get it could u do it for me androidpolicy.jar

[HOWTO] Enable 2G/3G Toggle from Statusbar/Launcher

* ARTICLES MADE IN MACHINE LG G3 ANDROID 4.4.2 MACHINE DO THE SAME AND FLEXIBLE THINKING.
Preparation:
computers
Preset apktool
You must know how to use apktool okay.
File LGPhone.apk and LGSystemUI.apk was taken in Rom deodex you want Mod okay.
Begin.
A. Working with files this most important LGPhone.apk okay.
1. Decompile LGPhone.apk out
2. Navigate to the path LGPhone / smali / com / android / phone
Find PhoneGlobals.smali open in Notepad + +
> Find the following keywords.
Code:
.field private final mMediaButtonReceiver:Landroid/content/BroadcastReceiver;
> Add the following line immediately below it.
Code:
.field private final mModeReceiver:Landroid/content/BroadcastReceiver;
> Find Next line after.
Code:
mReceiver:Landroid/content/BroadcastReceiver;
> Add the following line immediately below it.
Code:
.line 236
new-instance v0, Lcom/android/phone/NetworkModeReceiver;
invoke-direct {v0}, Lcom/android/phone/NetworkModeReceiver;-><init>()V
iput-object v0, p0, Lcom/android/phone/PhoneGlobals;->mModeReceiver:Landroid/content/BroadcastReceiver;
> Find next keyword.
Code:
registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
> Add the following line immediately below it.
Code:
.line 633
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "com.android.phone.CHANGE_NETWORK_MODE"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/android/phone/PhoneGlobals;->mModeReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneGlobals;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
> Save PhoneGlobals.smali
3. NetworkModeReceiver Download this file to extract and copy all the files in the path LGPhone smali / smali / com / android / phone
4. Recompile the LGPhone.
5. Fixing what replaces it back old LGPhone.apk file.
-------- 2G/3G toggle mod Guide --------- Choimobile
B. How on LGSystemUI.apk
1. Decompile LGSystemUI.apk out
2. Navigate to the path LGSystemUI/smali/com/lge/quicksettings/
> Open QuicksettingsItemList.smali using Notepad + +
> Find and fix all the 2GOnlyHandler EcoHandler
> Save QuicksettingsItemList.smali back
3. Find LGsystemUI/res/values-xx/
> Open strings.xml by Notepad + +
> Sp_quicksettings_eco_mode_NORMAL edit> Eco mode <a> The 2G <
> Save the strings.xml
4. Find LGSystemUI/res/values
> Open bools.xml using Notepad + +
> Find eco edit keywords >false< >true< save.
5. Download the file, unzip
> Copy smali in LGSystemUI/smali/com/lge/quicksettings/handlers
> Copy image to LGSystemUI/res/drawable-xxhdpi
6. Recompile the LGSystemUI
Replace the following items in LGSystemUI/build/apk file into the root LGSystemUI.apk
- 2 image file in res/drawable-xxhdpi on LGSystemUI.apk/res/drawable-xxhdpi
- Resources.arsc on LGSystemUI.apk
- Classes.dex into LGSystemUI.apk
C. Copy LGPhone.apk and LGSystemUI.apk have to edit the system/app and set 644 memory and delete files LGPhone.odex LGSystemUI.odex go. Reboot the machine and see the results.
Note: The tutorial is done on LG G3 Android 4.4.2 on another machine thinking you have flexibility with each release and each code.
Mod Guide Choimobile 2G/3G toggle.
-Thank: chuc by choimobile.vn/forums
- source: http://choimobile.vn/threads/huong-dan-mod-toggle-2g-3g-2g-only-len-cac-may-android-lg.27391/
Xé tem [emoji16][emoji16][emoji16][emoji16][emoji16][emoji16][emoji16]
awesome works man..
thank for sharing..
Thanks mate,
Enviado desde mi LG★G3★D855®
Sent from my iball4.5d Quadro using Tapatalk 2
LGPhone.apk
Hello.Where I can get LGPhone.apk? There is no such file in apps directories (D855, 10j firmware).
PhYziCiAN said:
Hello.Where I can get LGPhone.apk? There is no such file in apps directories (D855, 10j firmware).
Click to expand...
Click to collapse
+1
There is no easier way to get this? Not even with Xposed?
Any chance to create a mod for Marshmallow?. Many people are asking for a 2G/3G/4G toggle in the status bar. What do you think?. Thanks.
Googled and found this http://forum.xda-developers.com/lg-g3/help/enable-3g-2g-lg-g3-d850-att-t3101137 easier than the old method, but thanks anyway for posting!

Categories

Resources