When I switched from a rooted device to a new (non-rooted) one, I wanted to keep on using ssh and rsync from the “Run Shell” in Tasker as I did before.
With my rooted device I just pointed to the binary with needed options and added the command in the end:
/data/data/com.magicandroidapps.bettertermpro/bin/ssh -i /data/data/com.magicandroidapps.bettertermpro/home/.ssh/identityfile -p 22 -l myuser 192.168.1.217 “zpool import -R /mnt backup;wait”
Without root I clearly couldn’t access /data/data/com.magicandroidapps.bettertermpro/.
Luckily I bumped into this link:
http://wiki.yobi.be/wiki/Android#Non-rooted_device
which showed how to copy rsync to the SSHDroid folder.
I figured the same could be done with Tasker so here we go..
For Tasker to call binaries directly, they need to be accessible by Tasker.
/sdcard is no good as we can’t set the execute bit on the filesystem.
We need to copy it to Tasker’s own folder /data/data/net.dinglisch.android.tasker/.
To keep everything clean I would advise to create a seperate folder where you will copy the binaries to ie. /data/data/net.dinglisch.android.tasker/custom/
Create the custom directory:
Tasker - File - Create Directory - Create All - /data/data/net.dinglisch.android.tasker/custom/bin
Copy the binary:
Tasker - File - Copy File - From /sdcard/mybinary to /data/data/net.dinglisch.android.tasker/custom/bin/
Set the correct permissions (you can probably tighten these permissions):
Tasker - Script - Run Shell - Command - chmod 755 /data/data/net.dinglisch.android.tasker/custom/bin/mybinary
Tasker - Script - Run Shell - Command - /data/data/net.dinglisch.android.tasker/custom/bin/mybinary
That’s it..
I have successfully used this for the ssh binary from BTEP (dropbear based) and the rsync binary (I also use rsync as a replacement for scp).
BusyBox binary also seems to work.
I couldn’t get the OpenSSH one from CyanogenMod running as it needed libssh.so which I can’t copy without root.
I can now do some cool stuff for which I previously needed root.
If you plan on using sqlite3 to access contacts or sms database, you will need root.
Databases on /sdcard or Tasker’s directory will pose no problem.
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/fQPgeGWLH2Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
The kid app will always have the package name that you defined. So you would copy its custom binary to /data/data/thepackagenameyouassigned. The kid app doesn't need to find it's own package name because it doesn't ever change. The programmer would just write the correct package name into the Copy action when developing the project. Make sure the package name you assign when exporting the project matches the name you used in that action, and you should be good to go.
:)
Of course me, myself & I know the package name. But what I'm after is the kid app finding out its own package name, so it knows where to copy its custom binary to ...
The kid app will always have the package name that you defined. So you would copy its custom binary to /data/data/thepackagenameyouassigned. The kid app doesn't need to find it's own package name because it doesn't ever change. The programmer would just write the correct package name into the Copy action when developing the project.
I would like the app to be able to find out its own package's name is that I hate introducing literals in my programming. It is plain bad practice, to be avoided at (virtually) all cost - at least by me.
Not to hijack the thread, but why is it bad practice? Sincere question... I'm a Tasker rookie with no programming experience... learning quickly, but thirsty for the how's and why's. (Maybe email me if you find the time?)
And if there is a way to do this, then the copy function (such as you described in your next post - thanks for that) could be written in a more 'universal' way, and dropped as-is in any project.
It's probably possible, but I'll have to defer to someone else.
You can use the Run Shell action for the "ps" command for a list of all packages on your device, then probably parse out the correct package name using variables...if you get it working, it could be a separate task that you always use in individual apk tasks using the Perform Task action.
Also, I could be wrong, but I vaguely remember Pent mentioning that he's considered adding an action to list package names...Not sure if/when that might come.
So, my question still awaits a genius's reply ;-)
Then I am DEFINITELY not your man, lol! But there are a few geniuses floating around here!
--
So, my question still awaits a genius's reply ;-)