All Discussions
  • Other
  • @techys issue with remapping key on the TCL Flip 2

Started by techy · Oct 25, 2022

Hi fellas, I decided to create a separate thread so I don't have to keep hogging up the main TCL Flip 2 thread.
Looking in the log of mixplorer I saw this
‌120 I/ROOT> cat "/data/user/0/com.mixplorer/cache/2274296027715" > "/system/usr/keylayout/matrix-keypad.kl"
‌121 E/ROOT> STD-ERR >> cat: write error: No space left on device

So, I did a little research and got this output.
platform-tools> adb shell df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 447M 1.9M 445M 1% /dev
tmpfs 447M 0 447M 0% /mnt
/dev/block/dm-2 1.2G 1.1G 0 100% /
/dev/block/dm-1 194M 194M 0 100% /vendor
/dev/block/dm-0 76M 76M 0 100% /product
tmpfs 447M 2.8M 444M 1% /dev/ISNF
tmpfs 447M 0 447M 0% /apex
/dev/block/mmcblk0p42 104M 68K 101M 1% /cache
/dev/block/mmcblk0p9 15M 224K 14M 2% /otapkg
/dev/block/dm-3 4.5G 505M 4.0G 11% /data
tmpfs 447M 0 447M 0% /system/bin
/dev/fuse 4.5G 505M 4.0G 11% /storage/emulated

platform-tools>adb shell df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
tmpfs 114495 988 113507 1% /dev
tmpfs 114495 47 114448 1% /mnt
/dev/block/dm-2 3680 3530 150 96% /
/dev/block/dm-1 1376 1361 15 99% /vendor
/dev/block/dm-0 160 147 13 92% /product
tmpfs 114495 396 114099 1% /dev/ISNF
tmpfs 114495 20 114475 1% /apex
/dev/block/mmcblk0p42 28672 17 28655 1% /cache
/dev/block/mmcblk0p9 5120 45 5075 1% /otapkg
/dev/block/dm-3 1121280 50144 1071136 5% /data
tmpfs 114495 394 114101 1% /system/bin
/dev/fuse 1121280 50144 1071136 5% /storage/emulated

Since I don't really know what I'm doing, I figured that I'll post it here and maybe someone who does understand these things can let me know if I'm the right track, and how to proceed.

Any other pointers would also be greatly appreciated.

Many thanks...

THANKS TO @lgexalter1 WE GOT IT DONE!
Here are the steps taken.

  • adb shell
  • su
  • /vendor/bin/write_protect 0
  • exit
  • exit
  • adb reboot
  • adb shell
  • su
  • mount -o rw,remount /
  • cd /system/priv-app
  • rm -r TctOMADMStack
  • rm -r JrdFota
  • exit
  • exit
  • adb reboot
  • adb shell
  • su
  • mount -o rw,remount /
  • cd /system/usr/keylayout
  • sed -i 's/FAVORITE_CONTACTS/TV/g' matrix-keypad.kl
  • sed -i 's/MESSENGER/GUIDE/g' matrix-keypad.kl
  • sed -i 's/QUICK_DIAL/DVR/g' mtk-kpd.kl
  • exit
  • exit
  • adb reboot
darth

techy Yes all of the partitions in super (system, product, vendor) are shrunk to exact size. In order to make any changes you need to either resize the partitions or delete stuff to allow you to save anything inside of them.

techy for some reason, when I run rm -r TctOMADMStack I get no such file or directory.

Biden2020prez I did. When I run Gflip6_TMO:/ # cd /system/priv-app
Gflip6_TMO:/system/priv-app # rm -r TctOMADMStack
I get:
rm: TctOMADMStack: No such file or directory

Biden2020prez

Ppotecha so run this:

cd /system/app
ls

Check if TctOMADMStack is in the output.

Biden2020prez It's not. I also checked in /system/priv-app and it's not in there either.

Biden2020prez I experimented a bit and I keep getting this statement returned sed: short write: No space left on device. I don't think it's because I don't have enough storage on the phone (I have plenty), but it seems that I'm not removing the specific space allocated for the rewriting of keylayout? Just a guess, but since it's not found on the phone, is there anything else I can do?

