FORUMS
Remove All Ads from XDA

[Plugin] Remote Adb Shell

1,139 posts
Thanks Meter: 274
 
By Humpie, Senior Member on 23rd February 2017, 05:53 PM
Post Reply Email Thread
16th July 2017, 10:20 AM |#21  
Senior Member
Thanks Meter: 9
 
More
run "pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION". invalid, why?
 
 
18th July 2017, 01:43 PM |#22  
Quote:
Originally Posted by ttydy

run "pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION". invalid, why?

This doesn't work outside my Plugin either. I'm not sure what you're trying to do
20th July 2017, 04:46 PM |#23  
Senior Member
Thanks Meter: 236
 
Donate to Me
More
Quote:
Originally Posted by digitalpig82

Important:
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've enabled wireless ADB on phone.
then, I connected my phone to PC, ran "adb tcpip 5555", opened tasker, tried to use the addon, BUT NO COMMAND whatsoever works.
( tried localhost, 5555, and commands:
A. "input keyevent POWER"
B. "pm uninstall -k --user 0 PACKAGE_NAME"
)

I use Tasker v5.0b9 on android 7.1.2 ( WITH root... so that's weird... I would expect it not to work on non-rooted phone... by mine is rooted, although the addon does not request any root perm ).
@Humpie - can you please check this addon on nougat with latest tasker ?
P.S - I guess the relevant logcat is:
Code:
07-20 19:07:17.730 32401 32648 I com.ADBPlugin: Loaded existing keypair
07-20 19:07:17.730 32401 32648 I com.ADBPlugin: Socket connecting...
07-20 19:07:17.732 32401 32648 I com.ADBPlugin: Socket connected, creating AdbConnection...
07-20 19:07:17.732 32401 32648 D com.ADBPlugin: Created, ADB connecting...
07-20 19:07:17.738 32401 32648 D com.ADBPlugin: ADB connected, opening shell stream...
07-20 19:07:17.746 32401 32648 D com.ADBPlugin: Opened, writing command: pm uninstall --user 0 -k com.whatsapp
07-20 19:07:17.747 32401 32648 D com.ADBPlugin: Command sent, getting responses
07-20 19:07:17.771 29007 29007 D checkDoubleClick: click
07-20 19:07:17.792 32401 32648 D com.ADBPlugin: response: pm uninstall --user 0 -k com.whatsapp
07-20 19:07:17.792 32401 32648 D com.ADBPlugin: response: ^@
07-20 19:07:17.792 32401 32648 D com.ADBPlugin: response: 7[r[999;999H[6n8
07-20 19:07:17.792 32401 32648 D com.ADBPlugin: response: OnePlus3:/ $
07-20 19:07:17.792 32401 32648 D com.ADBPlugin: Sending exit command and waiting for stream to close
07-20 19:07:17.796 32401 32648 W System.err: java.io.IOException: Stream closed
07-20 19:07:17.796 32401 32648 W System.err:    at com.cgutman.adblib.AdbStream.read(AdbStream.java:124)
07-20 19:07:17.796 32401 32648 W System.err:    at com.ADBPlugin.SendSingleCommand.SendSingleCommand(SendSingleCommand.java:251)
07-20 19:07:17.796 32401 32648 W System.err:    at com.ADBPlugin.receiver.FireReceiver$1.run(FireReceiver.java:89)
07-20 19:07:17.796 32401 32648 W System.err:    at java.lang.Thread.run(Thread.java:761)
07-20 19:07:17.796 32401 32648 D com.ADBPlugin: Stream closed, closing Adb...
07-20 19:07:17.796 32401 32648 D com.ADBPlugin: ADB Closed
07-20 19:07:17.796 32401 32648 D com.ADBPlugin: Executed single command
---------- Post added at 04:46 PM ---------- Previous post was at 04:30 PM ----------

Quote:
Originally Posted by Humpie

This doesn't work outside my Plugin either. I'm not sure what you're trying to do

"pm" command can only work through ADB without root perm on phone.
if you tried running it using terminal emulator ( again, without any root ), it won't work.
try connecting to a PC, open ADB then run it -> it will probably work.
20th July 2017, 05:44 PM |#24  
Quote:
Originally Posted by gps3dx

I've enabled wireless ADB on phone.
then, I connected my phone to PC, ran "adb tcpip 5555", opened tasker, tried to use the addon, BUT NO COMMAND whatsoever works.
( tried localhost, 5555, and commands:
A. "input keyevent POWER"
B. "pm uninstall -k --user 0 PACKAGE_NAME"
)

I use Tasker v5.0b9 on android 7.1.2 ( WITH root... so that's weird... I would expect it not to work on non-rooted phone... by mine is rooted, although the addon does not request any root perm ).
@Humpie - can you please check this addon on nougat with latest tasker ?
P.S - I guess the relevant logcat is:

---------- Post added at 04:46 PM ---------- Previous post was at 04:30 PM ----------



"pm" command can only work through ADB without root perm on phone.
if you tried running it using terminal emulator ( again, without any root ), it won't work.
try connecting to a PC, open ADB then run it -> it will probably work.

Thanks for trying and posting the logcat!
Did you enable adb over wifi and try that tcpip command? You only need to do one of the two, since that command enables adb over wifi itself, but if you're rooted, using an app to enable adb over wifi is also possible of course.

The keyevent command should work, I'm not sure why it doesn't for you. Did you get a popup the first time your tried containing "do you trust this computer"?

My plugin works also completely without root and expects to execute commands without root. Can you however try altering the command to "su pm uninstall..." that way it will request root permission first and then execute the command as su. (you can also do it like "su; pm uninstall..." if you want to run more commands as su afterwards).

I'll update Tasker to the latest version and check out the functioning of the Plugin btw!
Edit: can confirm my Plugin to be working just fine on Tasker 5.0b9, will try to mess with the pm command.

I just checked the "pm" command btw in terminal emulator and it just worked with and without root, without root however setting permissions to certain apps does not work as expected. I'm not sure why, I don't have that much knowledge of all android commands.
The Following 2 Users Say Thank You to Humpie For This Useful Post: [ View ] Gift Humpie Ad-Free
20th July 2017, 07:14 PM |#25  
Senior Member
Flag Berlin
Thanks Meter: 119
 
More
Quote:
Originally Posted by gps3dx

I've enabled wireless ADB on phone.
then, I connected my phone to PC, ran "adb tcpip 5555", opened tasker, tried to use the addon, BUT NO COMMAND whatsoever works.
( tried localhost, 5555, and commands:
A. "input keyevent POWER"
(...)

After you connected your device to the pc, did you type "adb devices" at first to make sure you've got a connection to the device? Did you get any console output when you were typing the commands from the pc? Any additional info will help.

I did not get the latest tasker play store update yet, unfortunately but since @Humpie tried it with the latest beta, it seems like it will work with the 5.0 release of tasker.

But actually, since you're rooted, it seems kind of pointless to use this plugin instead of just using the shell with root enabled...
20th July 2017, 10:28 PM |#26  
Senior Member
Thanks Meter: 236
 
Donate to Me
More
Quote:
Originally Posted by digitalpig82

But actually, since you're rooted, it seems kind of pointless to use this plugin instead of just using the shell with root enabled...

I stated i'm rooted to clarify that it doesn't work.
I do want to run in on devices without root though... what's why i'm interested in that plugin

Quote:
Originally Posted by digitalpig82

After you connected your device to the pc, did you type "adb devices" at first to make sure you've got a connection to the device? Did you get any console output when you were typing the commands from the pc? Any additional info will help.

I can enter "adb shell" on PC without problem, using either USB or wireless ADB.
I do get "approve this device" and I select approve.
I can run "adb devices" and get my device info ON A PC, without problem.
Nontheless, any adb shell command ("ls -ls", "pwd", the command in my last post) I run using the plugin, I get %output that repeats my command with another "$" empty line after it.

I also made sure that appOps gave the plugin ALL the permissions and that my firewall (afwall) is disabled.
21st July 2017, 07:25 AM |#27  
Senior Member
Flag Berlin
Thanks Meter: 119
 
More
Quote:
Originally Posted by gps3dx

I stated i'm rooted to clarify that it doesn't work.
I do want to run in on devices without root though... what's why i'm interested in that plugin


I can enter "adb shell" on PC without problem, using either USB or wireless ADB.
I do get "approve this device" and I select approve.
I can run "adb devices" and get my device info ON A PC, without problem.
Nontheless, any adb shell command ("ls -ls", "pwd", the command in my last post) I run using the plugin, I get %output that repeats my command with another "$" empty line after it.

I also made sure that appOps gave the plugin ALL the permissions and that my firewall (afwall) is disabled.

I'm afraid I can't help you with that... It seems like you did everything right. It works fine on my device, so I cannot investigate any more from my side.

@Humpie ?
The Following User Says Thank You to digitalpig82 For This Useful Post: [ View ] Gift digitalpig82 Ad-Free
22nd July 2017, 02:44 PM |#28  
Quote:
Originally Posted by gps3dx

I stated i'm rooted to clarify that it doesn't work.
I do want to run in on devices without root though... what's why i'm interested in that plugin


I can enter "adb shell" on PC without problem, using either USB or wireless ADB.
I do get "approve this device" and I select approve.
I can run "adb devices" and get my device info ON A PC, without problem.
Nontheless, any adb shell command ("ls -ls", "pwd", the command in my last post) I run using the plugin, I get %output that repeats my command with another "$" empty line after it.

I also made sure that appOps gave the plugin ALL the permissions and that my firewall (afwall) is disabled.

If you get that as output, it means the command you executed worked. Just like when you would type it from a console. I think the problem thus is somewhere else. My Plugin uses the same adb library as the following (free) app https://play.google.com/store/apps/d...emotedebugger. It's the same code as my Plugin uses, just without Tasker support. Can you try if it works with this app?
22nd July 2017, 05:32 PM |#29  
Senior Member
Thanks Meter: 236
 
Donate to Me
More
Quote:
Originally Posted by Humpie

If you get that as output, it means the command you executed worked. Just like when you would type it from a console. I think the problem thus is somewhere else. My Plugin uses the same adb library as the following (free) app https://play.google.com/store/apps/d...emotedebugger. It's the same code as my Plugin uses, just without Tasker support. Can you try if it works with this app?

Hi @Humpie - thanks for the reply.
using the app you linked, I can indeed send to "localhost:5555" commands, and they exec and work just fine.

that is indeed weird...
I do the same with your tasker plugin, but the commands I send simply do not work.
I attack screenvideo that shows that
7th August 2017, 10:28 AM |#30  
Senior Member
Thanks Meter: 9
 
More
Quote:
Originally Posted by gps3dx

Hi @Humpie - thanks for the reply.
using the app you linked, I can indeed send to "localhost:5555" commands, and they exec and work just fine.

that is indeed weird...
I do the same with your tasker plugin, but the commands I send simply do not work.
I attack screenvideo that shows that

Me too. @Humpie
7th August 2017, 04:50 PM |#31  
I'll investigate after my holiday, but I still find it strange since it does work with that other app and I have the same code. The only difference is the Tasker part and I just followed their official guidelines and templates for that.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes