Skip to content

Instantly share code, notes, and snippets.

@shakalaca
Last active May 10, 2023 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakalaca/71bed0f684b6ab31de56f29c81b7acb6 to your computer and use it in GitHub Desktop.
Save shakalaca/71bed0f684b6ab31de56f29c81b7acb6 to your computer and use it in GitHub Desktop.
Patch for using ZenUi Keyboard on ZE620KL/ZS620KL w/ Android P
diff -ruN XT9IMEStable.orig/apktool.yml XT9IMEStable/apktool.yml
--- XT9IMEStable.orig/apktool.yml 2018-12-23 11:37:06.000000000 +0800
+++ XT9IMEStable/apktool.yml 2018-12-20 23:18:13.000000000 +0800
@@ -4,6 +4,7 @@
doNotCompress:
- arsc
- webp
+- res/raw/ping.wav
isFrameworkApk: false
packageInfo:
forcedPackageId: '127'
diff -ruN XT9IMEStable.orig/res/values/public.xml XT9IMEStable/res/values/public.xml
--- XT9IMEStable.orig/res/values/public.xml 2018-12-23 11:37:03.000000000 +0800
+++ XT9IMEStable/res/values/public.xml 2018-12-27 22:06:52.000000000 +0800
@@ -5040,6 +5040,8 @@
<public type="string" name="word_separators" id="0x7f0f0508" />
<public type="string" name="word_suggestion_category" id="0x7f0f0509" />
<public type="string" name="you_are_debugger_now" id="0x7f0f050a" />
+ <public type="string" name="navigation_fix_summary" id="0x7f0f050b" />
+ <public type="string" name="navigation_fix_title" id="0x7f0f050c" />
<public type="style" name="ActionBarItemColorBlackStyle" id="0x7f100000" />
<public type="style" name="AlertDialog.AppCompat" id="0x7f100002" />
<public type="style" name="AlertDialog.AppCompat.Light" id="0x7f100003" />
diff -ruN XT9IMEStable.orig/res/values/strings.xml XT9IMEStable/res/values/strings.xml
--- XT9IMEStable.orig/res/values/strings.xml 2018-12-23 11:37:03.000000000 +0800
+++ XT9IMEStable/res/values/strings.xml 2018-12-27 23:18:17.000000000 +0800
@@ -822,6 +822,8 @@
<string name="language_update_title">Update</string>
<string name="larger_text_summary">Enlarge character size on the keyboard</string>
<string name="larger_text_title">Larger characters</string>
+ <string name="navigation_fix_summary">Fix input error with hidden navigation bar</string>
+ <string name="navigation_fix_title">Adjust keyboard offset</string>
<string name="layouts_title">Layouts</string>
<string name="ldb_fail_dialog_msg">"%1$s input can’t work properly due to an incomplete download. Please delete the language first then download again.
diff -ruN XT9IMEStable.orig/res/values-zh-rTW/strings.xml XT9IMEStable/res/values-zh-rTW/strings.xml
--- XT9IMEStable.orig/res/values-zh-rTW/strings.xml 2018-12-23 11:37:03.000000000 +0800
+++ XT9IMEStable/res/values-zh-rTW/strings.xml 2018-12-27 23:19:24.000000000 +0800
@@ -355,6 +355,8 @@
<string name="language_update_title">更新</string>
<string name="larger_text_summary">放大鍵盤字體</string>
<string name="larger_text_title">放大字體</string>
+ <string name="navigation_fix_summary">修正隱藏導覽列時的輸入錯誤</string>
+ <string name="navigation_fix_title">調整鍵盤偏移</string>
<string name="layouts_title">配置</string>
<string name="ldb_fail_dialog_msg">"%1$s輸入無法正常運作,可能是因為語言下載不完全。請刪除該語言並再次下載。
diff -ruN XT9IMEStable.orig/smali/com/asus/ime/AlphaInputView.smali XT9IMEStable/smali/com/asus/ime/AlphaInputView.smali
--- XT9IMEStable.orig/smali/com/asus/ime/AlphaInputView.smali 2018-12-23 11:37:04.000000000 +0800
+++ XT9IMEStable/smali/com/asus/ime/AlphaInputView.smali 2018-12-22 23:18:04.000000000 +0800
@@ -17887,7 +17887,32 @@
.end method
.method public setKeyboardYOffset(I)V
- .locals 1
+ .locals 2
+
+#shaka{
+ invoke-static {}, Lcom/asus/ime/Utils;->isAndroidVersionOver9_0()Z
+
+ move-result v0
+
+ if-eqz v0, :cond_0
+
+ invoke-virtual {p0}, Lcom/asus/ime/AlphaInputView;->getContext()Landroid/content/Context;
+
+ move-result-object v0
+
+ invoke-static {v0}, Lcom/asus/ime/Utils;->isPortrait(Landroid/content/Context;)Z
+
+ move-result v1
+
+ if-eqz v1, :cond_0
+
+ invoke-static {v0}, Lcom/asus/ime/Utils;->getNotchHeight(Landroid/content/Context;)I
+
+ move-result v1
+
+ add-int/2addr p1, v1
+ :cond_0
+#shaka}
.line 4968
iget-object v0, p0, Lcom/asus/ime/AlphaInputView;->mAlphInput:Lcom/asus/ime/AlphaInput;
diff -ruN XT9IMEStable.orig/smali/com/asus/ime/ChineseInputView.smali XT9IMEStable/smali/com/asus/ime/ChineseInputView.smali
--- XT9IMEStable.orig/smali/com/asus/ime/ChineseInputView.smali 2018-12-23 11:37:04.000000000 +0800
+++ XT9IMEStable/smali/com/asus/ime/ChineseInputView.smali 2018-12-27 23:40:16.000000000 +0800
@@ -7695,7 +7695,53 @@
.end method
.method public setKeyboardYOffset(I)V
- .locals 1
+ .locals 4
+
+#shaka{
+ invoke-static {}, Lcom/asus/ime/Utils;->isAndroidVersionOver9_0()Z
+
+ move-result v0
+
+ if-eqz v0, :cond_0
+
+ invoke-virtual {p0}, Lcom/asus/ime/ChineseInputView;->getContext()Landroid/content/Context;
+
+ move-result-object v0
+
+ invoke-static {v0}, Lcom/asus/ime/Utils;->isPortrait(Landroid/content/Context;)Z
+
+ move-result v1
+
+ if-eqz v1, :cond_0
+
+ invoke-static {v0}, Lcom/asus/ime/Utils;->getNotchHeight(Landroid/content/Context;)I
+
+ move-result v1
+
+ add-int/2addr p1, v1
+
+ invoke-static {v0}, Lcom/asus/ime/Settings;->getPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
+
+ move-result-object v1
+
+ const-string v2, "fix_navigation"
+
+ const/4 v3, 0x0
+
+ invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
+
+ move-result v1
+
+ if-eqz v1, :cond_0
+
+ invoke-virtual {p0}, Lcom/asus/ime/ChineseInputView;->getNavigationbarHeight()I
+
+ move-result v1
+
+ add-int/2addr p1, v1
+
+ :cond_0
+#shaka}
.line 702
iget-object v0, p0, Lcom/asus/ime/ChineseInputView;->mChineseInput:Lcom/asus/ime/ChineseInput;
diff -ruN XT9IMEStable.orig/smali/com/asus/ime/R$string.smali XT9IMEStable/smali/com/asus/ime/R$string.smali
--- XT9IMEStable.orig/smali/com/asus/ime/R$string.smali 2018-12-23 11:37:04.000000000 +0800
+++ XT9IMEStable/smali/com/asus/ime/R$string.smali 2018-12-27 22:08:05.000000000 +0800
@@ -2597,6 +2597,9 @@
.field public static final you_are_debugger_now:I = 0x7f0f050a
+.field public static final navigation_fix_summary:I = 0x7f0f050b
+
+.field public static final navigation_fix_title:I = 0x7f0f050c
# direct methods
.method public constructor <init>()V
diff -ruN XT9IMEStable.orig/smali/com/asus/ime/Utils.smali XT9IMEStable/smali/com/asus/ime/Utils.smali
--- XT9IMEStable.orig/smali/com/asus/ime/Utils.smali 2018-12-23 11:37:04.000000000 +0800
+++ XT9IMEStable/smali/com/asus/ime/Utils.smali 2018-12-27 23:43:10.000000000 +0800
@@ -2417,6 +2417,27 @@
return v0
.end method
+.method public static isAndroidVersionOver9_0()Z
+ .locals 2
+
+ .line 179
+ sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
+
+ const/16 v1, 0x1C
+
+ if-lt v0, v1, :cond_0
+
+ const/4 v0, 0x1
+
+ goto :goto_0
+
+ :cond_0
+ const/4 v0, 0x0
+
+ :goto_0
+ return v0
+.end method
+
.method public static isAppEnabled(Landroid/content/Context;Ljava/lang/String;)Z
.locals 1
diff -ruN XT9IMEStable.orig/smali/com/asus/ime/settings/SettingsAppearanceActivity.smali XT9IMEStable/smali/com/asus/ime/settings/SettingsAppearanceActivity.smali
--- XT9IMEStable.orig/smali/com/asus/ime/settings/SettingsAppearanceActivity.smali 2018-12-23 11:37:04.000000000 +0800
+++ XT9IMEStable/smali/com/asus/ime/settings/SettingsAppearanceActivity.smali 2018-12-27 22:10:25.000000000 +0800
@@ -74,6 +74,45 @@
return-void
.end method
+.method private buildFixNavigationPrefs(Landroid/preference/PreferenceScreen;)V
+ .locals 2
+
+ if-nez p1, :cond_0
+
+ return-void
+
+ .line 262
+ :cond_0
+ new-instance v0, Landroid/preference/SwitchPreference;
+
+ invoke-direct {v0, p0}, Landroid/preference/SwitchPreference;-><init>(Landroid/content/Context;)V
+
+ const-string v1, "fix_navigation"
+
+ .line 264
+ invoke-virtual {v0, v1}, Landroid/preference/SwitchPreference;->setKey(Ljava/lang/String;)V
+
+ const v1, 0x7f0f050c
+
+ .line 265
+ invoke-virtual {v0, v1}, Landroid/preference/SwitchPreference;->setTitle(I)V
+
+ const v1, 0x7f0f050b
+
+ .line 266
+ invoke-virtual {v0, v1}, Landroid/preference/SwitchPreference;->setSummary(I)V
+
+ const/4 v1, 0x0
+
+ .line 267
+ invoke-virtual {v0, v1}, Landroid/preference/SwitchPreference;->setChecked(Z)V
+
+ .line 288
+ invoke-virtual {p1, v0}, Landroid/preference/PreferenceScreen;->addPreference(Landroid/preference/Preference;)Z
+
+ return-void
+.end method
+
.method private buildResizeKeyboardPrefs(Landroid/preference/PreferenceScreen;)V
.locals 2
@@ -701,6 +740,8 @@
invoke-direct {p0, v0}, Lcom/asus/ime/settings/SettingsAppearanceActivity;->buildAddingTextSizePrefs(Landroid/preference/PreferenceScreen;)V
+ invoke-direct {p0, v0}, Lcom/asus/ime/settings/SettingsAppearanceActivity;->buildFixNavigationPrefs(Landroid/preference/PreferenceScreen;)V
+
return-void
.end method
@CaptainXLAB
Copy link

Desparately trying to make ZenUI keyboard work on my new Pixel 7 pro and I came across this while searching... idk what this is but is there any way to make it work glitch-free on Pixel 7 Pro?

ZenUI Keyboard launches but has a very weird offset, where I have to tap the top half of any key for the correct one to be registered. The toolbar is also completely glitched out and a white bar appears there instead and no elements can be interacted with.

I've already added the 32bit patch from this guide to allow 32bit apps to work on pixel 7 pro:
https://forum.xda-developers.com/t/magisk-magisk-zygote64_32-enabling-32-bit-support-for-apps.4521029/

I don't know of any way to fix this myself. Any help would be very nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment