Best run shell commands in Tasker - Tasker Tips & Tricks

Hello guys.
I stumbled across a reddit thread providing some run shell commands to replace secure settings. The fixes on Android 6.0 allowed me to install and grand the root permissions but never actually worked as intended. Secure settings still returns errors when used.
Long story short I built on the list adding ones I used before from my list.
Here is about 30 most common run shell commands. I will update list if i come across some new ones. Also appreciate your input if you happen to use some good ones.
You can access it all here:
http://www.notenoughtech.com/tasker/tasker-run-shell-commands/
Happy tasking. :good:

Boy, where do I start? The list would be endless. Anyway, here are some, not all, that I use.
Root commands
Open power menu: sendevent /dev/input/event0 1 116 108 && sendevent /dev/input/event0 0 0 0
Restart SystemUI: pkill -l TERM -f com.android.systemui
Safe reboot: svc power reboot
Safe reboot to recovery: svc power reboot recovery
Get list of all system/global/secure settings along with their values; using system settings as example: settings list system
Read system/global/secure setting to a variable; using secure setting accessibility_enabled as example: settings get secure accessibility_enabled
Change system/global/secure setting; using secure setting accessibility_enabled as example: settings put secure accessibility_enabled 0
Make /system rewritable: mount -o remount,rw /system
Make /system read-only: mount -o remount,ro /system
Change file permissions, using /system/etc/hosts as example; numbers are 7 for rwx, 6 for rw, 4 for r; first number is for root (system user), second is for group, third is for all users: chmod 644 /system/etc/hosts
Tap at x,y pixels on screen, using 540,1500 as example: input tap 540 1500
Swipe from x1,y1 to x2,y2, using 540,1500 to 540,300 (swipe up) as example: input swipe 540 1500 540 300
Read/change another app's database; can't give examples as this would need a full tutorial: sqlite3 /path/to/.db_file "sqlite3 commands";
non-root command
Open any app from a variable %package_name containing com.paclage.name; this one is javascript, not shell script [note that you don't want to put % before variable in javascript]: loadApp(package_name, '', false);
Extract %file zip file to /sdcard: unzip %file /sdcard/
Move a file: mv /original/path /new/path
Copy a file: cp /original/path /new/path
Read a file to a variable: cat /path/to/file
Write %var to a file: echo %var > /path/to/file
Delete a file: rm /path/to/file
Delete a folder and all its contents: rm -r /path/to/folder
Check whether a process is doing something or not; set the output to a variable, set a wait for some time, and then get the output again, if output has changed then the process is doing something: ps | grep com.package.name

Sukarn said:
Boy, where do I start? The list would be endless. Anyway, here are some, not all, that I use.
Click to expand...
Click to collapse
Thanks I'm updating the page as I type this! - I completely forgot about file operations if I'm honest. Good to have others to contribute!

quintaar said:
Thanks I'm updating the page as I type this! - I completely forgot about file operations if I'm honest. Good to have others to contribute!
Click to expand...
Click to collapse
You need to proofread that page. There are lots of errors in there that will stump newbs

Sukarn said:
You need to proofread that page. There are lots of errors in there that will stump newbs
Click to expand...
Click to collapse
That's what I'm doing now , trying to put them, in some logical order as well, to make it easy to find, and use. I do appreciate the time taken to type this.

Is input keyevent correct for emulating the power button in a shell command? The # on the website didn't work. I found the generic.kl file in my /system/usr folders and the key # for power listed there did now work with that shell command, either. Even with run as root checked.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

LeftyGR said:
Is input keyevent correct for emulating the power button in a shell command? The # on the website didn't work. I found the generic.kl file in my /system/usr folders and the key # for power listed there did now work with that shell command, either. Even with run as root checked.
Click to expand...
Click to collapse
I believe hardware keys would be device specific, ego could have different codes.

quintaar said:
I believe hardware keys would be device specific, ego could have different codes.
Click to expand...
Click to collapse
I guess my real question is that the correct shell command as it is written? Because with my specific device key code did not do anything.

Are you trying to do this when the phone display is on or off? this only works when screen is on. input keyevent 26 works fine on my device

quintaar said:
Are you trying to do this when the phone display is on or off? this only works when screen is on. input keyevent 26 works fine on my device
Click to expand...
Click to collapse
On... Guess it does not like me.

LeftyGR said:
On... Guess it does not like me.
Click to expand...
Click to collapse
Do you get any error? My most common mistake is spelling the run shell with upper case, as my keyboard automatically corrects it. And if I forget to change it, it returns an error

quintaar said:
Do you get any error? My most common mistake is spelling the run shell with upper case, as my keyboard automatically corrects it. And if I forget to change it, it returns an error
Click to expand...
Click to collapse
Yes. Appears to be a timeout error.

Background Data On/Off? Thanks in advance
Sent from my hlte using XDA-Developers mobile app

LeftyGR said:
Yes. Appears to be a timeout error.
Click to expand...
Click to collapse
I stumbled on this:
http://forum.xda-developers.com/showthread.php?t=2063741
Perhaps will help you more as well

shaharofir said:
Background Data On/Off? Thanks in advance
Sent from my hlte using XDA-Developers mobile app
Click to expand...
Click to collapse
I've not come across the setting, but try to use:
settings list system
settings list global
settings list secure​and see what your device will give you in options lists.

I totally forgot about another shell command that I have set up in Tasker: md5sum /path/to/file
I use it to verify the integrity of downloads in an OTA app I made for a custom ROM using only Tasker.
---------- Post added at 10:52 AM ---------- Previous post was at 10:43 AM ----------
quintaar said:
Are you trying to do this when the phone display is on or off? this only works when screen is on. input keyevent 26 works fine on my device
Click to expand...
Click to collapse
On my phone (OnePlus One), "input keyevent 26" just turns the screen off, while 116 does nothing.
LeftyGR said:
I guess my real question is that the correct shell command as it is written? Because with my specific device key code did not do anything.
Click to expand...
Click to collapse
Did you try the command I posted at the top of my post here? It's the second post in this thread.

quintaar said:
I've not come across the setting, but try to use:
settings list system
settings list global
settings list secure
and see what your device will give you in options lists.
Click to expand...
Click to collapse
Thanks. Will give it a try.

Sukarn said:
I totally forgot about another shell command that I have set up in Tasker: md5sum /path/to/file
.
Click to expand...
Click to collapse
I have added this one as well Thanks

shaharofir said:
Thanks. Will give it a try.
Click to expand...
Click to collapse
Looked, nothing there. Any suggestions?
Sent from my hlte using XDA-Developers mobile app

shaharofir said:
Looked, nothing there. Any suggestions?
Sent from my hlte using XDA-Developers mobile app
Click to expand...
Click to collapse
Perhaps maybe more luck with intents? I'm working on the similar list for it
Sent from my Nexus 6P using Tapatalk

Related

[Mods] WebBuntu Post-Webtop2sd Hacks

Hey there,
Here is a guide for what to do after you have installed Webtop2sd and moved the Webtop to the sdcard. This guide, using [mbm]'s patch, will install gnome-terminal along with a rebuilt DPKG-repo so that way you can run apt-get, synaptic or aptitude to download new software for your Webtop. Along with this guide there is a link to Fenny's HDMI hack for those who don't have the laptop dock or the HD Dock for the Bionic.
Bionic Webtop Over HDMI Hack
Prerequisites:
1) Rooted Bionic
2) Webtop Patch
3) ADB already configured
4) Patience
First things first, go ahead and download [mbm]'s patch for Webtop that enables apt-get, synaptic package manager and gnome-terminal services in Webtop and place that file on the root of your sdcard. Then follow these commands step by step to apply the patch.
adb shell
su
/bin/bash
-You will get some kind of error message, just ignore and push past it with the following commands
source /upath.sh
cd /osh
tar jxvf /mnt/sdcard-ext/mbm.tar.bz2
mount -o remount, rw /
mkdir /var/lib/dpkg/updates
reboot
Click to expand...
Click to collapse
After rebooting your phone, run these commands in adb:
su
mount -o remount, rw /
Click to expand...
Click to collapse
After booting into webtop:
Ctrl+Alt+T
sudo apt-get update
Click to expand...
Click to collapse
**take note that you must run the "mount -o remount, rw /" command anytime you reboot your phone because any programs you get thru apt-get or synaptic will error out during installation
After that is done, go ahead and rename the folder /etc/tomoyo to something else like /etc/toy or whatever you want (Note, webtop2sd already takes care of this part for the user). After that, go ahead and dock your phone to see what happens cause you will be presented with a normal looking Webtop but if you hold down ctrl+alt+t, then it brings up the terminal!
From here, you can run "gksu synaptic" and use the password "test" to start installing various different programs and packages that are normally available on Ubuntu.
Important!
If you mess up your Webtop partition in any kind of way and need to restore it back to stock, please download this custom FXZ and flash thru RSD to bring you back to stock again.
Webtop RSD Restore
Dependencies
Take caution when modding Webtop because there are some dependencies that will break Webtop if they are upgraded such as anything ending in a .mot or anything resembling that.
Credits
Please thank [mbm] for fixing what Motorola took out, without him, none of this would be possible without his patch.
Sogarth for being the pioneer of Webtop hacking and for porting over his Webtop2sd app to give us more storage to play with.
Fenny for bringing over his Webtop over HDMI hack to our phones.
Desktop Enviroment:
If you do not like the default LXDE and AWN setup that comes preloaded on Webtop, you do have the ability to change some settings in the phone to use different Desktop environments such XFCE, Gnome-Panel, FBPanel or etc, etc.
After installing your DE of choice thru apt-get or synaptic, navigate on your phone with Root File Explorer to /osh/usr/local/bin/ and open the file "start-oshwt-2.sh" in the text editor and you will be presented with something that looks like this:
#! /bin/sh
### BEGIN INIT INFO
# Provides: start_lxde2.sh
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: started by adas user at login
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
. /lib/lsb/init-functions
export `fbcp_dsba`
log_action_msg "Will now start OSHWT 2 scripts"
sfalv -i "/usr/lib/gvfs/gvfs-gdu-volume-monitor"
# start OSHWT 2 scripts
sfalv -i "awn-autostart"
sfalv -i "webtop-panel"
#sfalv -i "webtop-wallpaper"
#sfalv -i "evbridge"
webtop-wallpaper &
evbridge &
sfalv -i "window_switcher"
system-config-printer-applet >/dev/null 2>/dev/null &
sr-test avahi_start &
# IKXWEBTOP-5690 workaround.
# xkb is broken in 10.10 in that each time a keyboard is connected
# the layout of all other keyboards become the layout of
# the last connected keyboard.
# There is an xorg.conf.d rule that forces all keyboards to
# layout 'us(android)' but for some reason it is not working for
# evfwd. Here we force xkb to work with 'us(android)' so evfwd
# is assigned the right layout.
setxkbmap 'us(android)'
Click to expand...
Click to collapse
From here, if you comment out the sfalv -i "awn-autostart", then add to the script sfalv -i "xfdesktop" and sfalv -i "xfce4-panel" if you installed xfce4 or whatever Desktop environment you installed. If you followed this, your script should look like this:
#! /bin/sh
### BEGIN INIT INFO
# Provides: start_lxde2.sh
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: started by adas user at login
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
. /lib/lsb/init-functions
export `fbcp_dsba`
log_action_msg "Will now start OSHWT 2 scripts"
sfalv -i "/usr/lib/gvfs/gvfs-gdu-volume-monitor"
# start OSHWT 2 scripts
#sfalv -i "awn-autostart"
sfalv -i "webtop-panel"
sfalv -i "xfdesktop"
sfalv -i "xfce4-panel"
#sfalv -i "webtop-wallpaper"
#sfalv -i "evbridge"
webtop-wallpaper &
evbridge &
sfalv -i "window_switcher"
system-config-printer-applet >/dev/null 2>/dev/null &
sr-test avahi_start &
# IKXWEBTOP-5690 workaround.
# xkb is broken in 10.10 in that each time a keyboard is connected
# the layout of all other keyboards become the layout of
# the last connected keyboard.
# There is an xorg.conf.d rule that forces all keyboards to
# layout 'us(android)' but for some reason it is not working for
# evfwd. Here we force xkb to work with 'us(android)' so evfwd
# is assigned the right layout.
setxkbmap 'us(android)'
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Working Programs:
OpenOffice
XFCE4
Xchat
LxTerminal
Transmission
lxpanel
rdesktop
VLC Player (Video is choppy)
Gnome-Panel
Evolution Email
Chrome-Browser
Can we get some more info on this? What programs can I get to work?
Sent from my DROID BIONIC using XDA App
BerkleyJ said:
Can we get some more info on this? What programs can I get to work?
Sent from my DROID BIONIC using XDA App
Click to expand...
Click to collapse
You can check out the Atrix forums to see what others have installed but for me, I've install VLC Player and Xchat, both work very well but I am running out of space but that will be fixed with Webtop2sd app.
OMG! This is awesome!! Good work guys! I will redirect my chromium post to this one instead!
Awesome guys!
Sent from my DROID BIONIC using XDA Premium App
These commands for windows?
after /bin/bash
bash: groups: command not found
bash: lesspipe: command not found
frenetic said:
These commands for windows?
after /bin/bash
bash: groups: command not found
bash: lesspipe: command not found
Click to expand...
Click to collapse
Those are for within ADB shell
Sent from my DROID BIONIC using Tapatalk
tallnerd1985 said:
Those are for within ADB shell
Sent from my DROID BIONIC using Tapatalk
Click to expand...
Click to collapse
Not working correctly
I will probably feel stupid
Sent from my DROID BIONIC using XDA Premium App
frenetic said:
Not working correctly
I will probably feel stupid
View attachment 735522
Click to expand...
Click to collapse
I am getting the same error
runandhide05 said:
I am getting the same error
Click to expand...
Click to collapse
Same here This is getting frustrating, I couldn't get the Webtopchromium hack to work from v1r7u41 and now I can't get this to work. The Webtopchromium would at least install although it wouldn't launch. Any help would be greatly greatly appreciated as the standard lapdock is gimped to say the least.
So I'm using the webtop hack and loving it. When it first starts, it prompts you to select your display settings. Well, I picked some I don't like now, and I can't find the option for it again. Can anyone direct me in the right place?
Thanks.
Figured it out. Couldn't see the settings due to the display. Hovered over top right and got settings to show.
Sent from my DROID BIONIC using xda premium
Working great for me. I need to remount / everytime I want to use apt-get (dpkg). I think I got that error too. Run:
Code:
echo $SHELL
to make sure it is bash and just keep going.
@mistawolfe
Click on the settings cog wheel thing (upper right) then display settings (maybe display) resolution I can't remember I got rid of the webtop-panel.
Added some updates to the process of unlocking Webtop to the main page. Feel free to pm me any hacks or tricks that you have found past my guide or post them here if you feel like.
P.S.
If anybody care to make a flashable zip file for CWM to make this process easier, PM your link to the zip and I will post a mirror for it.
Could someone bring me up to speed? Are you using the on screen keyboard and mouse functionality or external mouse and keyboard. I can't get anything done with the onscreen controls. They don't work right. Softkeys don't work at all. Mouse jumps all over and keyboard pushes result in totally different keys being typed.
ok, followed instructions on the updated op, ignored and continued after getting these " /bin/bash
bash: groups: command not found
bash: lesspipe: command not found"
errors after "apt-get update" command i get 0% [connecting to ports.ubuntu.com] and thats it, just stays at 0%. so after 5-10 mins i unplug phone dock, and alt-ctrl-delete...get nothing...
I also followed the update. When i came to the apt-get update command i get a "not found" error....so i went on in webtop amd opened terminal->sudo synaptic. It started up fine, although i dont see any packages that arent already installed....so i was trying to find some repos, but when i try to add one the button is grayed out after i type the url...so will someone give me some advice on the missing apt-get...and a list of repos compatible with webtop? Sorry for beimg clueless..its been a while since ive used linux "other than android".
Reminon said:
I also followed the update. When i came to the apt-get update command i get a "not found" error....so i went on in webtop amd opened terminal->sudo synaptic. It started up fine, although i dont see any packages that arent already installed....so i was trying to find some repos, but when i try to add one the button is grayed out after i type the url...so will someone give me some advice on the missing apt-get...and a list of repos compatible with webtop? Sorry for beimg clueless..its been a while since ive used linux "other than android".
Click to expand...
Click to collapse
I got the same errors until I added the "Update" folder and followed the code that was added tonight. Try the code on the Update folder that was added today and see if that works for you too.
danegrclose said:
I got the same errors until I added the "Update" folder and followed the code that was added tonight. Try the code on the Update folder that was added today and see if that works for you too.
Click to expand...
Click to collapse
so i get that error when apt-get update in cmd, so i go to webtop and open terminal, type sudo...not found, synaptic...not found, what the heck am i doing wrong here?

