View Single Post
Old 10-30-2022, 02:13 PM   #5
csdvrx
Enthusiast
csdvrx began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2022
Device: kindle HD8 onyx
Uh, sorry to keep bothering but it's not exactly clear yet what I should do.

You message says to get /system/framework/framework-res.apk and hexedit it to change occurence 5/8 and 6/8 of keypad into zeypad - ok that I should be able to do!

But:

First, is it possible to test the changes manually first, like by using adb do su then killing the framework process then do some kind of mount and restart the process to make sure my change work?

Then, "Put it in your Magisk module directory" - that's a bit unclear, especially given how you mention the late start of adb could mess up things and may require reflashing the system partition (which I don't know how to do yet because it's merged with product inside the "super" part)

After reading https://topjohnwu.github.io/Magisk/guides.html if I decide to call my module say novaairc_coverbuttons_keymapper, I understand I should:

- create a folder called novaairc_coverbuttons_keymapper
- create a subfolder called system containing another subfolder name framework that would contain my hexedited framework-res.apk once I've validated it works
- create module.prop file containing:

id=novaairc_coverbuttons_keymapper
name=Nova Air C cover buttons fix
version=v1
versionCode=1
author=csvrx
description=Make the Nova Air C cover buttons remappable with sds100 keymapper

The documentation mentions post-fs-data.sh and service.sh. After looking at the examples from selinux_permissive_v2.zip and the documentation on adb on https://developer.android.com/studio/command-line/adb, I think I should be able to use either or both of the scripts to start adb early, by using the same scripts skeleton:

post-fs-data.sh:
# start adb on a non standard port
NONSTANDARD_PORT=5556
ARGUMENTS="something something"
adbd $ARGUMENTS $NONSTANDARD_PORT

service.sh:

# Schedule task

nohup /bin/sh > /dev/null 2>&1 <<EOF &

wait_boot_complete()
{
until [ "x\$(getprop sys.boot_completed)" == "x1" ]
do
sleep 5
done
}

wait_boot_complete

# stop the extra adb we don't need anymore
NONSTANDARD_PORT=5556
ps a |grep $NONSTANDARD_PORT | grep adb | sed -e 's/^ //g' -e 's/ .*//g' | head -n 1 | xargs kill

However, ps a doesn't seem to work, so I can't find the arguments used by the current adbd.

Could you tell me if my plans are sound or if I'm doing something horribly wrong? Your experience doing the same thing would be helpful: I don't want to spend 2 nights fixing the problem like when I messed up with the partitions and couldn't make a restore of the boot.img work (then I realized it was a bug )
csdvrx is offline   Reply With Quote