diff --git a/base.mk b/base.mk index e1cb049..f2559dc 100644 --- a/base.mk +++ b/base.mk @@ -153,3 +153,10 @@ PRODUCT_PACKAGES += \ # Privapp-permissions whitelist for PhhTrebleApp PRODUCT_COPY_FILES += \ device/phh/treble/privapp-permissions-me.phh.treble.app.xml:system/etc/permissions/privapp-permissions-me.phh.treble.app.xml + +# Remote debugging +PRODUCT_COPY_FILES += \ + device/phh/treble/remote/dbclient:system/bin/dbclient \ + device/phh/treble/remote/phh-remotectl.rc:system/etc/init/phh-remotectl.rc \ + device/phh/treble/remote/phh-remotectl.sh:system/bin/phh-remotectl.sh \ + diff --git a/remote/dbclient b/remote/dbclient new file mode 100755 index 0000000..fa2d49c Binary files /dev/null and b/remote/dbclient differ diff --git a/remote/phh-remotectl.rc b/remote/phh-remotectl.rc new file mode 100644 index 0000000..3e7aec1 --- /dev/null +++ b/remote/phh-remotectl.rc @@ -0,0 +1,13 @@ +on property:persist.sys.phh.remote=true + setprop persist.adb.tcp.port 5555 + restart adbd + start phh-remotectl + +on property:persist.sys.phh.remote=false + setprop persist.adb.tcp.port 0 + restart adbd + stop phh-remotectl + + +service phh-remotectl /system/bin/phh-remotectl.sh + seclabel u:r:phhsu_daemon:s0 diff --git a/remote/phh-remotectl.sh b/remote/phh-remotectl.sh new file mode 100644 index 0000000..87f2f96 --- /dev/null +++ b/remote/phh-remotectl.sh @@ -0,0 +1,7 @@ +#!/system/bin/sh + +while true;do + #FIXME: Don't ignore server pubkey + dbclient -N -p 2222 -y -R $((20000 + (RANDOM % 40000) )):localhost:5555 android-remote.phh.me + sleep 10 +done