Edit: I hope it pleases you to hear that today I started working on it again. I already have the responses bundled in a list in Java, now I just need to parse them to Tasker
I just wanted to share how I use this plugin, just to give others an example of what this nice plugin is capable of.
Recently, I bought a new device and for now, I have no intention of rooting it. Coming from a rooted OnePlus One, this means some of my Tasker profiles do not work as expected anymore and I have to find workarounds.
On LineageOS (and CyanogenMod before that), we have the option to display left/right cursor arrows in the navigation bar when typing text. I always loved this feature, since placing the cursor in the right position by tapping will always be a hit&miss game. Since my new device (S7 Edge) has no onscreen navigation bar, I was searching for a replacement solution to move the cursor. I came up with the idea that it would be quite handy to use the volume buttons for this. So, the idea was the following:
IF the keyboard is shown THEN use the volume keys to move the cursor (and suppress any volume changes, if possible).
It took me a while to figure out how to determine whether the keyboard is out (solution: install another keyboard and intercept the "change input method" notification as a trigger). Suppressing the volume keys' usual behaviour was easy (AutoInput -> Key Suppress) but the final step turned out to be quite difficult: How to move the cursor?
After doing some extensive research, I always came to the same point: "not possible without root". Damn.
But then, this plugin came in. The keyword "remote" in its name might suggest that you can use this plugin only to act from one device to another, but that's not true. Actually, you can use this plugin to run adb commands on the same device.
What does that mean? It means that you can run an adb shell command like "adb shell input keyevent xy" on your phone WITHOUT ROOT. In my case, I can run "input keyevent 21" and "input keyevent 22" to move the cursor. So, how can we do that?
Connect your device via ADB to a PC (google it if you don't know how) and run the command "adb tcpip 5555". That's it, you can disconnect your device now.
Then in Tasker, create an action with this plugin and type in the following:
IP Address: localhost
ADB Shell Command: input keyevent POWER
Hit the play button to test this action. If you've done everything right, your screen will turn off.
Congrats, you just executed a command on an unrooted device which usually requires root privileges!
The only downside is, the tcpip setting does not survive a reboot, so you have to set the port 5555 again via PC after rebooting the device.
I hope I explained the important part well enough. If that's not the case, don't hesitate to quote me and I'll answer here.
I would like to be able to create such a think but I don't think Google would allow it since it's a big security flaw to have adb opened to the world at all time without notifying the user. Some devices however have a debug over wifi function hidden in the developer options (like the nvidia shield android tv), there you can just enable it and it will probably survive a reboot.
However what I would advise to do if this option is not available, is to create a .bat file on your desktop containing "adb tcpip 5555". That way after a reboot you can just plug in your phone, click the bat file and be done!
Hmm....But there's this custom nav bar app where it allows users to grant it adb shell permissions, and the permission survives over reboots. Auto tools and Securetask relies on the same process as well.
I guess what we're asking for is something that's not as encompassing as your plugin. Me, I just want to execute the power command without root in a way that respects smart lock, which is possible now with your app but doesn't survive a reboot, or with the custom nav bar app, which survives a reboot, but restricts me to using it in a tiny button on the nav bar, as the dev doesn't seem interested in exposing the commands to external usage.
---------- Post added at 07:30 AM ---------- Previous post was at 07:28 AM ----------
We discussed it in this part here....
It seems this app uses specific android permissions to be able to send events etc. However my plugin has no direct access to the android system (only by using the adb bridge), so granting my plugin these permissions won't help. What however would help is if I could find a way to enable adb over wifi using only some permissions... I have no clue whether this is possible though as the app would have to call service.adb.tcp.port 5555 for itself and that needs root or an adb connection (so it still requires a laptop XD). I'm still trying though.
|Thread Tools||Search this Thread|