This guide has been written originally by Luxferre
This hack is safe meaning no changes are made to
/system
partition and changes are reverted back after factory reset or after an OTA update
Sometimes you need to test apps on your KaiOS device without any regular PC or such these nearby. So you cannot connect your device with a cable and run adb tcpip 5555
. Fortunately there is a known security vulnerebility in KaiOS which allows changing Android property set directly from the browser.
Create a public page, a page your KaiOS phone can access, with a button which does this on click:
var masterExt = navigator.engmodeExtension || navigator.jrdExtension || navigator.kaiosExtension
var propSet = {
'service.adb.tcp.port': 5555,
'ctl.stop': 'adbd',
'ctl.start': 'adbd'
};
for(var key in propSet) {
masterExt.setPropertyValue(key, propSet[key])
}
Essentially, what it does is setting the Android property service.adb.tcp.port and restarting adbd via the predefined ctl.* property hooks. Yes, I know that these hooks aren't present in KitKat-based systems, so for those, manual ADB restart will be required.
You must prepare necessary parts on your Android phone/tablet:
pkg install nodejs
for example) and after that install Luxferre's gdeploy:git clone https://gitlab.com/suborg/gdeploy.git
cd gdeploy
npm i --global
Make sure your KaiOS device and your host device(Android device in this example) are connected to the same network.
On KaiOS side, enable debugging and also root the phone if needed.
On Android side, run adb connect [your_phone_ip]:5555 and then ensure you see the device in adb devices command.
Now you can manage the apps on the device with the gdeploy <command>
(gdeploy list/install/uninstall/start/stop/evaluate) fully wirelessly. Use Vim or other convenient editor for the development process on your Android and Termux + gdeploy for actual device testing.
The
5555
TCP/IP port will remain open on the device till you reboot it. You might consider this if you connect your KaiOS device to an untrusted WiFi network.