[APK] Xperia Chinese Keyboard modified to work on any device (version 25.1.A.0.10)

Aqq123

Senior Member
Aug 27, 2009
171
243
43
While there's the excellent mod of the general Xperia keyboard for all devices (linked at the bottom of this post), I could only find an ancient version of the Xperia Chinese keyboard modified the same way. So, here is a more up to date version:

Xperia Chinese Keyboard modified to work on any device
Supports pinyin, zhuyin, stroke order, handwriting and Cangjie, as well as English input
Version: 25.1.A.0.10

View attachment 4825075 View attachment 4825077 View attachment 4825105 View attachment 4825107
Download
Patch 2 also removes some libraries that were unnecessary, and includes a different build of SQLite.

Details

Source Image: G8141_47.1.A.16.20_1308-5321_R5B_CE1 (Sony Xperia XZ Premium / Maple)
Package Name: com.sonyericsson.textinput.chinese
Original Filename: textinput-chn-xxhdpi.apk

How to use
  • Install the APK as you normally would
  • Manually grant the permission: Settings → Apps & notifications → See all apps → Xperia Chinese keyboard → Advanced → Display over other apps: Allowed
  • Enable keyboard in Settings → Languages & input
Note
If you do not grant the above permission, the keyboard will crash when trying to display pop-up dialogs (tap and hold the language switch button to test).

Modification scope

1. Integrated external libraries into the package:
(a) From the original image:
Code:
libunwind.so
(b) From LineageOS 17.1:
Code:
libbase.so
libc++.so
libnativehelper.so
(c) From SQLite Precompiled Android Binaries (3320300):
Code:
libsqlite.so
2. Changed values loaded into $LayoutParams;->type:I in:
Code:
smali/com/sonyericsson/textinput/chinese/uxp/view/InputMethodDialog.smali
smali/com/sonyericsson/textinput/chinese/uxp/view/keyboard/CloudAccessTipsDialog.smali
smali/com/sonyericsson/textinput/chinese/uxp/view/settings/ChineseHardKeyboardInputMethodChoice.smali
smali/com/sonyericsson/textinput/chinese/uxp/view/settings/ChineseInputMethodChoice.smali
smali/com/sonyericsson/textinput/chinese/uxp/view/settings/FirstUsageTipsDialogVisualisation.smali
(5 occurences total)
From:
0x000007dc = 0x000007d9 (TYPE_KEYGUARD_DIALOG) | 0x00000002 (TYPE_APPLICATION) | 0x00000001 (TYPE_BASE_APPLICATION)

To:
0x000007f6 (TYPE_APPLICATION_OVERLAY)

Background / Why3. Changed manifest to add SYSTEM_ALERT_WINDOW permission (needs to be granted manually, application will not prompt for it):
Code:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
Remarks
  • This fully works for me on LineageOS 16.0. If it doesn't work for you, most likely you'll need a different version of libsqlite.
  • Should be safe to use in general but use it at your own risk
Improvement ideas
  • Modify the application further to request permission instead of crashing
Related threads
Note:
The version linked below is the initial one. See above for updated links.
 

Attachments

Last edited:

Aqq123

Senior Member
Aug 27, 2009
171
243
43
Thank you for your work! However, the link is down, it is giving 410 error from XDA. Can you reupload it? Thanks again.
Hi, the files are attached to the post, so they are hosted here on XDA. I checked the links and they seemed to start downloading correctly for me but now I edited the post and removed the inline links, so the files should show up as an attachment below the post instead.

Can you successfully download any other attachments at all (from other posts)? Maybe there are some restrictions in place for newly-created XDA accounts. Anyway, if they still don't download for you, let me know and I'll upload them elsewhere as well. (The advantage of having the files hosted here is that the links never expire.)
 
Last edited:

sjdhmtthm

New member
Apr 2, 2019
3
0
0
Hi, the files are attached to the post, so they are hosted here on XDA. I checked the links and they seemed to start downloading correctly for me but now I edited the post and removed the inline links, so the files should show up as an attachment below the post instead.

Can you successfully download any other attachments at all (from other posts)? Maybe there are some restrictions in place for newly-created XDA accounts. Anyway, if they still don't download for you, let me know and I'll upload them elsewhere as well. (The advantage of having the files hosted here is that the links never expire.)
It works now, must be having some errors just now. Thanks again.

Edit: Part 2 seems to not be able to download and corrupted, second try gives me the same error again.
I asked my friend who is not logged in to download and he experienced the same error.
It would be great if you can upload it elsewhere, the two tries I where I successfully downloaded part 2 returns corrupted. Thank you.


Edit 2: Changing browsers on mobile worked. Surprised that both Firefox on mobile and desktop returned an error for me. Thank you, problem is solved.
 
Last edited:

SM-03

Senior Member
Mar 18, 2015
249
36
58
Is this keyboard for chinese only or can I use english as well? its been a while and long since we get an updated Xperia Keyboard version, still using the 2/3 years old v8.1.A.0.12 dated November 12, 2017.
 

Aqq123

Senior Member
Aug 27, 2009
171
243
43
Is this keyboard for chinese only or can I use english as well?
It can be used for English input too. If you take a look at the first 3 screenshots, there is a button (labelled "CN") that toggles between English and Chinese in the bottom right corner of the keyboard.

It supports word completion in English too but there's no way to type accented characters (for other languages written in the Latin script).
 

SM-03

