[DEV][MODDING] CRT, Airview, 4-way reboot, ink effect, phone, sms..etc [9/Dec/2013]

Spannaa

Recognized Contributor / Themer
Sep 13, 2010
7,022
15,699
268
Cardiff
spannaa.com
You posted this in another thread but ignored the reply. You should get a log. Whenever you ask questions you should accompany with a log. Then people can explain what its telling you and next time you may be able to fix it yourself

Sent from my SM-G900F using Tapatalk
Sorry, I pointed him there because I though it was the best place to ask.

Maybe a quick link on how to provide a log?

It'd be a shame to lose someone who's trying to learn and just needs a little help ;)

Sent from my GT-I9300...
 
  • Like
Reactions: Vivek_Neel

spotter-ssol

Member
Apr 26, 2011
34
10
0
SSOL
I have litlle/limited experiente on coding and made those modifications by try. They don't produce any crash in system. I just can't get the expected behavior (boot into recovery). A log is still needed in this case?
 

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,966
22,758
0
I have litlle/limited experiente on coding and made those modifications by try. They don't produce any crash in system. I just can't get the expected behavior (boot into recovery). A log is still needed in this case?
The hotboot is most likely a system crash. Post the file i said

Sent from my SM-G900F using Tapatalk
 

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,966
22,758
0
You have logging turned off so that is no use im afraid. Enable logging in stweaks then make it do the hotboot again then post the file

Sent from my SM-G900F using Tapatalk
 

ThaiDai