[HOW-TO] [PICTURES] ADB Working On the Google Chromecast

Hey everyone,
I got the Android Debugging Bridge (ADB) working on the Google Chromecast.
A video is currently uploading. A how-to will follow shortly after.
Videos have been uploaded!
Thanks!
Part 1:
http://www.youtube.com/watch?v=vYICywxdUfM
Part 2:
http://www.youtube.com/watch?v=mjedUnv7tkM
Logcat made in Part 2:
http://pastebin.com/WZtHzrak
[Prerequisites]
A Rooted Chromecast (I recommend tvall's image..Here).
PuTTY or another Telnet Client
Android SDK
Active internet connection
Chromecast's IP Address
[How To]
Full Gallery here: http://imgur.com/a/ORiL0#0
Assuming you already have a rooted Chromecast and it is ON;
Open your preferred Telnet client, I prefer PuTTY.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Type in your Chromecast's IP Address and choose telnet as the connection type (I won't tell you how to get this, hint: check your router).
Click open and you should now see a black terminal window.
Type:
Code:
mount -o rw,remount /
and press enter
Then type:
Code:
setprop service.adb.tcp.port 5555
and press enter
Next type:
Code:
busybox vi default.prop
Press the letter 'i' on the keyboard for 'insert'
Use the arrow keys on your keyboard to navigate.
Change:
Code:
ro.secure=1
to
Code:
ro.secure=0
Change:
Code:
ro.debuggable=0
to
Code:
ro.debuggable=1
Press the 'ESC' key on your keyboard so VI goes back to accepting commands
Type ':wq' without the quotes and with the colon....Press enter.
You should now be back at the / # prompt..
Type
Code:
busybox wget http://goo.gl/TnbG99 -O adbd
and press enter
Type
Code:
chmod 777 adbd
and press enter
Type
Code:
./adbd &
It may not say anything and drop back to the prompt, this is normal
Type
Code:
ps | grep 'adbd'
and press enter to make sure adbd is running
Open a command prompt and cd to the SDK's platform-tools folder
Your path will be different than mine.
Type
Code:
adb devices
and press enter
It will probably not list any devices; this is normal. We just need to tell adb what device to connect to over wifi.
Type
Code:
adb connect X.X.X.X
where X.X.X.X is the IP Address of your Chromecast
Press Enter
Should say
Code:
Connected to X.X.X.X:5555
where X.X.X.X is the IP of your chromecast.
Type:
Code:
adb devices
and press enter
It should list your chromecast by its IP Address.
Type:
Code:
adb shell
and press enter
You should be greeted with a # prompt.
Congratulations! You now have ADB access to your chromecast.
Please note that this DOES NOT survive across reboots.
Reserved
Update:
[08/15/13 2:40PM CST] Videos Posted
[08/16/13 2:05PM CST] How-To Posted with Pictures
Awesome!
Just to clarify, this really doesn't do much yet.
As of right now you can't make persistent changes to the filesystem, because they revert after a reboot.
Heck you can't even remount the /system partition as RW at this point. Not sure why, but not too worried about it at the moment
/system is squashfs, a compressed readonly fs. Not difficult to modify, but requires reflashing the while partition (like gtvhackers image)
Sent from my Evo V 4G using Tapatalk 2
tvall said:
/system is squashfs, a compressed readonly fs. Not difficult to modify, but requires reflashing the while partition (like gtvhackers image)
Sent from my Evo V 4G using Tapatalk 2
Click to expand...
Click to collapse
Awesome. I'm assuming it just unpacks the system after every reboot, I mean since the system seems to revert to not having any added items unless its in the image tahat was flashed?
death2all110 said:
Awesome. I'm assuming it just unpacks the system after every reboot, I mean since the system seems to revert to not having any added items unless its in the image tahat was flashed?
Click to expand...
Click to collapse
You can't modify the filesystem without reflashing it. Squashfs is read only.
Sent from my Evo V 4G using Tapatalk 2
tvall said:
You can't modify the filesystem without reflashing it. Squashfs is read only.
Sent from my Evo V 4G using Tapatalk 2
Click to expand...
Click to collapse
Right. Sorry. Long day.
Anyway, is there a way to modify the boot image?
OP Updated
Thx m8
great!
adb push works well,
I suppose you could make persistent changes to /cache (this partition is mounted rw!)
Greetings:
When I attempt to download "busybox" from "Goo", it comes back with: server returned error: HTTP/1.1 404 not found !!
Any input/help is much appreciated.
Thank you.
samteeee said:
Greetings:
When I attempt to download "busybox" from "Goo", it comes back with: server returned error: HTTP/1.1 404 not found !!
Any input/help is much appreciated.
Thank you.
Click to expand...
Click to collapse
@samteeee Try it now. url should be fixed.
Hi,
i have a question, it's possible to have adb with chromecast if this one is not root?
Thanks,
labiba said:
i have a question, it's possible to have adb with chromecast if this one is not root?
Click to expand...
Click to collapse
Sorry, no.
Hello,
i don't now if i'm in the good forum to ask for help.
I have a GTV100 de netgear that i routed. after a problem of the remote i did a hard reset and after my device don't work.
in the beginin i have the trace in the uart that all go fine, But now i have the message :
NAND: Read mkbootimg header error!
FATAL ERROR! There is no bootable image on this machine!
tbdzz---- Img_Ld_And_Start error! Spinning now!
[109]I(SM): SM starts, enters warmup state!
[112]I(SM): begin to run tasks
there is any solution to write another bootable image?
thanks for your help
ChromeCast mapping memory
Hello,
I have a chromecast and i want to show its mapping memory.
the objectif is to verify when the chromecast play a video if its buffer is secure or not ?
and how can where the kernel do the allocation for memory?
can you help me please ?
thanks :good:
When I attempt to download "busybox" from "Goo", it comes back with: server returned error: HTTP/1.1 404 not found !!
Any input/help is much appreciated.