Senior Member
Mar 18, 2015
249
36
58
how to dl and extract this? I downloaded two p[arts but still getting error while extracting, any other parts there or missing?
 

SM-03

Senior Member
Mar 18, 2015
249
36
58
Just checked again, it unpacks fine. Nothing is missing. The complete instructions are already in the first post. Not sure what else would need explaining.
Yes, it's working (extracted) as per the instructions written into the OP, but the font size is too small that I didn't see /notice that instruction earlier, you should've mentioned that in bold & highlighted for better & clear visibility.
 

Aqq123

Senior Member
Aug 27, 2009
171
243
43
I didn't see /notice that instruction earlier, you should've mentioned that in bold & highlighted for better & clear visibility.
This board is called XDA Developers for a reason. As a participant you are expected to possess a modicum of rudimentary computer skills and, more importantly, willingness to learn to solve your own problems. In particular, this thread is in the Development section. This is not the place to demand an illustrated step-by-step tutorial how to unpack a ZIP file.

Besides, as duly proven, even the best instructions won't help an ignorant person who can't be bothered to read them such as yourself. And finally, neither me nor anyone else here owes you anything just because you can't get something to work, so the only thing I "should have" is not indulged this behavior earlier.

Good luck with your future endeavors as you will need it with this kind of an attitude. Now, feel free to move on.
 

SM-03

Senior Member
Mar 18, 2015
249
36
58
This board is called XDA Developers for a reason. As a participant you are expected to possess a modicum of rudimentary computer skills and, more importantly, willingness to learn to solve your own problems. In particular, this thread is in the Development section. This is not the place to demand an illustrated step-by-step tutorial how to unpack a ZIP file.

Besides, as duly proven, even the best instructions won't help an ignorant person who can't be bothered to read them such as yourself. And finally, neither me nor anyone else here owes you anything just because you can't get something to work, so the only thing I "should have" is not indulged this behavior earlier.

Good luck with your future endeavors as you will need it with this kind of an attitude. Now, feel free to move on.
wow, so many words for just saying the small font & you should've written it with bigger font size for better visibility? You're rare & amazing.
 

atisha

Senior Member
Aug 15, 2008
184
9
18
I am not able to merge the two zipped files into one. I followed the instruction to rename as .zip and .z01 for both files but the second part stated no content inside to extract. should I download rar software to unrar it in desktop file explorer? Can someone kind hearted enough keep the file in one and upload somewhere for me to download?
 
Last edited:

Aqq123

Senior Member
Aug 27, 2009
171
243
43
I am not able to merge the two zipped files into one. I followed the instruction to rename as .zip and .z01 for both files but the second part stated no content inside to extract. should I download rar software to unrar it in desktop file explorer? Can someone kind hearted enough keep the file in one and upload somewhere for me to download?
I just checked and it unpacks with WinRAR and 7-Zip for me. Anyway, since I made another version later, here they are both, externally hosted:
  • Patch 2 (try this first, should be compatible with LineageOS 17.1 at least)
  • Patch 1 (original version as linked above)
I also updated the original post accordingly.
 
Last edited:

johnsyh

New member
Nov 30, 2020
1
0
0
Found a Bug

Hi Aqq123,

This is some impressive work, thank you for making this! :D

Just wanted to post a bug I found: the "pull down menu" for the Chinese typing doesn't work. E.g. I want to type the word 蚝煎, but after clicking on the arrow on the right, nothing appears! So I wasn't able to type things beyond the suggestions in the first row.

I'm using Sony Xperia 10 II, Android 10 (Build number 59.0.A.10.5), and I used Patch 2 of your download. Would really appreciate if you could solve the bug, because this keyboard is such a life saver for me. Thanks! :)

Screenshot: https:// drive. google. com/ file/ d/ 12eEBAzBalbq0ZKfQMh2SLI-045-Gb1Z1/ view?usp=sharing
(Included the spacing because the forum just wouldn't let me post it)
 

Aqq123

Senior Member
Aug 27, 2009
171
243
43
Just wanted to post a bug I found: the "pull down menu" for the Chinese typing doesn't work
You're right, thanks for spotting it. It used to work in the first version though, so it's probably down to some library incompatibility (and the first version itself won't work with the newer Android). I'll look into it when I have the time. A better approach though might be to ditch it altogether and look at adopting a newer APK version instead. Meanwhile, a lousy workaround is to just hand-write the character.

Since you're using Sony stock firmware, have you tried downloading the Hong Kong or Taiwan version for your device with XperiFirm, extracting the APK from there (for example with UnSIN), and installing it? It'd either work immediately or, if not, the exact library versions to make it work would also be there.
 

atisha

Senior Member
Aug 15, 2008
184
9
18
Hi, the files are attached to the post, so they are hosted here on XDA. I checked the links and they seemed to start downloading correctly for me but now I edited the post and removed the inline links, so the files should show up as an attachment below the post instead.

Can you successfully download any other attachments at all (from other posts)? Maybe there are some restrictions in place for newly-created XDA accounts. Anyway, if they still don't download for you, let me know and I'll upload them elsewhere as well. (The advantage of having the files hosted here is that the links never expire.)
Thank you so much. I am able to download patch 2 and install directly. So so very grateful as this is the best T9 keyboard ever! (Could be better if it supports Malay too with black layout white font but one shouldnt be too greedy).
 

atisha

Senior Member
Aug 15, 2008
184
9
18
You're right, thanks for spotting it. It used to work in the first version though, so it's probably down to some library incompatibility (and the first version itself won't work with the newer Android). I'll look into it when I have the time. A better approach though might be to ditch it altogether and look at adopting a newer APK version instead. Meanwhile, a lousy workaround is to just hand-write the character.

Since you're using Sony stock firmware, have you tried downloading the Hong Kong or Taiwan version for your device with XperiFirm, extracting the APK from there (for example with UnSIN), and installing it? It'd either work immediately or, if not, the exact library versions to make it work would also be there.
HI would you have general sony xperia keyboard (non Chinese, English) apk as well to share? with layout skin colour if possible.