Hello xda'ers.
Today I post this thread to help people who want volume rocker mod in their I9100.
This thread is not supposed to be a request thread, especially for non thanking people, but is open to help, support and debug (or improves).
For DEVs the how to on jelly bean [LSJ] (add green parts)
edit PhoneWindowManager.smali in android.policy.jar
Code:
.field private mIsSensorhubEnabled:Z
.field mIsSleepWithCameraOnTop:Z
.field private mIsTablet:Z
.field private mIsVisibleSPenGestureView:Z
[COLOR="YellowGreen"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z
[/COLOR]
.field mKeyboardTapVibePattern:[J
.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;
.field mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
Code:
.field private mVolumeDownKeyTime:J
.field private mVolumeDownKeyTriggered:Z
[COLOR="YellowGreen"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
.field private mVolumeUpKeyConsumedByOneTouchReportChord:Z
.field private mVolumeUpKeyConsumedByScreenRecordChord:Z
.field private mVolumeUpKeyTime:J
.field private mVolumeUpKeyTriggered:Z
[COLOR="YellowGreen"].field mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR]
.field mWindowManager:Landroid/view/IWindowManager;
.field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
Code:
.line 7234
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$35;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$35;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
[COLOR="YellowGreen"] .line 8130
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipNext;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipNext;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.line 8131
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipPrev;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipPrev;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
[/COLOR]
.line 8132
return-void
.end method
Code:
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
.prologue
.line 5405
[COLOR="YellowGreen"] move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_c[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
.line 5406
.local v0, audioService:Landroid/media/IAudioService;
if-nez v0, :cond_7
.line 5437
[COLOR="YellowGreen"] :cond_c
:goto_c[/COLOR]
return-void
[COLOR="Red"]:goto_6[/COLOR]
Code:
.line 5435
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
[COLOR="YellowGreen"]goto :goto_c[/COLOR]
[COLOR="Red"] goto :goto_6[/COLOR]
Code:
.line 5435
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
[COLOR="YellowGreen"]goto :goto_c[/COLOR]
[COLOR="Red"]goto :goto_6[/COLOR]
add this just above .method public hasNavigationBar()Z
Code:
[COLOR="YellowGreen"].method handleVolumeLongPress(I)V
.registers 6
.parameter "keycode"
.prologue
const/4 v1, 0x1
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
const/16 v1, 0x18
if-ne p1, v1, :cond_19
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.local v0, btnHandler:Ljava/lang/Runnable;
:goto_e
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getTapTimeout()I
move-result v2
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end local v0 #btnHandler:Ljava/lang/Runnable;
:cond_19
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
.restart local v0 #btnHandler:Ljava/lang/Runnable;
goto :goto_e
.end method
.method handleVolumeLongPressAbort()V
.registers 3
.prologue
const/4 v1, 0x0
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
[/COLOR]
Code:
.line 5838
:cond_388
:goto_388
[COLOR="YellowGreen"]if-eqz v5, :cond_mir[/COLOR]
[COLOR="Red"]if-eqz v5, :cond_4f3[/COLOR]
Code:
.line 5926
.end local v6 #ex:Landroid/os/RemoteException;
:cond_4c0
move-object/from16 v0, p0
[COLOR="YellowGreen"] iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_new
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v25
if-eqz v25, :cond_new
move-object/from16 v0, p0
move/from16 v14, v18
invoke-virtual {v0, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
:cond_new
move-object/from16 v0, p0
[/COLOR]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v27, v0
if-nez v27, :cond_68
Code:
.line 5934
.end local v26 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Red"]:cond_4f3[/COLOR]
[COLOR="YellowGreen"]:cond_mir
if-nez v5, :cond_ko
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_ko
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_ko
move-object/from16 v0, p0
const/4 v3, 0x0
move/from16 v14, v18
invoke-virtual {v0, v3, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_ko[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v27, v0
if-eqz v27, :cond_68
add this method under .method sendCloseSystemWindows(Ljava/lang/StringV
Code:
[COLOR="YellowGreen"].method protected sendMediaButtonEvent(I)V
.registers 15
.parameter "code"
.prologue
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
.local v1, eventtime:J
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v11, downIntent:Landroid/content/Intent;
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v0, downEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v12, upIntent:Landroid/content/Intent;
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v3, upEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
const/4 v8, 0x1
move-object/from16 v9, p0
iput-boolean v8, v9, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
return-void
.end method[/COLOR]
done.
now add the 2 subclasses attached and recompile.
Mirko ddd said:
Hello xda'ers.
Today I post this thread to help people who want volume rocker mod in their I9100.
Mod is based on kahvitara's one, but cleaned up and easier to implement; no SDcard path, minimum delay and ready to use.
This thread is not supposed to be a request thread, especially for non thanking people, but is open to help, support and debug (or improves).
here is the smali diffs, and u can find the untouched file before of applying the mod so u can compare and implement it easily.
Tested on I9100 (my phone) but will work on US clones, and most of ICS samsung touchwized phones with some rearranging.
Currently I m on LPX, if someone cares I can provide the zip, but only with this mod and reccommended ONLY to samsung stock deodexed roms LPX.
Click to expand...
Click to collapse
Another awwsome mod by Mirko.!! Always grt to hv you arnd mate :good:
geekynoob said:
Another awwsome mod by Mirko.!! Always grt to hv you arnd mate :good:
Click to expand...
Click to collapse
Inviato dal mio GT-I9100 con Tapatalk 2
Hi Mirko.
In your file you have this code. In the stock file I am comparing to and the PhoneWindowManager$KillConcept.smali file does not exist either. Is this part new code and new file?:
Code:
.line 3674
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
tdunham said:
Hi Mirko.
In your file you have this code. In the stock file I am comparing to and the PhoneWindowManager$KillConcept.smali file does not exist either. Is this part new code and new file?:
Code:
.line 3674
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
Click to expand...
Click to collapse
i don t understand, are we talking about backto kill or volume rocker?
Mirko ddd said:
i don t understand, are we talking about backto kill or volume rocker?
Click to expand...
Click to collapse
This is for Volume Rocker. I do not have those lines or (Killconcept file) in my code. I also download this: i9100_XWLPX_Deodexed_signed.zip hoping to have stock android.policy.jar for comparison and is does not exist there either. So I thought I would ask.
Edit: I feel foolish, you put code on Github that included code for back to kill mod. I should have noticed. You may want to remove that code to prevent confusion.
tdunham said:
This is for Volume Rocker. I do not have those lines or (Killconcept file) in my code. I also download this: i9100_XWLPX_Deodexed_signed.zip hoping to have stock android.policy.jar for comparison and is does not exist there either. So I thought I would ask.
Click to expand...
Click to collapse
mate.. kill concept smali has nothing to do with volume rocker
Mirko ddd said:
mate.. kill concept smali has nothing to do with volume rocker
Click to expand...
Click to collapse
Yes, no problem. I found out as soon as I posted. Thanks.
tdunham said:
Yes, no problem. I found out as soon as I posted. Thanks.
Click to expand...
Click to collapse
lol :silly:
MirkO You Are Really Great
updated to LSJ
reupdated
Nice work
One thing tho, a fast look and seems like you have a field missing:
.field mVolumeDownPress:Ljava/lang/Runnable;
LegendK95 said:
Nice work
One thing tho, a fast look and seems like you have a field missing:
.field mVolumeDownPress:Ljava/lang/Runnable;
Click to expand...
Click to collapse
lol is there, but it s not highlighted well, damn txt editor!
can u make it for odexed one please thanks
Thanks mate for the guide, gonna try it tomorrow.
MyLifeRocks10 said:
Thanks mate for the guide, gonna try it tomorrow.
Click to expand...
Click to collapse
yoshi it s easy to implement, later this week i ll try to improve it.
I am sorry for my ignorance. But what is this supposed to do?
MySeLfPT said:
I am sorry for my ignorance. But what is this supposed to do?
Click to expand...
Click to collapse
Mmh, in OP there s a zip to flash on LSJ jelly bean deodexed rom to get skip songs while screen is off.
And there s a tutorial too to help rom developers to include this feature into their own roms.
Hope u understand now
Mirko, during screen-off single press skips the song instead changing the volume, what did I wrong?
Btw, I think the "goto_6" doesn't need to be changed to "goto_c".
Well, it seems Sammy has yet again added another great feature but forgot the option to turn it off! So as usual, we grab our shovels and fix that which is piled before us.
First, we thank Mirko ddd for his patch that allows us the option:http://forum.xda-developers.com/showthread.php?t=2095845
So as you can see, it's a nice, clean patch and will follow the format of previous toggles I've written about. This tutorial is based upon XXLSJ.
Step 1. Implement Mirko's patch as a configurable option
In ZoomManager.smali within framework.jar, we will need to patch at 3 points:
a) Add the following variable to the top of the smali after '.field private registerTiltListener:Z':
Code:
.field private final mContext:Landroid/content/Context;
b) Then we will add 3 lines to the end (ABOVE return-void) of the following method: '.method public constructor <init>(Landroid/webkit/WebViewClassic;Landroid/webkit/CallbackProxyV'
Code:
invoke-virtual {p1}, Landroid/webkit/WebViewClassic;->getContext()Landroid/content/Context;
move-result-object v0
iput-object v0, p0, Landroid/webkit/ZoomManager;->mContext:Landroid/content/Context;
c) Now we will implement the actual patch based on our newly created setting. Find '.method setEdgeZoom(Z)V' and replace the code between '.prologue' and '.line 1602' with the following:
Code:
#const/4 v5, 0x1
const/4 v4, 0x0
iget-object v2, p0, Landroid/webkit/ZoomManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "edgezoom_toggle"
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :disable_ez
const/4 v5, 0x1
goto :toggle_resume
:disable_ez
const/4 v5, 0x0
:toggle_resume
That's it for framework.jar, recompile, upload and ensure it's stable before proceeding.
Step 2. Modifying Display settings, the most involved portion of this tutorial
Decompile SecSettings.apk and find DisplaySettings.smali. We will have 5 patch points:
a) Add a new variable to top of smali after '.field private mTouchKeyLight:Landroid/preference/ListPreference;':
Code:
.field private mEdgeZoomPreference:Landroid/preference/CheckBoxPreference;
b) Search for '.method public onCreate(Landroid/os/BundleV' and add the following code after
'iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;':
Code:
const-string v12, "edgezoom_toggle"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/CheckBoxPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mEdgeZoomPreference:Landroid/preference/CheckBoxPreference;
c) In '.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ' find '.line 985' and just ABOVE it replace 'if-eqz v0, :cond_0' with:
Code:
if-eqz v0, :cond_new
d) About 20 lines below the last patch, you will see 'goto :goto_a' just before the end of the method. Paste the following code after 'goto :goto_a' but before '.end method':
Code:
:cond_new
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mEdgeZoomPreference:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mEdgeZoomPreference:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "edgezoom_toggle"
if-nez v0, :cond_newA
const/4 v0, 0x0
goto :cond_newB
:cond_newA
const/4 v0, 0x1
:cond_newB
invoke-static {v3, v4, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
e) Within '.method public onResume()V' find 'return-void' and add this code ABOVE that line:
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mEdgeZoomPreference:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "edgezoom_toggle"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :goto_2b
const/4 v1, 0x1
goto :goto_2c
:goto_2b
const/4 v1, 0x0
:goto_2c
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
That's it for DisplaySettings.smali, but we have just a few xml edits left before recompiling.
Step 3. Adding the actual setting, the easy part
In res/xml/display_settings.xml, add this line wherever you want the setting to appear:
Code:
<CheckBoxPreference android:title="@string/edgezoom_title" android:key="edgezoom_toggle" android:summary="@string/edgezoom_summary" />
In strings.xml, add:
Code:
<string name="edgezoom_title">Disable Edge Zoom</string>
<string name="edgezoom_summary">Disable edge zoom feature used in email and browsers</string>
In public.xml, add the IDs (NOTE: these numbers may differ depending on previous mods):
Code:
<public type="string" name="edgezoom_title" id="0x7f090ef4" />
<public type="string" name="edgezoom_summary" id="0x7f090ef5" />
Compile SecSettings.apk, upload and reboot. If all goes well, you should have a setting to control this new feature!
nice one jeboo thanks
Re-enable Edge Zoom on Official Release
So in typical Samsung style they decided to disable Edge Zoom in the official releases.
Here is how we re-enable it and allow the toggle int he OP to still function correctly.
Decompile framework.jar
Go here:
\framework\smali\android\view\ScaleGestureDetector.smali
Find:
Code:
[B].method public onTouchEvent(Landroid/view/MotionEvent;)Z[/B]
Replace that entire method with this:
Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 26
.parameter "event"
.prologue
.line 207
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;
move-object/from16 v24, v0
if-eqz v24, :cond_0
.line 208
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;
move-object/from16 v24, v0
const/16 v25, 0x0
move-object/from16 v0, v24
move-object/from16 v1, p1
move/from16 v2, v25
invoke-virtual {v0, v1, v2}, Landroid/view/InputEventConsistencyVerifier;->onTouchEvent(Landroid/view/MotionEvent;I)V
.line 213
:cond_0
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mValidPackage:Z
move/from16 v24, v0
if-eqz v24, :cond_1
invoke-direct/range {p0 .. p1}, Landroid/view/ScaleGestureDetector;->onEdgeTouchEvent(Landroid/view/MotionEvent;)Z
move-result v24
if-eqz v24, :cond_1
const/16 v24, 0x1
.line 310
:goto_0
return v24
.line 213
:cond_1
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v3
.line 215
.local v3, action:I
const/16 v24, 0x1
move/from16 v0, v24
if-eq v3, v0, :cond_2
const/16 v24, 0x3
move/from16 v0, v24
if-ne v3, v0, :cond_5
:cond_2
const/16 v19, 0x1
.line 217
.local v19, streamComplete:Z
:goto_1
if-eqz v3, :cond_3
if-eqz v19, :cond_6
.line 221
:cond_3
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-eqz v24, :cond_4
.line 222
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScaleEnd(Landroid/view/ScaleGestureDetector;)V
.line 223
const/16 v24, 0x0
move/from16 v0, v24
move-object/from16 v1, p0
iput-boolean v0, v1, Landroid/view/ScaleGestureDetector;->mInProgress:Z
.line 224
const/16 v24, 0x0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
.line 227
:cond_4
if-eqz v19, :cond_6
.line 228
const/16 v24, 0x1
goto :goto_0
.line 215
.end local v19 #streamComplete:Z
:cond_5
const/16 v19, 0x0
goto :goto_1
.line 232
.restart local v19 #streamComplete:Z
:cond_6
const/16 v24, 0x6
move/from16 v0, v24
if-eq v3, v0, :cond_7
const/16 v24, 0x5
move/from16 v0, v24
if-ne v3, v0, :cond_8
:cond_7
const/4 v4, 0x1
.line 235
.local v4, configChanged:Z
:goto_2
const/16 v24, 0x6
move/from16 v0, v24
if-ne v3, v0, :cond_9
const/4 v14, 0x1
.line 236
.local v14, pointerUp:Z
:goto_3
if-eqz v14, :cond_a
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getActionIndex()I
move-result v15
.line 239
.local v15, skipIndex:I
:goto_4
const/16 v20, 0x0
.local v20, sumX:F
const/16 v21, 0x0
.line 240
.local v21, sumY:F
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v5
.line 241
.local v5, count:I
const/4 v13, 0x0
.local v13, i:I
:goto_5
if-ge v13, v5, :cond_c
.line 242
if-ne v15, v13, :cond_b
.line 241
:goto_6
add-int/lit8 v13, v13, 0x1
goto :goto_5
.line 232
.end local v4 #configChanged:Z
.end local v5 #count:I
.end local v13 #i:I
.end local v14 #pointerUp:Z
.end local v15 #skipIndex:I
.end local v20 #sumX:F
.end local v21 #sumY:F
:cond_8
const/4 v4, 0x0
goto :goto_2
.line 235
.restart local v4 #configChanged:Z
:cond_9
const/4 v14, 0x0
goto :goto_3
.line 236
.restart local v14 #pointerUp:Z
:cond_a
const/4 v15, -0x1
goto :goto_4
.line 243
.restart local v5 #count:I
.restart local v13 #i:I
.restart local v15 #skipIndex:I
.restart local v20 #sumX:F
.restart local v21 #sumY:F
:cond_b
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getX(I)F
move-result v24
add-float v20, v20, v24
.line 244
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getY(I)F
move-result v24
add-float v21, v21, v24
goto :goto_6
.line 246
:cond_c
if-eqz v14, :cond_d
add-int/lit8 v10, v5, -0x1
.line 247
.local v10, div:I
:goto_7
int-to-float v0, v10
move/from16 v24, v0
div-float v11, v20, v24
.line 248
.local v11, focusX:F
int-to-float v0, v10
move/from16 v24, v0
div-float v12, v21, v24
.line 251
.local v12, focusY:F
const/4 v6, 0x0
.local v6, devSumX:F
const/4 v7, 0x0
.line 252
.local v7, devSumY:F
const/4 v13, 0x0
:goto_8
if-ge v13, v5, :cond_f
.line 253
if-ne v15, v13, :cond_e
.line 252
:goto_9
add-int/lit8 v13, v13, 0x1
goto :goto_8
.end local v6 #devSumX:F
.end local v7 #devSumY:F
.end local v10 #div:I
.end local v11 #focusX:F
.end local v12 #focusY:F
:cond_d
move v10, v5
.line 246
goto :goto_7
.line 254
.restart local v6 #devSumX:F
.restart local v7 #devSumY:F
.restart local v10 #div:I
.restart local v11 #focusX:F
.restart local v12 #focusY:F
:cond_e
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getX(I)F
move-result v24
sub-float v24, v24, v11
invoke-static/range {v24 .. v24}, Ljava/lang/Math;->abs(F)F
move-result v24
add-float v6, v6, v24
.line 255
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getY(I)F
move-result v24
sub-float v24, v24, v12
invoke-static/range {v24 .. v24}, Ljava/lang/Math;->abs(F)F
move-result v24
add-float v7, v7, v24
goto :goto_9
.line 257
:cond_f
int-to-float v0, v10
move/from16 v24, v0
div-float v8, v6, v24
.line 258
.local v8, devX:F
int-to-float v0, v10
move/from16 v24, v0
div-float v9, v7, v24
.line 263
.local v9, devY:F
const/high16 v24, 0x4000
mul-float v17, v8, v24
.line 264
.local v17, spanX:F
const/high16 v24, 0x4000
mul-float v18, v9, v24
.line 265
.local v18, spanY:F
mul-float v24, v17, v17
mul-float v25, v18, v18
add-float v24, v24, v25
invoke-static/range {v24 .. v24}, Landroid/util/FloatMath;->sqrt(F)F
move-result v16
.line 270
.local v16, span:F
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v23, v0
.line 271
.local v23, wasInProgress:Z
move-object/from16 v0, p0
iput v11, v0, Landroid/view/ScaleGestureDetector;->mFocusX:F
.line 272
move-object/from16 v0, p0
iput v12, v0, Landroid/view/ScaleGestureDetector;->mFocusY:F
.line 273
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-eqz v24, :cond_11
const/16 v24, 0x0
cmpl-float v24, v16, v24
if-eqz v24, :cond_10
if-eqz v4, :cond_11
.line 274
:cond_10
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScaleEnd(Landroid/view/ScaleGestureDetector;)V
.line 275
const/16 v24, 0x0
move/from16 v0, v24
move-object/from16 v1, p0
iput-boolean v0, v1, Landroid/view/ScaleGestureDetector;->mInProgress:Z
.line 276
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
.line 278
:cond_11
if-eqz v4, :cond_12
.line 279
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanX:F
.line 280
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanY:F
.line 281
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpan:F
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
.line 283
:cond_12
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-nez v24, :cond_14
const/16 v24, 0x0
cmpl-float v24, v16, v24
if-eqz v24, :cond_14
if-nez v23, :cond_13
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
move/from16 v24, v0
sub-float v24, v16, v24
invoke-static/range {v24 .. v24}, Ljava/lang/Math;->abs(F)F
move-result v24
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mSpanSlop:I
move/from16 v25, v0
move/from16 v0, v25
int-to-float v0, v0
move/from16 v25, v0
cmpl-float v24, v24, v25
if-lez v24, :cond_14
.line 285
:cond_13
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanX:F
.line 286
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanY:F
.line 287
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpan:F
.line 288
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScaleBegin(Landroid/view/ScaleGestureDetector;)Z
move-result v24
move/from16 v0, v24
move-object/from16 v1, p0
iput-boolean v0, v1, Landroid/view/ScaleGestureDetector;->mInProgress:Z
.line 289
const-string v24, "ScaleGestureDetector"
const-string v25, "SGD"
invoke-static/range {v24 .. v25}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 293
:cond_14
const/16 v24, 0x2
move/from16 v0, v24
if-ne v3, v0, :cond_16
.line 294
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
.line 295
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
.line 296
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
.line 298
const/16 v22, 0x1
.line 299
.local v22, updatePrev:Z
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-eqz v24, :cond_15
.line 300
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScale(Landroid/view/ScaleGestureDetector;)Z
move-result v22
.line 303
:cond_15
if-eqz v22, :cond_16
.line 304
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
move/from16 v24, v0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanX:F
.line 305
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
move/from16 v24, v0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanY:F
.line 306
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
move/from16 v24, v0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpan:F
.line 310
.end local v22 #updatePrev:Z
:cond_16
const/16 v24, 0x1
goto/16 :goto_0
.end method
Recompile to test then add the toggle from the OP.
Hope this helps.
shoman94 said:
So in typical Samsung style they decided to disable Edge Zoom in the official release (XWLS8)
Here is how we re-enable it and allow the toggle int he OP to still function correctly.
Decompile framework.jar
Go here:
\framework\smali\android\view\ScaleGestureDetector.smali
Find:
Code:
[B].method public onTouchEvent(Landroid/view/MotionEvent;)Z[/B]
Replace that entire method with this:
Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 26
.parameter "event"
.prologue
.line 207
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;
move-object/from16 v24, v0
if-eqz v24, :cond_0
.line 208
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;
move-object/from16 v24, v0
const/16 v25, 0x0
move-object/from16 v0, v24
move-object/from16 v1, p1
move/from16 v2, v25
invoke-virtual {v0, v1, v2}, Landroid/view/InputEventConsistencyVerifier;->onTouchEvent(Landroid/view/MotionEvent;I)V
.line 213
:cond_0
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mValidPackage:Z
move/from16 v24, v0
if-eqz v24, :cond_1
invoke-direct/range {p0 .. p1}, Landroid/view/ScaleGestureDetector;->onEdgeTouchEvent(Landroid/view/MotionEvent;)Z
move-result v24
if-eqz v24, :cond_1
const/16 v24, 0x1
.line 310
:goto_0
return v24
.line 213
:cond_1
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v3
.line 215
.local v3, action:I
const/16 v24, 0x1
move/from16 v0, v24
if-eq v3, v0, :cond_2
const/16 v24, 0x3
move/from16 v0, v24
if-ne v3, v0, :cond_5
:cond_2
const/16 v19, 0x1
.line 217
.local v19, streamComplete:Z
:goto_1
if-eqz v3, :cond_3
if-eqz v19, :cond_6
.line 221
:cond_3
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-eqz v24, :cond_4
.line 222
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScaleEnd(Landroid/view/ScaleGestureDetector;)V
.line 223
const/16 v24, 0x0
move/from16 v0, v24
move-object/from16 v1, p0
iput-boolean v0, v1, Landroid/view/ScaleGestureDetector;->mInProgress:Z
.line 224
const/16 v24, 0x0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
.line 227
:cond_4
if-eqz v19, :cond_6
.line 228
const/16 v24, 0x1
goto :goto_0
.line 215
.end local v19 #streamComplete:Z
:cond_5
const/16 v19, 0x0
goto :goto_1
.line 232
.restart local v19 #streamComplete:Z
:cond_6
const/16 v24, 0x6
move/from16 v0, v24
if-eq v3, v0, :cond_7
const/16 v24, 0x5
move/from16 v0, v24
if-ne v3, v0, :cond_8
:cond_7
const/4 v4, 0x1
.line 235
.local v4, configChanged:Z
:goto_2
const/16 v24, 0x6
move/from16 v0, v24
if-ne v3, v0, :cond_9
const/4 v14, 0x1
.line 236
.local v14, pointerUp:Z
:goto_3
if-eqz v14, :cond_a
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getActionIndex()I
move-result v15
.line 239
.local v15, skipIndex:I
:goto_4
const/16 v20, 0x0
.local v20, sumX:F
const/16 v21, 0x0
.line 240
.local v21, sumY:F
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v5
.line 241
.local v5, count:I
const/4 v13, 0x0
.local v13, i:I
:goto_5
if-ge v13, v5, :cond_c
.line 242
if-ne v15, v13, :cond_b
.line 241
:goto_6
add-int/lit8 v13, v13, 0x1
goto :goto_5
.line 232
.end local v4 #configChanged:Z
.end local v5 #count:I
.end local v13 #i:I
.end local v14 #pointerUp:Z
.end local v15 #skipIndex:I
.end local v20 #sumX:F
.end local v21 #sumY:F
:cond_8
const/4 v4, 0x0
goto :goto_2
.line 235
.restart local v4 #configChanged:Z
:cond_9
const/4 v14, 0x0
goto :goto_3
.line 236
.restart local v14 #pointerUp:Z
:cond_a
const/4 v15, -0x1
goto :goto_4
.line 243
.restart local v5 #count:I
.restart local v13 #i:I
.restart local v15 #skipIndex:I
.restart local v20 #sumX:F
.restart local v21 #sumY:F
:cond_b
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getX(I)F
move-result v24
add-float v20, v20, v24
.line 244
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getY(I)F
move-result v24
add-float v21, v21, v24
goto :goto_6
.line 246
:cond_c
if-eqz v14, :cond_d
add-int/lit8 v10, v5, -0x1
.line 247
.local v10, div:I
:goto_7
int-to-float v0, v10
move/from16 v24, v0
div-float v11, v20, v24
.line 248
.local v11, focusX:F
int-to-float v0, v10
move/from16 v24, v0
div-float v12, v21, v24
.line 251
.local v12, focusY:F
const/4 v6, 0x0
.local v6, devSumX:F
const/4 v7, 0x0
.line 252
.local v7, devSumY:F
const/4 v13, 0x0
:goto_8
if-ge v13, v5, :cond_f
.line 253
if-ne v15, v13, :cond_e
.line 252
:goto_9
add-int/lit8 v13, v13, 0x1
goto :goto_8
.end local v6 #devSumX:F
.end local v7 #devSumY:F
.end local v10 #div:I
.end local v11 #focusX:F
.end local v12 #focusY:F
:cond_d
move v10, v5
.line 246
goto :goto_7
.line 254
.restart local v6 #devSumX:F
.restart local v7 #devSumY:F
.restart local v10 #div:I
.restart local v11 #focusX:F
.restart local v12 #focusY:F
:cond_e
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getX(I)F
move-result v24
sub-float v24, v24, v11
invoke-static/range {v24 .. v24}, Ljava/lang/Math;->abs(F)F
move-result v24
add-float v6, v6, v24
.line 255
move-object/from16 v0, p1
invoke-virtual {v0, v13}, Landroid/view/MotionEvent;->getY(I)F
move-result v24
sub-float v24, v24, v12
invoke-static/range {v24 .. v24}, Ljava/lang/Math;->abs(F)F
move-result v24
add-float v7, v7, v24
goto :goto_9
.line 257
:cond_f
int-to-float v0, v10
move/from16 v24, v0
div-float v8, v6, v24
.line 258
.local v8, devX:F
int-to-float v0, v10
move/from16 v24, v0
div-float v9, v7, v24
.line 263
.local v9, devY:F
const/high16 v24, 0x4000
mul-float v17, v8, v24
.line 264
.local v17, spanX:F
const/high16 v24, 0x4000
mul-float v18, v9, v24
.line 265
.local v18, spanY:F
mul-float v24, v17, v17
mul-float v25, v18, v18
add-float v24, v24, v25
invoke-static/range {v24 .. v24}, Landroid/util/FloatMath;->sqrt(F)F
move-result v16
.line 270
.local v16, span:F
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v23, v0
.line 271
.local v23, wasInProgress:Z
move-object/from16 v0, p0
iput v11, v0, Landroid/view/ScaleGestureDetector;->mFocusX:F
.line 272
move-object/from16 v0, p0
iput v12, v0, Landroid/view/ScaleGestureDetector;->mFocusY:F
.line 273
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-eqz v24, :cond_11
const/16 v24, 0x0
cmpl-float v24, v16, v24
if-eqz v24, :cond_10
if-eqz v4, :cond_11
.line 274
:cond_10
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScaleEnd(Landroid/view/ScaleGestureDetector;)V
.line 275
const/16 v24, 0x0
move/from16 v0, v24
move-object/from16 v1, p0
iput-boolean v0, v1, Landroid/view/ScaleGestureDetector;->mInProgress:Z
.line 276
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
.line 278
:cond_11
if-eqz v4, :cond_12
.line 279
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanX:F
.line 280
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanY:F
.line 281
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpan:F
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
.line 283
:cond_12
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-nez v24, :cond_14
const/16 v24, 0x0
cmpl-float v24, v16, v24
if-eqz v24, :cond_14
if-nez v23, :cond_13
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mInitialSpan:F
move/from16 v24, v0
sub-float v24, v16, v24
invoke-static/range {v24 .. v24}, Ljava/lang/Math;->abs(F)F
move-result v24
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mSpanSlop:I
move/from16 v25, v0
move/from16 v0, v25
int-to-float v0, v0
move/from16 v25, v0
cmpl-float v24, v24, v25
if-lez v24, :cond_14
.line 285
:cond_13
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanX:F
.line 286
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanY:F
.line 287
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpan:F
.line 288
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScaleBegin(Landroid/view/ScaleGestureDetector;)Z
move-result v24
move/from16 v0, v24
move-object/from16 v1, p0
iput-boolean v0, v1, Landroid/view/ScaleGestureDetector;->mInProgress:Z
.line 289
const-string v24, "ScaleGestureDetector"
const-string v25, "SGD"
invoke-static/range {v24 .. v25}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 293
:cond_14
const/16 v24, 0x2
move/from16 v0, v24
if-ne v3, v0, :cond_16
.line 294
move/from16 v0, v17
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
.line 295
move/from16 v0, v18
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
.line 296
move/from16 v0, v16
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
.line 298
const/16 v22, 0x1
.line 299
.local v22, updatePrev:Z
move-object/from16 v0, p0
iget-boolean v0, v0, Landroid/view/ScaleGestureDetector;->mInProgress:Z
move/from16 v24, v0
if-eqz v24, :cond_15
.line 300
move-object/from16 v0, p0
iget-object v0, v0, Landroid/view/ScaleGestureDetector;->mListener:Landroid/view/ScaleGestureDetector$OnScaleGestureListener;
move-object/from16 v24, v0
move-object/from16 v0, v24
move-object/from16 v1, p0
invoke-interface {v0, v1}, Landroid/view/ScaleGestureDetector$OnScaleGestureListener;->onScale(Landroid/view/ScaleGestureDetector;)Z
move-result v22
.line 303
:cond_15
if-eqz v22, :cond_16
.line 304
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mCurrSpanX:F
move/from16 v24, v0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanX:F
.line 305
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mCurrSpanY:F
move/from16 v24, v0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpanY:F
.line 306
move-object/from16 v0, p0
iget v0, v0, Landroid/view/ScaleGestureDetector;->mCurrSpan:F
move/from16 v24, v0
move/from16 v0, v24
move-object/from16 v1, p0
iput v0, v1, Landroid/view/ScaleGestureDetector;->mPrevSpan:F
.line 310
.end local v22 #updatePrev:Z
:cond_16
const/16 v24, 0x1
goto/16 :goto_0
.end method
Recompile to test then add the toggle from the OP.
Hope this helps.
Click to expand...
Click to collapse
nice job man.would you please tell me how can i add the toggle from the OP?
emam damon said:
nice job man.would you please tell me how can i add the toggle from the OP?
Click to expand...
Click to collapse
Umm... follow the op instructions
Sent from my SGH-I777 using Tapatalk 2
HI... great job!!
can you tell me the best tool to use to extract the string.xml display.setting.xml e.t.c e.t.c ?
thanks
Thanks . I published that in my next build
---------- Post added at 01:32 PM ---------- Previous post was at 01:31 PM ----------
Can you maybe make a screenshot, or not ?
i get errors when i compile these they conflict with other id's
<public type="string" name="edgezoom_title" id="0x7f090ef4" />
<public type="string" name="edgezoom_summary" id="0x7f090ef5" />
are there other id's i can use?
welard said:
i get errors when i compile these they conflict with other id's
<public type="string" name="edgezoom_title" id="0x7f090ef4" />
<public type="string" name="edgezoom_summary" id="0x7f090ef5" />
are there other id's i can use?
Click to expand...
Click to collapse
Technically with this mod you shouldn't have to enter anything in public.xml. Its not an ID that you have to specify in smali so it "should" create it while compiling.
Otherwise you need to find your next available ID.
shoman94 said:
Technically with this mod you shouldn't have to enter anything in public.xml. Its not an ID that you have to specify in smali so it "should" create it while compiling.
Otherwise you need to find your next available ID.
Click to expand...
Click to collapse
ok thank you:good:
i got it working but it doesnt disable when unticked it still zooms
welard said:
ok thank you:good:
i got it working but it doesnt disable when unticked it still zooms
Click to expand...
Click to collapse
The browser has to be force closed so it had to re load into memory.
Sent from my SGH-I777 using Tapatalk 2
Nice work. I would just like zoom feature to just work for me as a zip file
Sent from my GT-I9100 using Tapatalk 2
Sorry but im trying very hard to follow the guide to build a mod for LSS Neatrom Lite but i have had a few problems if you could help plz. First problem i had was i couldnt recompile Secsetting.apk but i saw a futher post by shoman that told another member that this
Code:
<public type="string" name="edgezoom_title" id="0x7f090ef4" />
<public type="string" name="edgezoom_summary" id="0x7f090ef5" />
Wasnt needed and so i left out and compiled fine with toggle in settings.
So followed guide for Framework.jar after adding edgezoom and pushed to my device and now my browser just crashes "Unfortunately, Internet has stopped, i have tried clearing data hoping that may help but hasnt. Can anyone offer any advice please
bombaybadboy said:
Sorry but im trying very hard to follow the guide to build a mod for LSS Neatrom Lite but i have had a few problems if you could help plz. First problem i had was i couldnt recompile Secsetting.apk but i saw a futher post by shoman that told another member that this
Code:
<public type="string" name="edgezoom_title" id="0x7f090ef4" />
<public type="string" name="edgezoom_summary" id="0x7f090ef5" />
Wasnt needed and so i left out and compiled fine with toggle in settings.
So followed guide for Framework.jar after adding edgezoom and pushed to my device and now my browser just crashes "Unfortunately, Internet has stopped, i have tried clearing data hoping that may help but hasnt. Can anyone offer any advice please
Click to expand...
Click to collapse
Using the code feature, or if its too big use pastebin, please post the ZoomManager.smali text so I may look at the code. Thanks.
Edit: Also did you re-enable edgezoom from this post? http://forum.xda-developers.com/showpost.php?p=37602131&postcount=3
first edit here
Code:
.field private mZoomScale:F
.field private mZoomStart:J
.field private motionListener:Landroid/hardware/motion/MRListener;
.field private registerTiltListener:Z
.field private final mContext:Landroid/content/Context;
# direct methods
.method static constructor ()V
.registers 1
.prologue
.line 58
const-class v0, Landroid/webkit/ZoomManager;
2nd edit
Code:
invoke-direct {v0, p0}, Landroid/webkit/ZoomManager$FocusMovementQueue;->(Landroid/webkit/ZoomManager;)V
iput-object v0, p0, Landroid/webkit/ZoomManager;->mFocusMovementQueue:Landroid/webkit/ZoomManager$FocusMovementQueue;
.line 298
return-void
invoke-virtual {p1}, Landroid/webkit/WebViewClassic;->getContext()Landroid/content/Context;
move-result-object v0
iput-object v0, p0, Landroid/webkit/ZoomManager;->mContext:Landroid/content/Context;
.end method
3rd edit
Code:
.method setEdgeZoom(Z)V
.registers 12
.parameter "enabled"
.prologue
#const/4 v5, 0x1
const/4 v4, 0x0
iget-object v2, p0, Landroid/webkit/ZoomManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "edgezoom_toggle"
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :disable_ez
const/4 v5, 0x1
goto :toggle_resume
:disable_ez
const/4 v5, 0x0
:toggle_resume
.line 1602
invoke-virtual {p0}, Landroid/webkit/ZoomManager;->getScaleGestureDetector()Landroid/view/ScaleGestureDetector;
Sorry didnt see your edit, yes I enabled edge zoom from your 3rd post of this thread
Here is my complete ZoomManager.smali
If I have already put the toggle crt effect, as it should do to make them work the two?
If I put only one (does not matter which is) this works correctly, but want to put the two only works one. What do I do?
Edit : I could fix this. It was only two conditions change. Thanks anyway.
Sorry for my bad english...
bombaybadboy said:
first edit here
Code:
.field private mZoomScale:F
.field private mZoomStart:J
.field private motionListener:Landroid/hardware/motion/MRListener;
.field private registerTiltListener:Z
.field private final mContext:Landroid/content/Context;
# direct methods
.method static constructor ()V
.registers 1
.prologue
.line 58
const-class v0, Landroid/webkit/ZoomManager;
2nd edit
Code:
invoke-direct {v0, p0}, Landroid/webkit/ZoomManager$FocusMovementQueue;->(Landroid/webkit/ZoomManager;)V
iput-object v0, p0, Landroid/webkit/ZoomManager;->mFocusMovementQueue:Landroid/webkit/ZoomManager$FocusMovementQueue;
.line 298
return-void
invoke-virtual {p1}, Landroid/webkit/WebViewClassic;->getContext()Landroid/content/Context;
move-result-object v0
iput-object v0, p0, Landroid/webkit/ZoomManager;->mContext:Landroid/content/Context;
.end method
3rd edit
Code:
.method setEdgeZoom(Z)V
.registers 12
.parameter "enabled"
.prologue
#const/4 v5, 0x1
const/4 v4, 0x0
iget-object v2, p0, Landroid/webkit/ZoomManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "edgezoom_toggle"
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :disable_ez
const/4 v5, 0x1
goto :toggle_resume
:disable_ez
const/4 v5, 0x0
:toggle_resume
.line 1602
invoke-virtual {p0}, Landroid/webkit/ZoomManager;->getScaleGestureDetector()Landroid/view/ScaleGestureDetector;
Sorry didnt see your edit, yes I enabled edge zoom from your 3rd post of this thread
Here is my complete ZoomManager.smali
Click to expand...
Click to collapse
ZoomManager.smali looks in order. With it enabled from my post alone it should be working by default. Adding in the code from the OP just enables it to be toggled and by default is also enabled. You are aware that it doesn't work on all apps....only certain ones. The stock browser and gmail are 2 that I know of.
EDIT: IF you have a logcat of the error that would be very helpful.
I Dont have PC available to me till tomorrow but i have tried making a log with catlog + terminal and opening stock browser twice with toggle on and twice with toggle off, crashed every time. tomorrow i will use adb to make a log but these logs i have now if helpful. I have added spaces to logcat to find errors a little better
I've been trying to do but I get compile error because apparently it is not compatible with this mod
http://forum.xda-developers.com/showthread.php?t=2194003
Enviado desde mi GT-I9100 usando Tapatalk 2
bombaybadboy said:
I Dont have PC available to me till tomorrow but i have tried making a log with catlog + terminal and opening stock browser twice with toggle on and twice with toggle off, crashed every time. tomorrow i will use adb to make a log but these logs i have now if helpful. I have added spaces to logcat to find errors a little better
Click to expand...
Click to collapse
I'm having the same nullpointer exception errors in zoommanager.smali. I went as far as making all the SecSettings edits first to make sure that ran fine (edgezoom is working but toggle isn't applied yet in framework.jar of course). As soon as I make edits to framework.jar, that is when I get the internet FC and nullpointer exceptions in logcat.
Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Don't take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
Note III - Edits
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Note II - Edits
change code:
Code:
const/16 v1, 0xff
const/16 v2, 0xa5
const/16 v3, 0xf3
change to:
Code:
const/16 v1, 0xff
const v2, 0x66
const v3, 0xcc
const v4, 0x33
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Text Color in Text Editor(Second Screen Shot)
Note III
Search for
Code:
constructor <init>(Lcom/visionobjects/textwidget/e/a;Landroid/util/DisplayMetrics;)V
and then look for:
Code:
const/high16 v1, -0x100 <--- Black Text Color Previous Typed Word
const v2, -0xcc4a1b <--- Last Typed Word
Change Black Text to a Smali Color Code
Change Last Typed Word to Smali Color code (-0xcc4a1b)
For example:
3366cc converts to -0xCC9934 for smali color codes
Thx to @EMSpilot for pointing out the Black Text Line... Thank you!!!
Nice work my friend, :highfive:
Please and to all users, lets make sure credit and permission are handled when using these awesome mods! :victory:
You are a master of theming sir. Nice job as always...
[email protected]'$ [email protected]@XY- Team Average Joe's Official beta tester
Great find and Thank you for sharing, I know many people were searching for this little bugger.:good:
Nice Work!
Great Work Buddy...
I can confirm this also works on Note 2 keyboards as well...
thread here.
Full credit given, in addition, I made you a contributor., so if you need to change anything, feel free.
On the note 2, the V is different for each classification... but I corrected for that thread already.
Nice Work!
OP Updated with more changes..
how would i go about changing this? im new to mods like this.
stafly17 said:
how would i go about changing this? im new to mods like this.
Click to expand...
Click to collapse
Decompile the apk.
Follow the instructions in the OP.
It's a step by step guide.
Can't go wrong.
Slithering from the nether regions of a twisted mind and tarnished soul
@Gunthermic
Found an even easier way to do this...
Original code:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
move-result v1
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v4}, Landroid/graphics/Paint;->setAlpha(I)V
New code:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
[COLOR="Red"]const-string v2, "#AARRGGBB" [COLOR="blue"]<--this is your color hex, AA is the alpha, RR is the red value, GG is the green value, and BB is the blue value[/COLOR]
#invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
invoke-static {v2}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I
move-result v1
invoke-static {v1}, Landroid/graphics/Color;->alpha(I)I
move-result v4[/COLOR]
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v4}, Landroid/graphics/Paint;->setAlpha(I)V
This way you can just write out your hex code in one line
Credits goes to @sagitt67 and @daxgirl .
Credits for toggle goes to @tdunham main guide is here and @asc1977 for the guide here big thanks to them.
In this Guide we'll modify framework-res.apk and services.jar
framework-res.apk:
Download framework-res.zip that is attached below, extract and copy it in your decompiled framework-res.apk folder
now open res/values/arrays.xml
find <string-array name="config_globalActionsList"> and add blue
Code:
<string-array name="config_globalActionsList">
<item>power</item>
<item>datamode</item>
<item>airplane</item>
<item>restart</item>
<item>lockdown</item>
<item>bugreport</item>
<item>users</item>
[COLOR="blue"]<item>rebootsafestrap</item>[/COLOR]
<item>emergencymode</item>
<item>subscreen</item>
</string-array>
now go to res/values/strings.xml at very end and add blue
Code:
<string name="wifi_extender_notification_title">Wi-Fi extender on</string>
<string name="wifi_extender_notification_message">Tap here to set up.</string>
<string name="config_tspstate_threshold" />
[COLOR="blue"]<string name="tw_ic_do_restart_safestrap">Reboot Safestrap</string>[/COLOR]
</resources>
done with framework-res.apk recompile
Services.jar:
download services.zip that is attached below, extract and copy it in your decompiled services.jar folder
open smali/com/android/server/policy/GlobalActions.smali
add blue line in # instance fields
Code:
.field private mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="blue"].field private mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[/COLOR]
.field mRestartIconResId:I
find .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;
add blue
Code:
if-eqz v4, :cond_27b
const v4, 0x1080a58
.line 1642
:goto_11c
const v6, 0x104070e
.line 1639
move-object/from16 v0, p0
invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$21;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="Blue"]new-instance v4, Lcom/android/server/policy/GlobalActions$99;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "drawable"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v5
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v6
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$99;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;[/COLOR]
.line 1688
invoke-static {}, Lcom/samsung/android/feature/SemCscFeature;->getInstance()Lcom/samsung/android/feature/SemCscFeature;
move-result-object v4
const-string/jumbo v5, "CscFeature_Common_ConfigBikeMode"
invoke-virtual {v4, v5}, Lcom/samsung/android/feature/SemCscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
Now next part is tricky, add lines in blue and changes in green
Code:
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
.line 1767
new-instance v4, Lcom/android/server/policy/GlobalActions$BugReportAction;
move-object/from16 v0, p0
invoke-direct {v4, v0}, Lcom/android/server/policy/GlobalActions$BugReportAction;-><init>(Lcom/android/server/policy/GlobalActions;)V
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
[COLOR="blue"]const/16 v6, 0x100
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;[/COLOR]
const/16 v6, [COLOR="Green"]0x200[/COLOR] [COLOR="Red"]#before was 0x100[/COLOR]
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
now search for const-string/jumbo v4, "silent" and add blue line above it and green parts must match orange part
Code:
const-string/jumbo v4, "emergencymode"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_381
.line 1835
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mEmergency:Lcom/android/server/policy/GlobalActions$ToggleAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="orange"]goto_2d9[/COLOR] #look that green part match this
.line 1836
:cond_381
[COLOR="Blue"]const-string/jumbo v4, "rebootsafestrap"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_3da
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="Green"]goto_2d9 [/COLOR]
:cond_3da[/COLOR]
const-string/jumbo v4, "silent"
next part is missing in Android 7 services.jar so we need to readd it for mod
find .method private addCustomDialogItems(Landroid/graphics/drawable/BitmapDrawable;Ljava/lang/String;Landroid/content/Intent;ILjava/util/ArrayListZ
add this above method
Code:
[COLOR="Blue"].method static synthetic access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
.locals 1
iget-object v0, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
return-object v0
.end method[/COLOR]
thats it, recompile and push to phone
Note: For me one time i get after reboot a loop of phone restarts, only one time happens. If it happen i solved it with wipe dalvik-cache and cache
Credits goes to @TheDriller for this part in this guide
Note: no need to change the code in GlobalActions$99.smali already done
GlobalActions$99.smali:
find .method public onPress()V and replace blue lines with red one
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Red"]const-string v1, "recovery"
invoke-virtual {v0, v1}, Landroid/os/PowerManager;->reboot(Ljava/lang/String;)V[/COLOR]
to
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Blue"]const-string v1, "su -c echo 1 > /data/.recovery_mode && su -c reboot now"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;[/COLOR]
Wow thia makes things so much easier
Sent from my SM-G950U using Tapatalk
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
SM-N950W
dillweedinc said:
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
Click to expand...
Click to collapse
I will check them soon.
Maybe @JavixKGD can help you as he asked for the mod and he got it working on Note 8.
It is important to specify that this mod only applies to Nougat, it needs to be updated for Oreo.
I am using Nougat 7.1.1 on a note 8 sm-n950w with me's samfail firmware bl1 - I sent him a message thanks! I see it built into another firmware that is available but id rather build it into me's samfail firmy since there is some issues to be wrinkled out in the other custom firmwares.
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
xSl33p said:
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
Click to expand...
Click to collapse
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
dillweedinc said:
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
Click to expand...
Click to collapse
Im working on update and some fixes for the mod, then will rewrite this guide in the Note 8 section.