Wink Hub root

Rooting a Wink Hub with the latest (as of October) firmware (version 0.33) or earlier.
First use a curl command to exploit a SQL injection vulnerability to create a php file used to execute shell commands on the hub:
Code:
curl -d id="1 or 1=1';ATTACH DATABASE '/var/www/exploit.php' AS lol; CREATE TABLE lol.pwn (t TEXT); INSERT INTO lol.pwn (t) VALUES ('<?php passthru(' || char(36) || '_POST[' || char(39) || 'cmd' || char(39) || ']); ?>');--" http://192.168.0.1/dev_detail.php
Now you can supply shell commands to the exploit.php.
If you don't want to mess with ssh keys, now you can run this command to enable root login without using a password. My recommendation would be to immediately ssh in and use the passwd command to change the root password.
Code:
curl -d cmd='sed%20-i%20%27s%2F%3D-sg%2F%3D%2F%27%20%2Fetc%2Fdefault%2Fdropbear%3B%2Fetc%2Finit.d%2FS50dropbear%20restart%3Becho%20-e%20%22%5Cn%5Cn%22%20%7C%20passwd' http://192.168.0.1/exploit.php
For those who don't mind using ssh keys, or want to run other commands:
On the machine I want to copy my ssh key to root so I'd run something like this:
Code:
echo MySSH_PublicKey > /root/.ssh/authorizedkeys
It would be nice if you could just call:
Code:
curl -d cmd='echo MySSH_PublicKey > /root/.ssh/authorizedkeys'
But that won't generally work because of http issues. The key is to urlencode the cmd you want to run using a site like http://meyerweb.com/eric/tools/dencoder/
Just urlencode the bits between the single quotes, the php exploit won't work without the single quotes.
So after getting the urlencoded command I actually invoke:
Code:
curl -d cmd='echo%20MySSH_PublicKey%20%3E%20%2Froot%2F.ssh%2Fauthorizedkeys' http://192.168.0.1/exploit.php
Then you can happily ssh as root to the wink hub!
:victory:
FreeFly said:
Then you can happily ssh as root to the wink hub!
:victory:
Click to expand...
Click to collapse
FIRST REPLY! :good:
This is awesome! I can't wait to see where this goes. We should also get Nashira in here with his awesome android app, BLINK that allows a rooted hub to be controlled locally.
https://github.com/nashira/blink
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This awesome. Thanks for the great work
Nice work. This will make things much easier.
Some people (people running Windows for instance) are having issues generating the ssh keys. As a suggestion, can we incorporate the below so that people can just login as root using a password? I believe this would make things even simplier.
Code:
#commands to allow root login using root as password
sed -i 's/=-sg/=/' /etc/default/dropbear;/etc/init.d/S50dropbear restart
echo -e 'root\nroot' | passwd
I don't have enough post to provide the exact command, but it should be something like:
curl -d cmd='sed%20-i%20%27s%2F%3D-sg%2F%3D%2F%27%20%2Fetc%2Fdefault%2Fdropbear%3B%2Fetc%2Finit.d%2FS50dropbear%20restart' hxxp/ipaddress/exploit.php
curl -d cmd='echo%20-e%20%22root%5Cnroot%22%20%7C%20passwd' hxxp/ipaddress/exploit.php
FreeFly said:
Rooting a Wink Hub with the latest (as of October) firmware (version 0.33) or earlier.
Click to expand...
Click to collapse
Very nice!
I started lookng for another PHP hole but never looked that hard as my unit was already rooted. I did my upgrade by downloding the app-rootfs.ubi manually and using ubiformat to flash it on.
However in the official Wink app its still showing me version 0 I've been wading through the upgrade scripts to see where it set's version 33 its in /database somehere If you could take a look at your device and let me know I'd very much appreciate it.
I also have a pretty good script that downloads the update re-exploits the update before it installs the update with ubiformat. There is about 4 or 5 places that have a lot of this wink rooting data. If there is interest I would be happy to setup a forum to focus the very small "scene"
If anyone has setup a kidde smoke alarm via aprontest let me know I have had much luck as of yet. I'll certainly post if I make some headway.
berserko said:
Very nice!
I started lookng for another PHP hole but never looked that hard as my unit was already rooted. I did my upgrade by downloding the app-rootfs.ubi manually and using ubiformat to flash it on.
However in the official Wink app its still showing me version 0 I've been wading through the upgrade scripts to see where it set's version 33 its in /database somehere If you could take a look at your device and let me know I'd very much appreciate it.
I also have a pretty good script that downloads the update re-exploits the update before it installs the update with ubiformat. There is about 4 or 5 places that have a lot of this wink rooting data. If there is interest I would be happy to setup a forum to focus the very small "scene"
If anyone has setup a kidde smoke alarm via aprontest let me know I have had much luck as of yet. I'll certainly post if I make some headway.
Click to expand...
Click to collapse
Here are the files that report the versions to the app.
echo "00.01" > /database/cf_build
echo "00.01" > /database/cf_fver2
echo "00.33" > /database/cf_fver3
berserko said:
There is about 4 or 5 places that have a lot of this wink rooting data. If there is interest I would be happy to setup a forum to focus the very small "scene"
Click to expand...
Click to collapse
Someone over at slickdeals did but doesn't look like there is anything happening over there yet. He's got some links but that is about it.
homeautomation proboards com/board/3/wink-hub
---------- Post added at 01:52 AM ---------- Previous post was at 01:16 AM ----------
FreeFly said:
Then you can happily ssh as root to the wink hub!
:victory:
Click to expand...
Click to collapse
It doesn't seem to be taking my key? I can't ssh into it.
disconnected: no supported authentication methods available (server sent publickey)?
nyvram1 said:
We should also get Nashira in here with his awesome android app, BLINK that allows a rooted hub to be controlled locally.
Click to expand...
Click to collapse
BLINK does look very nice. I'd originally wanted to root the hubs just to run my own scripts for home automation, but that app is very cool.
:good:
00.47 is out and this particular sql injection has been closed
00.47 is out and this particular sql injection has been closed
nyvram1 said:
FIRST REPLY! :good:
This is awesome! I can't wait to see where this goes. We should also get Nashira in here with his awesome android app, BLINK that allows a rooted hub to be controlled locally.
Click to expand...
Click to collapse
I'm also interested in Nashira's project, but I'm looking to use his work to figure out how to send commands from a Raspberry Pi that will be the equivalent of pushing a light-on button on the Android app. Being able to issue commands to the wink by running a python script, for example, would open up the hub to be used in conjunction with lots of home automation platforms. I have a bunch of cheap Arduino sensors integrated with an open source home automation system that is much more flexible than Wink, so I'd just like to use the Wink hub for its radios.
It looks like you can do a HTTP post to mimic a button push, but that's something I'm not familiar with. If someone has any insights, I'd appreciate it.
---------- Post added at 05:21 AM ---------- Previous post was at 05:13 AM ----------
FreeFly said:
BLINK does look very nice. I'd originally wanted to root the hubs just to run my own scripts for home automation, but that app is very cool.
:good:
Click to expand...
Click to collapse
Hey, that's what I'm interested in too. Do you think you can use his Android app to figure out how to send HTTP posts to the Wink hub?
qnology said:
00.47 is out and this particular sql injection has been closed
Click to expand...
Click to collapse
Qnology, when did that happen? Is it on the "wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi"? I just manually updated my rooted hub today with that .ubi file. Wonder if I upgraded to 0.33 or 0.47?? I don't even know how to find out.
automonkey said:
It doesn't seem to be taking my key? I can't ssh into it.
disconnected: no supported authentication methods available (server sent publickey)?
Click to expand...
Click to collapse
Did you try the passwordless method?
electronichamsters said:
Do you think you can use his Android app to figure out how to send HTTP posts to the Wink hub?
Click to expand...
Click to collapse
Pretty easy. His API is https://github.com/nashira/blink/blob/master/server/api/commands/index.php It's really a wrapper for the aprontest command. Pretty easy to use python to send JSON messages to the commands/index.php. Play with aprontest by itself for a bit first and you'll understand how to use it to switch and dim the lights:
http://gtvhacker.com/index.php/Wink_Hub​​
Then you'll understand you just send a command (update) with the master id for the light you want to switch, and value id (1 for dim, 2 for on/off), and a corresponding value (1-255 for dim / ON or OFF) wrap it in JSON and send to command/index.php
I'm going to write some code to do this myself so I'll post some samples here when I do.
Really?? They already patched it?
electronichamsters said:
Qnology, when did that happen? Is it on the "wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi"? I just manually updated my rooted hub today with that .ubi file. Wonder if I upgraded to 0.33 or 0.47?? I don't even know how to find out.
Click to expand...
Click to collapse
I guess yesterday. I upgraded a new out of box Win Hub using the iOS Wink App thinking that I would get 00.33. When I ran the curl command against dev_detail.php and received a 404, I checked my iOS Wink app and it showed that the Hub was on firmware 00.47.
FreeFly said:
Did you try the passwordless method?
Click to expand...
Click to collapse
Yes I got that to work via Rezurok's cmd.php, doing it via curl on windows in a command window wasn't giving me anything useful for feedback, whereas the cmd.php let me know it was pissy because it was too short. I've got it working now.
electronichamsters said:
Qnology, when did that happen? Is it on the "wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi"? I just manually updated my rooted hub today with that .ubi file. Wonder if I upgraded to 0.33 or 0.47?? I don't even know how to find out.
Click to expand...
Click to collapse
Run an MD5sum against your app-rootfs.ubi if the md5sum is 55574706f2cbf4f6e17e4d224b63287d then you have version 47. I don't havre the 33 md5sum in front of me I'll post it if I can find it...
---------- Post added at 02:38 PM ---------- Previous post was at 02:20 PM ----------
berserko said:
Run an MD5sum against your app-rootfs.ubi if the md5sum is 55574706f2cbf4f6e17e4d224b63287d then you have version 47. The MD5sum for 33 is eec07feee1fa1a4a06e05a00af18156f
Click to expand...
Click to collapse
I found the update went live at:
2014-12-10T22:16:58.000Z
I assume Z means zulu so 5:16pm eastern?
Here is the commands I used to upgrade my pre-rooted Wink for 33 to 47
Hope this helps:
Code:
echo "1" > /database/DO_UPDATE
reboot
Once it comes back in upgrade mode I ran the following:
Code:
cd /tmp
echo "127.0.0.1 localhost" > /etc/hosts
echo "127.0.0.1 flex-dvt" >> /etc/hosts
wget hXXp://wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi <--- Fix the URL forum is breaking it on me...
ubiformat /dev/mtd5 -f /tmp/app-rootfs.ubi
ubiattach -p /dev/mtd5
mkdir /tmp/updater
mount -t ubifs ubi2:rootfs /tmp/updater
sed -i 's/=-sg/=/' /tmp/updater/etc/default/dropbear
rm -f /tmp/updater/etc/init.d/S99local
cp /var/www/set_dev_value.php /tmp/updater/var/www
fw_setenv bootdelay 5
sed -i 's/bootdelay 0/bootdelay 5/' /database_default/u-boot.env
cp /etc/shadow /tmp/updater/etc
mkdir /tmp/updater/root/.ssh
cp /root/.ssh/authorized_keys /tmp/updater/root/.ssh/authorized_keys
echo "127.0.0.1 hub-api.winkapp.com" >> /tmp/updater/etc/hosts
echo "127.0.0.1 hub-updates.winkapp.com" >> /tmp/updater/etc/hosts
echo "127.0.0.1 wink-hub-images.s3.amazonaws.com" >> /tmp/updater/etc/hosts
sed -i 's/rm \/database\/wpa_supplicant.conf/echo WPA Fix #rm \/database\/wpa_supplicant.conf/' /tmp/updater/etc/init.d/S31platform
sed -i 's/#ttyAM0/ttyAM0/' /tmp/updater/etc/inittab
echo "00.01" > /database/cf_build
echo "00.01" > /database/cf_fver2
echo "00.47" > /database/cf_fver3
echo "127.0.0.1 hub-api.winkapp.com" >> /etc/hosts
echo "127.0.0.1 hub-updates.winkapp.com" >> /etc/hosts
echo "127.0.0.1 wink-hub-images.s3.amazonaws.com" >> /etc/hosts
echo "0" > /database/DO_UPDATE
reboot
Once the reboot completes the device will come back online as version 47 This worked fine for me but as always YMMV. The script keeps creates enough holes you should be able to get back in one way or another...
681
Starting from a new in box Wink Hub, is there anything I need to do before hand to make sure I can SSH into the "upgrade mode" partition? It'a not clear if people are using a Serial Console connection to access the "upgrade mode" partition or if they are SSHing in. For SSH access, I would assume the authorized_keys file needs to be updated (so the upgrade mode partition would need to be mounted and updated). Just need some confirmation. Thank you
berserko said:
Here is the commands I used to upgrade my pre-rooted Wink for 33 to 47
Hope this helps:
Code:
echo "1" > /database/DO_UPDATE
reboot
Click to expand...
Click to collapse
berserko said:
Run an MD5sum against your app-rootfs.ubi if the md5sum is 55574706f2cbf4f6e17e4d224b63287d then you have version 47. I don't havre the 33 md5sum in front of me I'll post it if I can find it...
Click to expand...
Click to collapse
I ran a MD5sum on the copy of app-rootfs.ubi that I downloaded from the the amazon aws link sometime on dec 10th. It is "eec07feee1fa1a4a06e05a00af18156f".
I have no idea if it's v0.33 or 0.47. If someone else has a file they're sure is 0.33, can they run a MD5sum on it?
If I rooted and never updated, so I have original firmware, can I use the method you described to go straight to 47?
Thanks
Jeff
qnology said:
Starting from a new in box Wink Hub, is there anything I need to do before hand to make sure I can SSH into the "upgrade mode" partition? It'a not clear if people are using a Serial Console connection to access the "upgrade mode" partition or if they are SSHing in. For SSH access, I would assume the authorized_keys file needs to be updated (so the upgrade mode partition would need to be mounted and updated). Just need some confirmation. Thank you
Click to expand...
Click to collapse