Biden2020prez If I remove the native android messaging app (com.android.mms), would it remove my ability to send messages if I'm using the google messages app instead? Could this possibly resolve the problem?

Ppotecha it could be there is no space in /system ( see darth). You could delete something that isn't needed in /system and try again.

whynot I've tried removing a few things, but it doesn't seem to help. I was able to succesfully run rm -r JrdFota because that file was in the directory. Now when i run sed -i 's/MESSENGER/GUIDE/g' matrix-keypad.kl the output I get is sed: no temp file

Reifam

Biden2020prez btw how do you post your code color-coded and organized?

FliphoneBochur

Reifam Three of the code symbols (```) on the lines before and after.

Reifam

FliphoneBochur Whenever I do that it doesn't appear neatly and it is not color-coded automatically.
It appears like this Ppotecha

Reifam

FliphoneBochur Thanks I just realized there is a diffrence between that way and the built-in way (in between .)

I could not get this to work for me.

Could also not deal with button mapper app using a long press for volume down, as it activated the app but had to wait 30 seconds for voice access to time out. It could also activate in pocket or not when really needed.

What worked for me was some of the steps on the neutron wiki.
I am by no means anywhere near as knowledgeable as others.

The section proved helpful https://github.com/neutronscott/flip2/wiki#remapping-keys-using-magisk-module

Once I did all the steps there, I could then edit the mtk-kpd.kl file. I copied out his "module.props" and edited that to my liking.
I changed the name of "QUICK_DIAL" to something else. Note - don't change the volume or power keys, as noted in the link.

After rebooting, I was able to use the key on the back of the phone (or front, I guess, if it's closed). In the voice access app, it was labeled "Camera" but it worked!

I could not get the "MESSENGER" key to remap correctly. It seemed to break the 2 shortcut keys as well as the 'send' key. Not sure why. edit: changing it to say FOCUS worked.
Greatly prefer that key as it is not an external key that can be bumped. I do not know yet how to make this into a package for easier install for others, but may try to figure it out.

Hopefully this helps others who want to try remapping!

I'm not new to programming, but I'm very new to Android. The method listed above didn't work for me. I had the same issue as Ppotecha

I tried removing a font that I don't need/have no interest in, but that didn't clear enough space, because I still get the same error sed: short write: No space left on device

(Not only that, but it repeats the error about 25 times.) Or does the file removed have to be from "keylayout" - I'm afraid to touch anything there, in case I make everything worse.

I gave the alternative method mentioned by @telefono a quick go, but once I could view the files, I couldn't get out of view or save changes. I might try again tomorrow when I'm 'fresh', but it's above me tonight.

This has been an amazing forum. So thank you for everyone who comments here! I have learnt so much already, so now I'm down to 'tweaks' to make my phone more friendly for me personally. I never used smartphones to their full capacity, so it made sense to switch back to a flip, sadly modern apps require a touch screen, which for me requires voice access. (I can never control the mouse well enough LOL) So, if I can make VA easier to use, I know I'll be happier!

TARDIS
I also had errors like that trying this method.

When following the steps on the neutronscott wiki, using vi to edit the copied file (I used only the one, not both, as I didn't need it) it should let you save. I've never been great with vi, but it did let me save as it's outside the system path. Only changed "messenger" to say FOCUS.

You'll also need the props file. With different details. I copied the one from the mouse zip, edited it, and pasted my details in the newly created one.

Once saved, I rebooted and it was a new module that worked after a reboot. You will have to change the key in voice access settings to it, and it shows up as "focus" when pressed.

Maybe I'll try to write up a little more detailed set of steps when I have some time. The wiki had all the commands detailed but maybe presenting it a little differently could help.

Agree about this forum!

telefono With your tip about getting/editing the module.props (and some much needed sleep!) I now have the faves key mapped to voice access! Thanks so much for the tip!

telefono edit: changing it to say FOCUS worked.

I did that too but how can I map it now to a different app, as of now it does nothing?

manyhill
I do not know if it can launch another app. Changing to FOCUS allows the voice access app to use it as an action button in the app settings.