Senior Member
May 28, 2011
2,537
2,574
203
Aachen/หนองบัวลำภู
I'm sorry, but the way you answered I thought that I would have to analize the log all by myself (have no knowledge to do this).
I'll get those logs and post. Thanks.
The logs aren't necessary here (and I wonder what they would show in this case).
I just added the patch to my android.policy.jar again (didn't do this for some time).

First the "original" 4-way-button. So I could be sure it works like it should do.

Then I modified in the same way like you did and after a reboot I only had the two options (reboot, recovery).

But your modifications aren't complete because you'll still see 4 radio buttons (nr. 3 and 4 empty). And booting into recovery won't work (because it still is mapped to the fourth radio button). So with your changes we only modified the labels for the 4 options. But not the functions.

I'll try a little bit more and will search for the necessary changes now or tomorrow (not have to work). It's fun to do this again after some time.

--------------

Next one:
We have to change the size of the array from 4 to 2 (seems logical). After that the dialog is shown with only two radio buttons and the correct labels (reboot, recovery).

Code:
    .registers 3

    const/4 v0, 0x[B][COLOR=Red]2[/COLOR][/B]

    new-array v0, v0, [Ljava/lang/String;
But after that the then second option doesn't reboot into recovery but into nirvana.
Guessing there are more changes to do in one of the three "99"-smalis. Wait for more
 
Last edited:

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,966
22,758
0
The logs aren't necessary here (and I wonder what they would show in this case).
I just added the patch to my android.policy.jar again (didn't do this for some time).

First the "original" 4-way-button. So I could be sure it works like it should do.

Then I modified in the same way like you did and after a reboot I only had the two options (reboot, recovery).

But your modifications aren't complete because you'll still see 4 radio buttons (nr. 3 and 4 empty). And booting into recovery won't work (because it still is mapped to the fourth radio button). So with your changes we only modified the labels for the 4 options. But not the functions.

I'll try a little bit more and will search for the necessary changes now or tomorrow (not have to work). It's fun to do this again after some time.
Logs are useful for people to learn what they are saying in order to solve their own issues in future rather than have someone just say "here is the code....paste this". By learning to log and read the logs when modding people learn how to debug themselves...fixing issues until they have a working mod rather than being given on a plate. Thats my opinion anyway :)

Sent from my SM-G900F using Tapatalk
 
Last edited:

spotter-ssol

Member
Apr 26, 2011
34
10
0
SSOL
The logs aren't necessary here (and I wonder what they would show in this case).
I just added the patch to my android.policy.jar again (didn't do this for some time).

First the "original" 4-way-button. So I could be sure it works like it should do.

Then I modified in the same way like you did and after a reboot I only had the two options (reboot, recovery).

But your modifications aren't complete because you'll still see 4 radio buttons (nr. 3 and 4 empty). And booting into recovery won't work (because it still is mapped to the fourth radio button). So with your changes we only modified the labels for the 4 options. But not the functions.

I'll try a little bit more and will search for the necessary changes now or tomorrow (not have to work). It's fun to do this again after some time.

--------------

Next one:
We have to change the size of the array from 4 to 2 (seems logical). After that the dialog is shown with only two radio buttons and the correct labels (reboot, recovery).

Code:
    .registers 3

    const/4 v0, 0x[B][COLOR=Red]2[/COLOR][/B]

    new-array v0, v0, [Ljava/lang/String;
But after that the then second option doesn't reboot into recovery but into nirvana.
Guessing there are more changes to do in one of the three "99"-smalis. Wait for more
I've got only 2 checkboxes (without empty spaces). I suspect that the file $99$1 may have those reboot methods:

Code:
# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .registers 7
    .parameter "dialog"
    .parameter "whichButton"

    .prologue
    const/4 v2, 0x1

    const/4 v3, 0x0

    .line 282
    sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I

    const/4 v1, -0x1

    if-le v0, v1, :cond_20

    .line 291
    sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_4d

    .line 283
    sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I

    if-eq v0, v2, :cond_2c
 
  • Like
Reactions: Spannaa

ThaiDai

Senior Member
May 28, 2011
2,537
2,574
203
Aachen/หนองบัวลำภู
Logs are useful for people to learn what they are saying in order to solve their own issues in future rather than have someone just say "here is the code....paste this". By learning to log and read the logs when modding people learn how to debug themselves...fixing issues until they have a working mod rather than being given on a plate. Thats my opinion anyway :)

Sent from my SM-G900F using Tapatalk
Generally true. But not here.
You didn't answer the question: what do you want to see in the logs here? It is already clear that he missed an array definition. You'll never find this in a log. You'll only find it by analyzing the sources.

And I didn't paste only but started to explain in detail what the changes mean (because I have to understand it by myself right now when trying to "read" the sources).

Reading logs and mapping this to errors in source is another chapter of experience. Try to find the (one and only) error in a log with thousands of entries stated as error.

---------- Post added at 06:33 PM ---------- Previous post was at 06:30 PM ----------

I've got only 2 checkboxes (without empty spaces). I suspect that the file $99$1 may have those reboot methods:

Code:
    const/4 v1, 0x4

    if-eq v0, v1, :cond_4d
Yep. That's what I guessed and tried to change. First try with the usual result: boot loop
I'll try again (time limit ticking: my daughter starts to wake up - and she is top priority for me).
 
  • Like
Reactions: Wuby986

spotter-ssol

Member
Apr 26, 2011
34
10
0
SSOL
Generally true. But not here.
You didn't answer the question: what do you want to see in the logs here? It is already clear that he missed an array definition. You'll never find this in a log. You'll only find it by analyzing the sources.

And I didn't paste only but started to explain in detail what the changes mean (because I have to understand it by myself right now when trying to "read" the sources).

Reading logs and mapping this to errors in source is another chapter of experience. Try to find the (one and only) error in a log with thousands of entries stated as error.

---------- Post added at 06:33 PM ---------- Previous post was at 06:30 PM ----------



Yep. That's what I guessed and tried to change. First try with the usual result: boot loop
I'll try again (time limit ticking: my daughter starts to wake up - and she is top priority for me).
There's no rush here, my curiosity can wait. ;)
 
  • Like
Reactions: Spannaa

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,966
22,758
0
Try to find the (one and only) error in a log with thousands of entries stated as error.
Search "fatal" in the dumpstate from a reboot will give you the exact problem. No need to "try" and find anything. Why you would not do this instead of this trial and error approach is beyond me but I guess you guys like doing it this way :rolleyes:

Sent from my SM-G900F using Tapatalk
 
Last edited:
  • Like
Reactions: Spannaa

ThaiDai

Senior Member
May 28, 2011
2,537
2,574
203
Aachen/หนองบัวลำภู
Search "fatal" in the dumpstate from a reboot will give you the exact problem. No need to "try" and find anything. Why you would not do this instead of this trial and error approach is beyond me but I guess you guys like doing it this way :rolleyes:

Sent from my SM-G900F using Tapatalk
Sorry, but I think you do not understand what is happening here. This is not try and error but understanding the source right now.

"You guys" is your way to show some kind of arrogance, right?
Until now you didn't add anything helpful apart from the "standard" requirement for a log file. (Update: especially when knowing you wrote tutorials about smali etc.)

I'm not interested in these kind of exchange. And so I stop replying to "you guys", ok?
 
Last edited:

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,966
22,758
0
Sorry, but I think you do not understand what is happening here. This is not try and error but understanding the source right now.

"You guys" is your way to show some kind of arrogance, right?
Until now you didn't add anything helpful apart from the "standard" requirement for a log file.

I'm not interested in these kind of exchange. And so I stop replying to "you guys", ok?
Not arrogance. There is two of you. Assuming you are both male...plural of guy is guys...hence "you guys". Jeez...i was trying to help the guy to know where he can see the exact issue without trawling thousands of lines. Sorry if this offended you in some way.

Sent from my SM-G900F using Tapatalk
 
  • Like
Reactions: Spannaa and ThaiDai

spotter-ssol

Member
Apr 26, 2011
34
10
0
SSOL
Not arrogance. There is two of you. Assuming you are both male...plural of guy is guys...hence "you guys". Jeez...i was trying to help the guy to know where he can see the exact issue without trawling thousands of lines. Sorry if this offended you in some way.

Sent from my SM-G900F using Tapatalk
Goldie, I've deleted the old log from /data/log, enabled logging with stweaks and did the hot boot. It produced no log with that name.

---

About the code, I discovered a weird thing: reduced the options to only 3 (reboot, download, recovery) by removing only "hot boot".
Code:
    const/4 v0, 0x[COLOR="Red"][B]3[/B][/COLOR]

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "Reboot"

    aput-object v2, v0, v1

    [STRIKE]const/4 v1, 0x1[/STRIKE]

    [STRIKE]const-string v2, "Hot Boot"[/STRIKE]

    [STRIKE]aput-object v2, v0, v1[/STRIKE]

    const/4 v1, 0x[B][COLOR="red"]1[/COLOR][/B]

    const-string v2, "Download"

    aput-object v2, v0, v1

    const/4 v1, 0x[B][COLOR="red"]2[/COLOR][/B]

    const-string v2, "Recovery"

    aput-object v2, v0, v1
So, selecting "download" I've got a "hot boot" as expected.
Folowing this logic, selecting "recovery" would get me to download mode. But it goes properly to recovery! :confused:

--

Edit: I'm giving up. Thank "you guys" for your help. :D
 
Last edited:

Sami Kabir

Senior Member
Oct 3, 2012
2,233
1,406
0
2 Questions

1. I replaced (deleted) the stock Messaging app with a another one, so now attempting to open it from AOSP lock screen fails and hot reboots my phone. Is there any smali or xml changes required to fix this issue?

2. Since I've removed the stock messaging app, I no longer get that "sms notification" in a circle thingy on Samsung's default (circle) lock screen.. is there any smali or xml changes required to fix this issue too?

Sent from my GT-I9070
 

lacoursiere18

Senior Member
Jan 9, 2013
4,182
7,001
0
LbTs
2 Questions

1. I replaced (deleted) the stock Messaging app with a another one, so now attempting to open it from AOSP lock screen fails and hot reboots my phone. Is there any smali or xml changes required to fix this issue?

2. Since I've removed the stock messaging app, I no longer get that "sms notification" in a circle thingy on Samsung's default (circle) lock screen.. is there any smali or xml changes required to fix this issue too?

Sent from my GT-I9070
Yea pretty sure you have to change the call in android.policy.. on the phone now once I get to my computer I'll explain.. but someone might chime in sooner..
2nd ? I am not sure about.. I am sure you can edit some how but it would take some digging..not sure if that has been discovered yet and 4.1.2 is on the out soo.. yea;)


Sent from my SCH-I605 using XDA Free mobile app
 

lacoursiere18

Senior Member
Jan 9, 2013
4,182
7,001
0
LbTs
2 Questions

1. I replaced (deleted) the stock Messaging app with a another one, so now attempting to open it from AOSP lock screen fails and hot reboots my phone. Is there any smali or xml changes required to fix this issue?

2. Since I've removed the stock messaging app, I no longer get that "sms notification" in a circle thingy on Samsung's default (circle) lock screen.. is there any smali or xml changes required to fix this issue too?

Sent from my GT-I9070
Sorry for the delayed response. I am assuming you are on 4.1.2? If so you can check out this thread HERE. Make sure you thank him.

But you want to focus on the 2nd portion, in particular, android.policy.jar/com/android/internal/policy/impl/LockScreen$GlowPadViewMethods.smali., .method public onTrigger(Landroid/view/View;I)V..

Look here
Code:
[COLOR="red"]:sswitch_2[/COLOR]
   [COLOR="Blue"] new-instance[/COLOR] v2, Landroid/content/Intent;

    const-string v4, "android.intent.action.MAIN"

    invoke-direct {v2, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 340
    .local v2, phoneIntent:Landroid/content/Intent;
    const-string v4, "[COLOR="DarkOrange"]com.android.contacts[/COLOR]"

    const-string v5, "[COLOR="green"]com.android.contacts.activities.DialtactsActivity[/COLOR]"

    invoke-virtual {v2, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 341
    invoke-virtual {v2, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 342
    iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;

    invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1300(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;

    move-result-object v4

    invoke-virtual {v4, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 343
    iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;

    invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;

    move-result-object v4

    invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V

    goto :goto_0

    .line 348
    .end local v2           #phoneIntent:Landroid/content/Intent;
    [COLOR="Red"]:sswitch_3[/COLOR]
    [COLOR="blue"]new-instance[/COLOR] v1, Landroid/content/Intent;

    const-string v4, "android.intent.action.MAIN"

    invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 349
    .local v1, mmsIntent:Landroid/content/Intent;
    const-string v4, "[COLOR="DarkOrange"]com.android.mms[/COLOR]"

    const-string v5, "[COLOR="Green"]com.android.mms.ui.ConversationList[/COLOR]"

    invoke-virtual {v1, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 350
    invoke-virtual {v1, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 351
    iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;

    invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;

    move-result-object v4

    invoke-virtual {v4, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 352
    iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;

    invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;

    move-result-object v4

    invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V

    goto :goto_0
So basically he is adding in new switches..Phone and MMS. Now you want to change the MMS to whatever application you have now. I highlighted the new switches he put in RED. BLUE identifies adding a new instance(self explanatory)., ORANGE is the application he is calling and then finally GREEN is the activity, in particular that he wants.
You need to change the application that is called and then the activity you want to call. A good way to find out what activity you want to call is app call Activity Launcher in the PlayStore.. I will identify it for you..If you need anymore help just post back here.
Also, I am new to smali as well, so if anything I stated is incorrect, I am sure someone else will chime in:good:
 
  • Like
Reactions: Sami Kabir

Kishan14

Senior Member
Nov 23, 2013
355
543
0
27
mumbai
Need help

Heyy @majdinj
i was following your tutorial on 4-way Reboot Menu..
i did all steps provided by you... after pushing android.policy.jar my fone started properly..
but when i press and hold the power key and tapped 'Reboot'.. the device freezes and it didn't got any reboot menu and the device automatically soft rebooted... Thanks
 

maskerwsk

Senior Member
Dec 13, 2011
1,479
1,588
0
Sheffield
Heyy @majdinj
i was following your tutorial on 4-way Reboot Menu..
i did all steps provided by you... after pushing android.policy.jar my fone started properly..
but when i press and hold the power key and tapped 'Reboot'.. the device freezes and it didn't got any reboot menu and the device automatically soft rebooted... Thanks
I had the same issue a while ago. In one of the $99 files there an access$ value that looks for mContent i had to change mine to reflect the actual mContext access value

Sent from my SM-N9005 using XDA Premium 4 mobile app
 
  • Like
Reactions: Kishan14