[TUTORIAL] How to enable MULTIWINDOW and change Density on M Developer Preview

As we don't have root yet on the M preview, here is quick tutorial how to enable Muiltiwindow and change density.
You will need TWRP and Total Commander with adb plugin.
1. Boot the TWRP
2. Go to Mount and check the system checkbox
3. Plug the device to PC
4. In Total Commander go to network/adb/your device/system and find build.prop
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
5. Copy the file to some safe place for backup
6. Open the file in editor (F4)
7. Change the line
Code:
ro.build.type=user
with
Code:
ro.build.type=userdebug
8. You can also change the density in the line
Code:
ro.sf.lcd_density=480
I prefer 420.
9. Save the file and copy it back (if you change it on PC).
10. Done
Just FYI, there is a much more simple way to change the DPI without root. You just need a single ADB command.
With the phone powered on, just open up a window in terminal (OSX) or command prompt (Windows) like you would to perform fastboot or ADB commands, and type the following:
adb shell wm density DPI && adb reboot
Just replace "DPI" with the desired DPI. So if you want a 420 DPI, this will be your command:
adb shell wm density 420 && adb reboot
Then just hit enter, the phone will reboot, and voila! enjoy your new DPI.
how to flash twrp on M !!
bicho19 said:
how to flash twrp on M !!
Click to expand...
Click to collapse
fastboot flash recovery
rivera618 said:
fastboot flash recovery
Click to expand...
Click to collapse
i know, but can you provide me with the img file that work with Android M
bicho19 said:
i know, but can you provide me with the img file that work with Android M
Click to expand...
Click to collapse
It is the same as for Lollipop
Man, I can confirm that this tutorial works perfectly, thank you!
Have you understood how to use multiwindows?
In my case, I can't understand which is the second app he shows on the screen. I can chose one from recent menù, but the second seems to be chosen randomly!
Maybe I'm just tired
Will it cause missing applications from PlayStore as it did every time I changed DPI?
To check, try to download 'Tinder'. Or go to the Store webpage from a computer and try to find an App that it's incompatible with your Nexus 5 (And it shouldn't)
bregan90 said:
Will it cause missing applications from PlayStore as it did every time I changed DPI?
To check, try to download 'Tinder'. Or go to the Store webpage from a computer and try to find an App that it's incompatible with your Nexus 5 (And it shouldn't)
Click to expand...
Click to collapse
Tinder installs/opens fine with DPI set to 420 (just tested it). I used the adb commands to change DPI, worked perfectly.
Own a mac, cant seem to get adb to work properly.
swirly05 said:
Own a mac, cant seem to get adb to work properly.
Click to expand...
Click to collapse
./abd "commands go here"
Don't forget the ./
ape96 said:
Man, I can confirm that this tutorial works perfectly, thank you!
Have you understood how to use multiwindows?
In my case, I can't understand which is the second app he shows on the screen. I can chose one from recent menù, but the second seems to be chosen randomly!
Maybe I'm just tired
Click to expand...
Click to collapse
From the resent menu you can set the top and bottom windows.
When u then in some time launch one of them, it is still will be on top or bottom, but another one will be the last used, but it will not be scrollable some or them, or not always. Still a little buggy, . As the new "half frame" app will be on top.
But if you run both apps from resents that you made top and bottom, then they will both scroll.
The new photo app shows some display bugs with density set to 420
neFAST said:
The new photo app shows some display bugs with density set to 420
Click to expand...
Click to collapse
Dunno. Seem to be working fine for me...
What are those bugs? Try to change to 400 or smth else.
playahate said:
From the resent menu you can set the top and bottom windows.
When u then in some time launch one of them, it is still will be on top or bottom, but another one will be the last used, but it will not be scrollable some or them, or not always. Still a little buggy, . As the new "half frame" app will be on top.
But if you run both apps from resents that you made top and bottom, then they will both scroll.
Click to expand...
Click to collapse
I start to understand! It's a big buggy, but it seems that it will improve a lot
It's a useful function, though
ape96 said:
I start to understand! It's a big buggy, but it seems that it will improve a lot
It's a useful function, though
Click to expand...
Click to collapse
Yap. I like it too.
Added the pic to 1st post. Watching YouTube and browsing the same time...
I changed DPI to 420 but there is no option to enable multiwindow?
how do I fix?
swirly05 said:
Own a mac, cant seem to get adb to work properly.
Click to expand...
Click to collapse
You might need to install the latest ABD and Fastboot, compatible with M Preview: https://github.com/simmac/minimal_adb_fastboot/tree/preview
razor17 said:
I changed DPI to 420 but there is no option to enable multiwindow?
how do I fix?
Click to expand...
Click to collapse
I flashed a zip file posted by another user to enable multi window. Then did the adb command from this thread and its all working here.
Edit: here's the post I got the zip from. Flashed it and enabled multi window. Then I adb command DPI to 420. Working for me. Hope this helps
http://forum.xda-developers.com/showthread.php?p=61061093
height soft key
sn0warmy said:
Just FYI, there is a much more simple way to change the DPI without root. You just need a single ADB command.
With the phone powered on, just open up a window in terminal (OSX) or command prompt (Windows) like you would to perform fastboot or ADB commands, and type the following:
adb shell wm density DPI && adb reboot
Just replace "DPI" with the desired DPI. So if you want a 420 DPI, this will be your command:
adb shell wm density 420 && adb reboot
Then just hit enter, the phone will reboot, and voila! enjoy your new DPI.
Click to expand...
Click to collapse
it's a way to change height navigation bar / soft key ?

Propose task freezing/unfreezing set of apps and switching ON location service.

Please, propose a task which does:
- unfreeze set of apps and
- switch ON location (or other) service.
And also:
- freeze apps,
- switch OFF location etc service.
It's needed for phone power efficiency, Google services switched on only when an app needing it is launched (and vice versa).
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.2][HYDROGEN/HELIUM]LineageOS 14.1 r.06-24-2017 by*nijel8
Wait, how do you have a custom ROM on a device with a locked bootloader?
I use the following to freeze a list of apps:
create a run shell command, with root:
cat "/storage/emulated/0/disable-apps.txt" | while read d; do tmp=$(echo $d | awk {'print $1'}); adb shell "su -c 'pm disable $tmp'"; done
the text file just includes apps in full name, such as net.dinglisch.android.taskern,1 name per line
for location, run this shell command with root:
settings put secure location_providers_allowed +gps,network
@alienyd thanx a lot, it looks like the key engine are Linux shell commands for Android. And how do you know of them, is there any "man" for Android shell commands (like: settings put secure location_providers_allowed +gps,network) to look through oneself?
Vagelis1608 said:
Wait, how do you have a custom ROM on a device with a locked bootloader?
Click to expand...
Click to collapse
Yes, it is possible in this phone model: Xiaomi MiMax (Qualcomm Snapdragon chipset)
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.2][HYDROGEN/HELIUM]LineageOS 14.1 r.06-24-2017 by*nijel8
hmm somehow my reply wasn't posted...
anyways, just search for useful tasker shell commands, I saw some threads in here about that. You can also list out all system variables and their values, which is imo priceless for automating tasks!
Yes, but found many examples from most are just typical Linux system commands, like:
Code:
mount -o remount,rw /system
mount -o remount,ro /system
mv /original/path /new/path
cp /original/path /new/path
etc.
And where are purely Android commands list, like:
Code:
pm disable
settings put secure location_providers_allowed +gps,network
?
And they are Android commands, not Tasker's, right?
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.2][HYDROGEN/HELIUM]LineageOS 14.1 r.07-08-2017 by*nijel8
ioy said:
Yes, but found many examples from most are just typical Linux system commands, like:
etc.
And where are purely Android commands, like:
?
And they are Android commands, not Tasker's, right?
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.2][HYDROGEN/HELIUM]LineageOS 14.1 r.07-08-2017 by*nijel8
Click to expand...
Click to collapse
They are Linux commands, but since android is based on Linux it has them.
Tasker can run them without an issue using the Run Shell action (some commands require you to tick the use root box).
Yes, but these commands could be run also from e.g. terminal emulator or scripts without Tasker installed at all, right? In this meaning questioned: if they are Tasker independent and belong to Android itself?
And please, do you know commands to set particular screen orientation: portrait or landscape?
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.2][HYDROGEN/HELIUM]LineageOS 14.1 r.07-08-2017 by*nijel8
ioy said:
Yes, but these commands could be run also from e.g. terminal emulator or scripts without Tasker installed at all, right? In this meaning questioned: if they are Tasker independent and belong to Android itself?
And please, do you know commands to set particular screen orientation: portrait or landscape?
Click to expand...
Click to collapse
Yes, the "commands" you listed are within the OS of android, not integral to Tasker. The example mount command is basic to any Linux kernel. The settings "commands" are really a list of configuration settings that the OS refers to and are android (and device) specific. The are 3 groups of configuration settings: system, global and secure. You can see what your device has by opening a terminal and entering:
settings list system > /sdcard/system-values.txt
That command will list all of the entries in the system configuration and their current values. The output will be put into a file named system-values.txt on the root of your sdcard.
For example, whether the screen is permitted to rotate when the accelerometer senses device rotation is controlled by the value in:
system settings > value user_rotation
For an overview of these configuration settings, please see Best run shell commands in Tasker
Using the "secure" configuration values is the way to replace the defunct "secure settings" plugin using tasker's built in scripting ability.
As far as commands to set screen orientation, IMHO, it's just easier to use Rotation Locker. It integrates with tasker.
ktmom said:
settings list system > /sdcard/system-values.txt
That command will list all of the entries in the system configuration and their current values.
Click to expand...
Click to collapse
Is it possible controlling the whole phone with just these settings variables, i.e. will just commands
Code:
settings get secure/global/system name_of_the_setting
settings put secure/global/system name_of_the_setting 0 or 1
suffice?
ktmom said:
For an overview of these configuration settings, please see Best run shell commands in Tasker
Click to expand...
Click to collapse
I've already read it but thank you very much! (And there're still several doubts)
ktmom said:
As far as commands to set screen orientation, IMHO, it's just easier to use Rotation Locker. It integrates with tasker.
Click to expand...
Click to collapse
Easier, why? Plain text commands are elegant and minimalistic, if Tasker can fire them it is nice to avoid installation of any further third party application. And the whole my question was about it, for any particular task in Tasker you can always find some application which could perform it (without Tasker). And the rationale is to replace them all with one Tasker, agree?
Please, answer the question: which text console command can switch screen orientation: Portrait or Landscape (can't see relevant variable)
ioy said:
Is it possible controlling the whole phone with just these settings variables, i.e. will just commands
Code:
settings get secure/global/system name_of_the_setting
settings put secure/global/system name_of_the_setting 0 or 1
suffice?
Click to expand...
Click to collapse
No, it's a big part, but, for example, forcing an app that is programmed to not rotate ever, into rotating is more than defining settings.
Easier, why? Plain text commands are elegant and minimalistic, if Tasker can fire them it is nice to avoid installation of any further third party application. And the whole my question was about it, for any particular task in Tasker you can always find some application which could perform it (without Tasker). And the rationale is to replace them all with one Tasker, agree?
Click to expand...
Click to collapse
No, not agreed. The point of tasker is to bring the ability to script custom actions to the programming knowledgeable community. Tasker enables people familiar with the concept of if/then/else or variable arrays, ect to derive results based on triggers WITHOUT having to be experts in the deepest layers of the android system.
Plugins bring to the user access to actions not included in tasker. If every possible combination of options was built into tasker, the app would be enormous. It's also unnecessary for the average user who is looking to pop up a particular keyboard automatically when an specific app is launched. Or to turn gps on/off only when using navigating apps....ect.
Please, answer the question: which text console command can switch screen orientation: Portrait or Landscape (can't see relevant variable)
Click to expand...
Click to collapse
The user rotation variable I used in an example earlier. Which is the same as using tasker's built in Display AutoRotate. Other than "because I can", I can't imagine why using the built in action would not be preferred.
The trick is there more that goes into whether or not an app will be forced to rotate. The individual app's display layer does things like looks at the screen dpi and the app's layout and I don't know what and determines how and when to rotate if the user authorizes the screen to rotate in the first place. This can all be over ridden if you are sufficiently knowledgeable in the programming of android apps. But then, why the heck would anyone introduce the overhead of a framework like tasker.
I encourage you to look for android app development tutorials to enhance your understanding in the depth you are looking for. But also understand that you are pushing the use case of the tasker app.
Automagic offers such an option.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
It's disappointing Tasker needs some plugin to do this simple thing. If I need plugin then why tasker, there are many other applications controlling screen orientation!
ivy.lally said:
Automagic offers such an option.
It's disappointing Tasker needs some plugin to do this simple thing. If I need plugin then why tasker, there are many other applications controlling screen orientation!
Click to expand...
Click to collapse
If you want to use a different app for everything, be my guest.
Tasker has a built-in action for autorotation.
An this only switches AutoRotation ON/OFF, what is actually needed is screen orientation settings: to switch AutoRotation OFF and then to set fixed screen orientation of choice.
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.2][HYDROGEN/HELIUM]LineageOS 14.1
alienyd said:
I use the following to freeze a list of apps:
create a run shell command, with root:
cat "/storage/emulated/0/disable-apps.txt" | while read d; do tmp=$(echo $d | awk {'print $1'}); adb shell "su -c 'pm disable $tmp'"; done
the text file just includes apps in full name, such as net.dinglisch.android.taskern,1 name per line
for location, run this shell command with root:
settings put secure location_providers_allowed +gps,network
Click to expand...
Click to collapse
Hello!
I know this is a while ago that You posted this, I hope anyway that You answers me!? I want to freeze a App (Sony-Smart-Connect) automatically with Tasker, and in searching for a how to, I have seen Your post here! Can You Please say me, where exactly in the shell command I must put the full App-Name, and where can I find the full App-Package-Name of a installed App!? My Device is rooted, and I have a root-file-explorer with access to all folders! Please Help me!:highfive:
Thanks in advance!
RoseL.
roselanguste said:
Hello!
I know this is a while ago that You posted this, I hope anyway that You answers me!? I want to freeze a App (Sony-Smart-Connect) automatically with Tasker, and in searching for a how to, I have seen Your post here! Can You Please say me, where exactly in the shell command I must put the full App-Name, and where can I find the full App-Package-Name of a installed App!? My Device is rooted, and I have a root-file-explorer with access to all folders! Please Help me!:highfive:
Thanks in advance!
RoseL.
Click to expand...
Click to collapse
I think your app package name is: com.sonyericsson.extras.liveware
I don't use that app but going to apkmirror.com and searching for it gave me the package. Depending on version, settings -> apps and finding the app might have the package name listed. It no longer does on my oreo ROM.
The operative explanation in the post you quoted is:
the text file just includes apps in full name, such as net.dinglisch.android.taskern,1 name per line
Click to expand...
Click to collapse
The text file is what is called in the run shell command:
run shell command, with root:
cat "/storage/emulated/0/disable-apps.txt" | while read d; do tmp=$(echo $d | awk {'print $1'}); adb shell "su -c 'pm disable $tmp'"; done
Click to expand...
Click to collapse
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
ktmom said:
I think your app package name is: com.sonyericsson.extras.liveware
I don't use that app but going to apkmirror.com and searching for it gave me the package. Depending on version, settings -> apps and finding the app might have the package name listed. It no longer does on my oreo ROM.
The operative explanation in the post you quoted is:
The text file is what is called in the run shell command:
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
Thanks! I have found a other way! - I have downloaded the Secure-Settings-Tasker-Plugin, and it has the ability to Freeze, Kill Apps, and it worked in the moment! But I learn a new thing from Your answer!
Thanks!
fyi the core command is
shell su -c pm disable (app-full-name)
You should be able to manually freeze apps with it. My post was meant for batch freezing with a file list. As this is a native shell command, you don't need any extra plugin for the job.
alienyd said:
I use the following to freeze a list of apps:
create a run shell command, with root:
cat "/storage/emulated/0/disable-apps.txt" | while read d; do tmp=$(echo $d | awk {'print $1'}); adb shell "su -c 'pm disable $tmp'"; done
the text file just includes apps in full name, such as net.dinglisch.android.taskern,1 name per line
for location, run this shell command with root:
settings put secure location_providers_allowed +gps,network
Click to expand...
Click to collapse
For some reason this doesn't seem to work for me.
I have pasted the error log below:
15.45.19/E Run Shell: ->
15.45.19/E Run Shell: ->
15.45.19/E Run Shell: ->
15.45.19/Shell runBackground cat "/storage/emulated/0/disable-apps.txt" | while read d; do tmp=$(echo $d | awk {'print $1'}); adb shell "su -c 'pm disable $tmp'"; done root: true timeout: -1
15.45.19/Shell start process-thread ID 803
15.45.19/E add wait type Shell1 time 2147483647
15.45.19/E add wait type Shell1 done
15.45.19/E add wait task
15.45.21/E Error: 1
Edit: I tried the command in Termux and the following error came up:No devices/emulators found.

Categories

Resources