So FREAKING Happy to find out about the "pm" (Package Manager) cmd in adb shell, but - Android Q&A, Help & Troubleshooting

So FREAKING Happy to find out about the "pm" (Package Manager) cmd in adb shell, but
So FREAKING Happy to find out about the "pm" (Package Manager) cmd in adb shell, but I can't find the package I want to remove.
https://forum.xda-developers.com/android/general/uninstall-apps-via-adb-t3738105
The app I want to remove the MOST is the "Visual Voicemail". That POS keeps poping up crap and I can't seem to get rid of it.
LG L4 LS991
From my research, it should have a package name with vvm in it, but I just can't find it.
Does anyone know what name it hides under?

MattR59 said:
So FREAKING Happy to find out about the "pm" (Package Manager) cmd in adb shell, but I can't find the package I want to remove.
https://forum.xda-developers.com/android/general/uninstall-apps-via-adb-t3738105
The app I want to remove the MOST is the "Visual Voicemail". That POS keeps poping up crap and I can't seem to get rid of it.
LG L4 LS991
From my research, it should have a package name with vvm in it, but I just can't find it.
Does anyone know what name it hides under?
Click to expand...
Click to collapse
Try listing all the packages
Code:
pm list packages
Or search package name which contains some word
Code:
pm list packages -f someName

Paget96 said:
Try listing all the packages
Code:
pm list packages
Or search package name which contains some word
Code:
pm list packages -f someName
Click to expand...
Click to collapse
I think
Code:
pm list packages -f | grep "some part of a name"
may also be helpful.
But I've tried that and still can't find it.
Also did a
Code:
pm list packages -f
then cut and pasted the output into an editor and slowly inspected each listed item.
Here:
https://forum.xda-developers.com/showthread.php?t=710698
it says the app will be in a package called sprint_core.apk.
I did a
Code:
find . -name sprint_core.apk
and nothing.
Then tried
Code:
grep -ir "voicemail" .
from the system directory.
It got a few hits, but nothing looks right.
I'm thinking maybe the
Code:
ps
command will show me running tasks and from that I can figure it out.

MattR59 said:
I think
Code:
pm list packages -f | grep "some part of a name"
may also be helpful.
But I've tried that and still can't find it.
Also did a
Code:
pm list packages -f
then cut and pasted the output into an editor and slowly inspected each listed item.
Here:
https://forum.xda-developers.com/showthread.php?t=710698
it says the app will be in a package called sprint_core.apk.
I did a
Code:
find . -name sprint_core.apk
and nothing.
Then tried
Code:
grep -ir "voicemail" .
from the system directory.
It got a few hits, but nothing looks right.
I'm thinking maybe the
Code:
ps
command will show me running tasks and from that I can figure it out.
Click to expand...
Click to collapse
Yes, you can find it from process list.
Edit:
Also keep on mind that it can be also
https://source.android.com/devices/tech/config/voicemail
Sent from my WAS-LX1 using Tapatalk

Paget96 said:
Yes, you can find it from process list.
Edit:
Also keep on mind that it can be also
Sent from my WAS-LX1 using Tapatalk
Click to expand...
Click to collapse
FOUND IT!
It was com.coremobility.app.vnotes
How: Did a
Code:
ps
and looked for likely candidates.
vnotes looked promising. then did a
Code:
ps | grep vnotes
and noted the PID (tried to do a kill, not allowed).
On the phone I killed the process and reexecuted the ps - the PID changed.
Did other stuff on the phone, the PID did not change, killed it on the phone again, PID changed again.
Removed it with the pm command, looked for it on the phone... gone!
:laugh:

MattR59 said:
FOUND IT!
It was com.coremobility.app.vnotes
How: Did a
Code:
ps
and looked for likely candidates.
vnotes looked promising. then did a
Code:
ps | grep vnotes
and noted the PID (tried to do a kill, not allowed).
On the phone I killed the process and reexecuted the ps - the PID changed.
Did other stuff on the phone, the PID did not change, killed it on the phone again, PID changed again.
Removed it with the pm command, looked for it on the phone... gone!
[emoji23]
Click to expand...
Click to collapse
Nice, well done ^^
Sent from my WAS-LX1 using Tapatalk

Related

Snowball Mod

I ran the Snowball Mod without a hitch. I then tried to run the update but it won't run for some reason. The window flashes some text quickly but then closes so I'm not even really sure why it's not working. Anyone run into this or have any ideas. Thanks in advance!
I haven't had the time to try out the snowball mod, yet -- so I can't offer any advice. But, I would post the issue in the development thread, that's where the most help will be.
Swyped from my B&N Nook Tablet.
Try running it from a command line to keep it up and be able to read any text.
Also, there is a log.txt, if you post that, it can be more helpful.
Yeah I was goin to but I don't have enough posts. I was hoping someone would see it here.
Well... if you post your log.txt and start it from a command-line window rather than double clicking the update.bat, then we can take a look at what's up.
Log file says:
Snowball is reporting: v2.0.2
NO PACKAGE AVAILABLE
Command line:
Snowball is reporting: v2.0.2
There does not appear to be a package for the version snowball is reporting.
Are you sure you're not reapplying an update?
Perhaps you are accidentally trying to apply an "outdate"?
Thanks a lot!
There is no v2.0.2 update package in the zip folder. I renamed v2.0.1 to v2.0.2 and ran. Not sure if this was a good thing to do or not. Any help or direction would be appreciated. Thanks.
No write permissions
Tried to install snowball mod from a macbook pro by just running the snowball.sh. Started up and the B&N stuff was all there, although it looked like it ran without a hitch.
Looked at the log file in the snowball-mod folder and saw a lot of "Read-only file system" business. The first few lines being:
unzip: can't open nook-update-package.zip, nook-update-package.zip.zip, nook-update-package.zip.ZIP^M
rm failed for nook-update-package.zip, Read-only file system^M
Installing nook-update-package...
cd: can't cd to /mnt/media/nook-update-package^M
sh: Can't open install^M
rm failed for /mnt/media/nook-update-package, No such file or directory^M
Click to expand...
Click to collapse
How do you suggest I get around that?
conundrum768 said:
I haven't had the time to try out the snowball mod, yet -- so I can't offer any advice. But, I would post the issue in the development thread, that's where the most help will be.
Swyped from my B&N Nook Tablet.
Click to expand...
Click to collapse
We need 10 legit posts before we are allowed to post in the dev forum
Robotronik said:
Tried to install snowball mod from a macbook pro by just running the snowball.sh. Started up and the B&N stuff was all there, although it looked like it ran without a hitch.
Looked at the log file in the snowball-mod folder and saw a lot of "Read-only file system" business. The first few lines being:
How do you suggest I get around that?
Click to expand...
Click to collapse
Huh... this is weird... /mnt/media should not be read-only... although, I suppose, perhaps if you had it USB mounted, it might end up read-only.
Ensure that you have Automatic USB mounting turned off before you run the script.
You can actually push this update via wifi if you mod the update.bat (or update.sh for linux users) file.
Just turn on ADB Wifi (I prefer adbWireless app) and add the following to your bat file:
Code:
echo Waiting for device...
[B]adb connect XXX.XXX.XXX.XXX:XXXX[/B]
adb wait-for-device
...
adb shell "chmod 755 /data/local/tmp/update-package.sh ; su -c /data/local/tmp/update-package.sh" >> log.txt
if exist reboot adb reboot
[B]adb connect XXX.XXX.XXX.XXX:XXXX[/B]
echo INSTALLATION SUCCESSFUL
Use your IPort given to you by your ADB Wifi app in place of XXXs. Then just run the .bat!
Run from cmd if you don't want the output to vanish right away.
cfoesch said:
Ensure that you have Automatic USB mounting turned off before you run the script.
Click to expand...
Click to collapse
Okay, that got me a little further. Now:
Extracting nook-update-package...
Archive: nook-update-package.zip
creating: nook-update-package/data/
unzip: can't set permissions of directory 'nook-update-package': Operation not permitted
unzip: exiting
Installing nook-update-package...
sh: Can't open install
Click to expand...
Click to collapse
More permissions issues...
Still posting here because I don't have the 10 total posts to go in the Dev forum...
Anyway, I did the factory reinstall, and reran the snowballmod update. It said the root was still there, so I commented out that check from the snowball.sh, reran the package and everything went swimmingly.
Now, for the update:
The terminal spits out this:
Waiting for device...
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
7 KB/s (46 bytes in 0.006s)
Snowball is reporting: v2.0.2
.zipte-package-v2.0.2
There does not appear to be a package for the version snowball is reporting.
Are you sure you're not reapplying an update?
Perhaps you are accidentally trying to apply an 'outdate'?
Click to expand...
Click to collapse
Where the log file gives me:
Snowball is reporting: v2.0.2
NO PACKAGE AVAILABLE
Click to expand...
Click to collapse
The file "update-package-v2.0.2.zip" is in the directory. In the "update.sh" file replaced all instances of "${VERSION}" with "v2.0.2" and it seemed to work fine.
same
Robotronik said:
Still posting here because I don't have the 10 total posts to go in the Dev forum...
Anyway, I did the factory reinstall, and reran the snowballmod update. It said the root was still there, so I commented out that check from the snowball.sh, reran the package and everything went swimmingly.
Now, for the update:
The terminal spits out this:
Where the log file gives me:
The file "update-package-v2.0.2.zip" is in the directory. In the "update.sh" file replaced all instances of "${VERSION}" with "v2.0.2" and it seemed to work fine.
Click to expand...
Click to collapse
I AM HAVING THE SAME PROBLEM.MYBE..I need help some plz make a better howtos for dummies m
The first thing you need to do, if you have no clue what you're doing, is post the contents of the log file in the snowballmod folder.
The ".zipte-package-v2.0.2" seems to be related to adb shell "snowball-ver" returning DOS formatted text, even though you're in a *nix. I really did not expect this to happen with the linux and osx versions of adb, but apparently, they perform the same as cygwin... (cygwin I expected, after all, the adb.exe is a windows program). I will fix the update scripts to take that into account.
Code:
unzip: can't set permissions of directory 'nook-update-package': Operation not permitted
This message is reported by unzip when it is run by a non-root user on the /mnt/media partition.
You do _NOT_ have to run snowball-update though if you've installed snowball-mod fresh with the most recent version.
robtlebel said:
I AM HAVING THE SAME PROBLEM.MYBE..I need help some plz make a better howtos for dummies m
Click to expand...
Click to collapse
The changes made to the script were posted here:
Robotronik said:
Now, for the update:
The terminal spits out this:
Waiting for device...
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
7 KB/s (46 bytes in 0.006s)
Snowball is reporting: v2.0.2
.zipte-package-v2.0.2
There does not appear to be a package for the version snowball is reporting.
Are you sure you're not reapplying an update?
Perhaps you are accidentally trying to apply an 'outdate'?
Where the log file gives me:
Snowball is reporting: v2.0.2
NO PACKAGE AVAILABLE
The file "update-package-v2.0.2.zip" is in the directory. In the "update.sh" file replaced all instances of "${VERSION}" with "v2.0.2" and it seemed to work fine.
Click to expand...
Click to collapse
I had the same issue with the name of the update file being called incorrectly: ".zipte-package-v2.0.2". With that output the script is looking for a file of that name and it's not finding it. I just changed the value of the variable ${VERSION} to v2.0.2 (since that was what was being reported by Snowball as my current version) and all worked after that.
Easy to fix temporarily:
-open "update.sh" in a text editor
-go to line 66 and change
VERSION=`awk '//{ print $2 }' snowball.version`
Click to expand...
Click to collapse
to
VERSION=v2.0.2
Click to expand...
Click to collapse
or whatever version yours shows to be running (v2.0.1, etc). Something tells me it might be important to input the correct current version number in
-save and close the file and rerun it.
EDIT: or wait until cfoesch fixes the scripts
Scripts should be updated. I changed the awk program from just "//{ print $2 }" to "//{ sub('\r', '', $2); print $2 }" ... this means that it works both ways... *insert your favorite "both ways" joke here*
It should also detect if you haven't turned off automount, and warn you about it. If the nook ends up rebooting, then it would tear the USB mount and could cause file corruption. I got around it by putting things in /data rather than /mnt/media, but then realized, if it has to reboot, then it could cause trouble. So better, to just warn them that automount was on, and quit out.
It also detects better if something went wrong in the installation process, and should report that installation has failed, rather than successful under all cases.
Things may have gotten broken in the process, so keep up the bug reports.
I just can't stop Nookin' Around.........god i need to sleep
I decided to check out the update.sh script (can only go so far currently since I have the latest update).
At least for me, (Ubuntu Linux 11.10) I figured something out about the $OSTYPE call to set the $adb variable. I could echo $OSTYPE in the terminal and got a response, but could not echo it in any scripts. Ended up finding the "uname -o" call and that seems to have gotten it to work, although the printout is different.
snowball-update# echo $OSTYPE
linux-gnu
snowball-update# uname -o
GNU/Linux
Changed lines 7 & 8 and seems to have worked:
case `uname -o` in
GNU*|linux*|Linux*)
Now this last part is probably something on my end but: update.sh: 62: ./adblinux: Permission denied
Thanks again for the work (and everyone else involved in rooting/hacking these things )
Indeed. $OSTYPE seems to be specific to bash, and not all sh implementations.
If you don't mind could you do this command and give me the output? "ls -l /bin/sh" and "sh --version" Those two commands should explain exactly which implementation of sh you have. (For instance, on the NT with snowball-mod, the sh is a minimal implementation, and does not support $OSTYPE. But on most OSes I've seen sh is actually a statically linked bash, as it is the most widely used shell scripting language.)
The case on that you provided though could be a poor choice, as GNU*) would match GNU/freebsd, or GNU/openbsd, or GNU/anykernel. Sure it is unlikely, but it is possible.
The permissions issue is not entirely your end, but it is an expected artifact of extracting from a zip file. Although, is suppose performing a chmod 755 on it prior to use would be a good idea in general.

help for a script

hi all
i have an galaxy SIII
i am using script manager.
i want to write a script and i have 2 questions
- how to write a script who open an url with the web browser
- is there an function to send a ping to see if an local adress avalaible (192.168.1.X) if not avalaible is there an return error ?
(sorry to seem stupid but i am coming from windows and i am a bit lost for the moment )
thank u for giving me a your time
no suggestion ?
or advise
Google something like "android open browser from shell". You can do it using intents.
Also:
Code:
ping --help
this work in an script u put
am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://www.google.fr
for chrome i find this
am start -a android.intent.action.VIEW -n com.android.chrome/.Main -d http://xxxxxxxx
but i not find for opera if someone have it
finally
opera =
am start -a android.intent.action.VIEW -n com.opera.browser/com.opera.Opera -d http://www.google.xxxx
hope this help someone
lol now i really need help coz i found nothing
i want to know which ip is reachable from 192.168.1.(1 to 9)
in a script to automate that and give me wish is reachable for use it in a command to browser.
(i know ping from terminal emulator but it's not what i am looking for)
forgive my english i hope you understand what i want ant hope too u help me with this
kondronaute said:
i want to know which ip is reachable from 192.168.1.(1 to 9)
in a script to automate that and give me wish is reachable for use it in a command to browser...
Click to expand...
Click to collapse
That's easy, check:
Code:
for var in {1..9}
do
echo "Looking for 192.168.1.$var..." #optional... jejeje
if ping 192.168.1.$var -c 1 > /dev/null
then
#Reachable, put here your command
else
#Unreachable, you can show an error here
fi
done
RoberGalarga said:
That's easy, check:
Code:
for var in {1..9}
do
echo "Looking for 192.168.1.$var..." #optional... jejeje
if ping 192.168.1.$var -c 1 > /dev/null
then
#Reachable, put here your command
else
#Unreachable, you can show an error here
fi
done
Click to expand...
Click to collapse
but ping command is not reconized by script manager i can only do it with terminal emulator ....
Really? I didn't know that (weird, BTW). Check if you need to use another command with Script Manager, or if you need to add something.
I dunno another way to achieve your goal... only using ping
lol i have a headeach with this and find nothing
RoberGalarga said:
Really? I didn't know that (weird, BTW). Check if you need to use another command with Script Manager, or if you need to add something.
I dunno another way to achieve your goal... only using ping
Click to expand...
Click to collapse
finally i have possibility to run ping you must just in option of script manager chek "override $PATH"
after 2 or 3 aspirin this work for me
#!/system/bin/sh
for i in $(seq 2 10);
do
host="192.168.1.$i"
ping -c 1 -W 1 $host > /dev/null &&
am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://$host ;
done
i dont know why i have error with else and if with android shell ????
i thank u again for your help and hope the masters here help us a bit to understand, it's difficult coz there are differences with simple linux and this for french using windows :laugh:
Try if this help.
i have this kind of probleme http://forum.xda-developers.com/showthread.php?t=1045006
but i am usin the script manager editor on my phone !!!!!
i have not Windows EOL formatting
please if u are guru of busybox your help is needed to use if else and fi in a script.
must i download another version of busybox or add a command ????
i am fully rooted the path in script manager is good
edit = after trying and googleing
after if you must put [[your code without space before and after]] and after then (yourcode) :laugh:
hope i find the rest...
kondronaute said:
i have not Windows EOL formatting
Click to expand...
Click to collapse
Are you sure? Because if you have created the script in windows, you have that EOL formatting (whatever that means :silly. Try this:
Open Terminal Emulator, and type
Code:
echo "hello there" > /sdcard/newScript.sh
This will create a new and clean script in your SD Card.
Then, go to Script Manager, and edit that script. You can start deleting the text ("hello there") and adding this:
Code:
testvar=1
if [ "$testvar" = "1" ] ; then
echo "All is right"
fi
Ok, run the script. If you can see the text "All is right", that's it, problem solved
RoberGalarga said:
Are you sure? Because if you have created the script in windows, you have that EOL formatting (whatever that means :silly. Try this:
Open Terminal Emulator, and type
Code:
echo "hello there" > /sdcard/newScript.sh
This will create a new and clean script in your SD Card.
Then, go to Script Manager, and edit that script. You can start deleting the text ("hello there") and adding this:
Code:
testvar=1
if [ "$testvar" = "1" ] ; then
echo "All is right"
fi
Ok, run the script. If you can see the text "All is right", that's it, problem solved
Click to expand...
Click to collapse
you save my last neuron
thanks
edit =
my fault is i create a text file under windows (easier and can copy and past easily) after i put the file on my phone and copy past the code in a new script.
i not think that when i just copy past i past the EOL formatting ( i dont know what is that but its a bad thing )
that's mean i must abandon windows and migrate totally to linux
anyway that make me crazy and i am happy to sort it.
you are very helpfull many thanks again
new edit = i understand now why they say notepad++ is necessary

[VZW] HiddenMenu

In my search for a solution to disabling CABL on this phone, I wanted to take a look into all the LG hidden tests/settings. As the Verizon variant doesn't have this apk, I took it from an AT&T build, deodexed it and it seems to run fine on the VS980. I haven't been able to launch it from the dialer, but using the below will get you there. If you don't know what these tests or settings do, then you're better off leaving them alone, as there is the potential to mess something up.
Code:
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
were you able to turn off cabl from it? only thing people were saying was the high temperature screen dimming.
Sent from my VS980 4G using Tapatalk 4
I haven't looked through it all yet, but so far I haven't found anything unfortunately.
xdabbeb said:
I haven't looked through it all yet, but so far I haven't found anything unfortunately.
Click to expand...
Click to collapse
yeah i haven't ever had my phone get so hot that the thermal controls limit my screne brightness..my GS4 did all the time, though.
xdabbeb said:
In my search for a solution to disabling CABL on this phone, I wanted to take a look into all the LG hidden tests/settings. As the Verizon variant doesn't have this apk, I took it from an AT&T build, deodexed it and it seems to run fine on the VS980. I haven't been able to launch it from the dialer, but using the below will get you there. If you don't know what these tests or settings do, then you're better off leaving them alone, as there is the potential to mess something up.
Code:
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Click to expand...
Click to collapse
Thanks a lot !
I found this work on my VZW G2 ..Why VZW choose to hidden the phone test menu, so unconvenient.
I wonder if you can help me more about the APN MCC/MNC locked questions.
http://forum.xda-developers.com/showthread.php?t=2491221&highlight=apn
Thanks............
xdabbeb said:
In my search for a solution to disabling CABL on this phone, I wanted to take a look into all the LG hidden tests/settings. As the Verizon variant doesn't have this apk, I took it from an AT&T build, deodexed it and it seems to run fine on the VS980. I haven't been able to launch it from the dialer, but using the below will get you there. If you don't know what these tests or settings do, then you're better off leaving them alone, as there is the potential to mess something up.
Code:
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Click to expand...
Click to collapse
What is "CABL" and what is all in this hidden menu?? Can someone post a screen shot of it.
Thank you
cabl is content adaptive brightness... it's that flickering issue we always see.
Sent from my LG G2 using Tapatalk Pro
What is the dialer code that you need to access this hidden menu?
Can I just run the APK to install? Because I'm getting an error trying to do it that way.
Sent from my LG G2 using xda app-developers app
No, it needs to be installed as a system app. As for the dialer code, it won't work because the corresponding broadcast intent wasn't built in the vzw ROM. If I have some free time I could do that, but it really is easy to launch it via command I listed above.
I want to set up the Qualcomm usb setting. I use the QPST to connect to G2 .But it could not open the port of the G2.
Sent from my VS980 4G using xda app-developers app
error
i get error unable to resolve intent
I try, but error:
Warning: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix.
xdabbeb said:
In my search for a solution to disabling CABL on this phone, I wanted to take a look into all the LG hidden tests/settings. As the Verizon variant doesn't have this apk, I took it from an AT&T build, deodexed it and it seems to run fine on the VS980. I haven't been able to launch it from the dialer, but using the below will get you there. If you don't know what these tests or settings do, then you're better off leaving them alone, as there is the potential to mess something up.
Code:
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Click to expand...
Click to collapse
Could someone provide some detail on how this should be run? I downloaded the file and then the code above in my phone's terminal, but was told the file was not found.
mdroid60 said:
Could someone provide some detail on how this should be run? I downloaded the file and then the code above in my phone's terminal, but was told the file was not found.
Click to expand...
Click to collapse
put hiddenmenu.apk to /system/app
then set permission to еры file rw- r- r-
then reboot device
then do this using ADB
Code:
adb shell
su
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Voila
maloma99 said:
put hiddenmenu.apk to /system/app
then set permission to еры file rw- r- r-
then reboot device
then do this using ADB
Code:
adb shell
su
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Voila
Click to expand...
Click to collapse
Thanks for the response! I dont have ADB on the computer I'm on but I'll try this when I get home!
maloma99 said:
put hiddenmenu.apk to /system/app
then set permission to еры file rw- r- r-
then reboot device
then do this using ADB
Code:
adb shell
su
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Voila
Click to expand...
Click to collapse
It worked, thank you again!
maloma99 said:
put hiddenmenu.apk to /system/app
then set permission to еры file rw- r- r-
then reboot device
then do this using ADB
Code:
adb shell
su
am start -a android.intent.action.MAIN -n com.lge.hiddenmenu/com.lge.hiddenmenu.HiddenMenu
Voila
Click to expand...
Click to collapse
can I just run the "am start" line from a terminal in the phone?
markrulesallnow said:
can I just run the "am start" line from a terminal in the phone?
Click to expand...
Click to collapse
Why not? Try it. Ony first command
Code:
su
, then other.
maloma99 said:
I try, but error:
Warning: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix.
Click to expand...
Click to collapse
Same

How to create a shelf icon that executes a shell programm call?

Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
I would like to know it too. Anyone?
Sneets said:
Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
Click to expand...
Click to collapse
Run a tiny web server like lighttpd in the shell on a weird port, restrict to localhost. Set up index.php to run system (whatever);
Then bookmark the 127.0.0.1: xxxx URL
Which system call invokes power_dbus_suspend?
Thanks Parrotgeek1. Working off your excellent suggestion I installed a lightweight local server on ChromeOS (Web Server for Chrome with the 200 OK! icon) and built a small framework app that is served from local storage. I'm all set up to call chrome.app.??? from my JavaScript. Which API provides the power_dbus_suspend capability? I looked through the Power and System APIs and I don't see anything. - Thanks!
Sneets said:
Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
Click to expand...
Click to collapse
Have you tried this simple extension? Keep Awake
https://chrome.google.com/webstore/...lb?utm_source=chrome-app-launcher-info-dialog
What I do is have the shell tab pinned, and press [up arrow] for the command then hit [enter]. Probably not ideal if you use the shell a lot as you have to step through recently used commands.
Re: Pkt_Lnt's post
Thanks Pkt_Lnt. That app only deals with disabling the normal sleep behavior, not causing it, and in particular not causing it when an external monitor is connected. I'm looking for something like Sneets has requested, to invoke a powerd_dbus_suspend command that will force the system to sleep (and turn off an external monitor). Per Parrotgeek1's comment, I've got a little app now sitting on the shelf that is all set to call some system command to invoke powerd_dbus_suspend, only I'm looking for what command to call, from JavaScript.
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
This method might be overkill somewhat, but, anyway, what I did was as follows:
Installed Secure Shell extension; setup sshd on the Chromebook (by making a symlink in /etc/init/ pointing to /usr/share/chromeos-ssh-config/init/openssh-server-conf); rebooted; added public key from ConnectBot (Android app) to ~/.ssh/authorized_keys in order to test connection; setup Android homescreen shortcut to send shell command; created profile in Secure Shell app on Chromebook to connect to [email protected]/my local IP address; generated keys on Chromebook (in ~/.ssh); added generated public key to ~/.ssh/authorized_keys; imported newly-generated private/public key pair within Secure Shell app (one by one); created bookmark link to [email protected] profile in shelf, and, finally, added required command to profile in Secure Shell.
It works well! It looks like any command can be added to the 'Arguments' field in Secure Shell, with the syntax:
Code:
-- thecommand
Although I guess commands that need sudo would require a connection to [email protected], instead of chronos. (-t argument lets you use sudo, but then sending a line break/ENTER seems to be needed)
The window opened with the click does hang around - I haven't figured out if it's possible to avoid this - but it does at least seem to persistently remember the size and position to which it's set.
I posted up some further details at http://nolirium.blogspot.com/shell-command-shelf-shortcut-chromeos.html
Impressive! But a bit more than I'm looking to do
@Nolirum - I read your blogspot doc and your procedure's pretty impressive. Frankly it's a little beyond me and beyond what I'm looking for. If you ever run across a way to invoke powerd_dbus_suspend a little more directly please post here as well. You clearly have a strong grasp of the issues!
Nolirum said:
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
This method might be overkill somewhat, but, anyway, what I did was as follows:
Installed Secure Shell extension; setup sshd on the Chromebook (by making a symlink in /etc/init/ pointing to /usr/share/chromeos-ssh-config/init/openssh-server-conf); rebooted; added public key from ConnectBot (Android app) to ~/.ssh/authorized_keys in order to test connection; setup Android homescreen shortcut to send shell command; created profile in Secure Shell app on Chromebook to connect to [email protected]/my local IP address; generated keys on Chromebook (in ~/.ssh); added generated public key to ~/.ssh/authorized_keys; imported newly-generated private/public key pair within Secure Shell app (one by one); created bookmark link to [email protected] profile in shelf, and, finally, added required command to profile in Secure Shell.
It works well! It looks like any command can be added to the 'Arguments' field in Secure Shell, with the syntax:
Code:
-- thecommand
Although I guess commands that need sudo would require a connection to [email protected], instead of chronos. (-t argument lets you use sudo, but then sending a line break/ENTER seems to be needed)
The window opened with the click does hang around - I haven't figured out if it's possible to avoid this - but it does at least seem to persistently remember the size and position to which it's set.
Click to expand...
Click to collapse
This really is impressive! Thanks for the extremely detailed explanation.
I was able to follow along completely and get the SSH argument "powerd_dbus_suspend" working.
However, I got to thinking. I was wondering if this could be extended to use an alias stored in ~/.bashrc?
After doing some research of my own and using various parameters and arguments, I was unsuccessful.
The goal is to have a linux app (through crouton) be run using xiwi with just a single bookmark by utilizing an alias.
Any thoughts?
UPDATE:
Of course just a few moments later I figured this out! Rather than dealing with an alias stored in ~/.bashrc and ensuring ssh had access, typing the entire alias command as an argument worked. Now I can run Steam directly from a shelf bookmark. All it took was replacing "powerd_dbus_suspend" with "-- sudo enter-chroot xiwi steam" in the argument.
Thanks again!
DandyRandyMarsh said:
This really is impressive! Thanks for the extremely detailed explanation.
I was able to follow along completely and get the SSH argument "powerd_dbus_suspend" working.
Click to expand...
Click to collapse
No problem! I think it's perhaps overly detailed if anything. Might be easier to follow if I cut it down a bit.
DandyRandyMarsh said:
Now I can run Steam directly from a shelf bookmark. All it took was replacing "powerd_dbus_suspend" with "-- sudo enter-chroot xiwi steam" in the argument.
Click to expand...
Click to collapse
Nice!
Adding crouton single app shortcuts is a cool idea which I hadn't considered. Does it work OK for you with sudo in the command, even straight after booting up? ...You didn't have to setup sudoing without a password via sudoers.d or anything?
Inspired by your post I added xiwi to my chroot to try it out. I seem to remember experiencing quite unbearable lag and slowness when running a full desktop via xiwi in the past, but with single apps there doesn't seem to be any noticeable performance hit (this is on an armv7 Asus Flip, with the chroot on a slooow USB drive).
In order to not have to enter my sudo password, in the argument I put:
Code:
-t -- echo mypassword | sudo -S sh /media/removable/3/bin/enter-chroot xiwi firefox
Maybe I'm missing something? Is there a better way, perhaps?
Anyway, since I have rootfs verification switched off, I also tried saving a similar command to a file in /usr/bin, and putting the filename in the argument instead. This works, too, and I suppose could potentially be useful e.g. in the case of needing to run a more convoluted sequence of commands with a shortcut.
Nolirum said:
Adding crouton single app shortcuts is a cool idea which I hadn't considered. Does it work OK for you with sudo in the command, even straight after booting up? ...You didn't have to setup sudoing without a password via sudoers.d or anything?
Click to expand...
Click to collapse
I'm not entirely familiar with exactly how my process worked, but I do not have any sudo password required within shell.
Here's the list of steps I followed allowing me to use sudo commands in the SSH Arguments box.
As a side note, this is the crouton installation I am running on an ASUS c302.
sudo sh ~/Downloads/crouton -r trusty -t unity,touch,xiwi,extension
Setup Bookmarks that Run Shell Commands
1. Installed Secure Shell extension
2. Open crosh with Ctrl+Atl+T
3. Enter Command: shell
4. Enter Command: sudo su -
5. Enter Command: sudo /usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification
6. Enter Command: reboot
7. Let Chrome OS reboot
8. Open crosh with Ctrl+Atl+T
9. Enter Command: shell
10. Enter Command: sudo su -
11. Enter Command: mount –o remount rw /
12. Close current crosh window
13. Open a new crosh with Ctrl+Atl+T
14. Enter Command: shell
15. Enter Command: sudo ln -s /usr/share/chromeos-ssh-config/init/openssh-server.conf /etc/init/openssh-server.conf
16. Enter Command: sudo initctl reload-configuration
17. Enter Command: sudo initctl start openssh-server
18. Enter Command: cd ~/.ssh/
19. Enter Command: ssh-keygen
“Enter file in which…” *LEAVE BLANK*
“Enter passphrase” *LEAVE BLANK*
“Enter same passphrase” * LEAVE BLANK*​20. Enter Command: cat /home/chronos/user/.ssh/id_rsa.pub >> /home/chronos/user/.ssh/authorized_keys
21. Enter Command: cp -a /home/chronos/user/.ssh/id_rsa* /home/chronos/user/Downloads
22. Close current crosh terminal and open Secure Shell extension
23. Select [New Connection]
24. Click Import… and select “id_rsa”
25. Click Import… again and select “id_rsa.pub”
26. Enter chronos as the username and localhost as the hostname
27. Enter a shorthand name replacing the text in the top cell “[email protected]”
28. Click Enter. If prompted, enter “yes” to continue connecting
29. Bookmark the page that is open which should end in, "#profile-id:_ _ _ _"
DONE. Now time to add some commands to automate.
Open Secure Shell and select the connection created. In the arguments box, start with two dashes -- and follow it your desired shell command.
Examples:
-- sudo startunity
-- sudo startgnome
-- sudo enter-chroot xiwi steam
-- sudo enter-chroot xiwi wine microWord​
Next Steps... Getting Custom Shelf Icons
Now here I am running into some issues. Rather than have all these icons be the same, I was hoping to customize them.
Followed a strategy found on reddit, Change Shelf Icon for Website, but this only works if the site already had an "apple-touch-icon" set. Also, tried to inject the entire code myself which I couldn't get to work. Unfortunately, I think that since this bookmark is created from a Secure Shell, there are some issues.
I have already tried adding in code for this into the site, but it is having no effect. If someone could make this work then we're really looking good here.
DandyRandyMarsh said:
I'm not entirely familiar with exactly how my process worked, but I do not have any sudo password required within shell.
Click to expand...
Click to collapse
Oh, I see what you mean. You are saying that you can sudo in the shell generally, without being prompted for a password, right?
Was that the default setup on your CB (after switching to Dev mode)? Or did you have to configure it manually for passwordless sudoing...
DandyRandyMarsh said:
Here's the list of steps I followed allowing me to use sudo commands in the SSH Arguments box.
Click to expand...
Click to collapse
Nice work summarizing the steps. :highfive: It's probably easier to follow, listed out like that. One slight addendum, perhaps - at step 29, it might be good to clarify the "add to shelf" procedure. Especially because of the following...
DandyRandyMarsh said:
Next Steps... Getting Custom Shelf Icon
Now here I am running into some issues. Rather than have all these icons be the same, I was hoping to customize them.
Click to expand...
Click to collapse
Happily it turns out that, when you add shortcuts to the shelf on Chrome OS like this, a minimal app is created for each one, with its own manifest.json, and icon.pngs. Our shell shortcuts were getting created with blank pngs by default (the black box with P in the center).
So, all we need to do, is get some icons, find the right folder for our shelf shortcut apps, then copy our new icons into them!
For instance, here's how I made a nice shiny icon for my single app shelf shortcut to Firefox.
Prepared icons:
Created a temporary folder in ~/Downloads to store downloaded icons.
Prepared a set of icons in ~/Downloads/firefox. (I downloaded mine from findicons.com).
Six sizes are required - from 32px to 256. To avoid any manifest editing, saved them as *size*.png
e.g. 32.png; 48.png; 64.png; 96.png; 128.png; 256.png
Located folder to copy icons to:
It is easiest to do this directly after clicking "add to shelf"
EITHER:
To change dir into the most recently modified extension icon subfolder automatically, the following one-liner worked for me*.
Code:
shell
cd ~/Extensions/&&cd $(ls -v1td */ | head -1)/*/icons&&ls
A list of blank icons (*.png) should be visible. If so, the new icons can simply be copied over these, e.g..
Code:
sudo cp ~/Downloads/firefox/* .
*YMMV with this particular one-liner - sometimes there's an extra 'temp' folder in ~/Extensions, which stops it working as expected. If you get an error after running the command, simply use the slightly more manual method to locate the folder, as detailed below.
OR:
(slightly more manual method).
Code:
shell
ls -ltr ~/Extensions
Checked the date/times - the most recently added folder is at the bottom. Then,
Code:
cd themostrecentlyaddedfolder
(or, the folder modified at the date/time that the shortcut was "added to shelf"). Then,
Code:
cd */icons
ls
sudo cp ~/Downloads/firefox/* .
I then repeated the above with a new SSH argument and a set of Ubuntu icons, for a custom startxfce4 shortcut, too.
Then just did sudo restart ui, and enjoyed the shiny new shelf icons!
I am hopeful that these changes will get picked up by CrOS's sync, thus getting backed-up and restored automatically. At this point I am not sure if that will be the case, but I don't see why it wouldn't.
Another way?
Another way to approach this, since you're modifying system stuff anyway, might be to edit crosh at /usr/bin/crosh. It's a regular ol' dash/bash shell program, and you can create a shortcut to it on the shelf by opening crosh (ctrl-alt-T), then right click the top right of the browser and select More Tools --> Add to shelf...
Clicking the newly-created link (which looks like an "N") will launch /usr/bin/crosh in a tab. Changing the default behavior of /usr/bin/crosh could accomplish your goal to do whatever you want. With some experimenting, you might even be able to pass arguments to make it do different things depending on how it's opened (via ALT-CTRL-T vs from the shelf-- dunno if it can read the url used to call crosh), but at the very least you could do something like have it run whatever you want it to run if a second modifier key is held down (or if it isn't...), otherwise return to normal operation. A menu w/1 sec timeout could do this as well, ie--
Doing [THE THING YOU WANT] in 2 seconds (press SPACE for crosh)... /
Note there's no proof-of-concept here. Just throwing it out as an idea that I'm pretty sure would work... Someone might even create a neat extension that allows crosh to use scripts/plugins to execute different system operations beyond the stock ones that are built-in via single-clicks... If it worked, it might be a little simplier than via the SSH extension and you wouldn't have to run any extra daemons.
ft
This is probably harder, but a third way, which probably is the "right" way is to see how the crosh extension works and learn about opening the hterm.Terminal instance chrome.terminalprivate object directly, sending it output, and closing it in the same way crosh does it. There's a file in the crosh extension at js/crosh.js that shows the basics of how it's done:
var terminal = new hterm.Terminal(profileName);
And then you can do stuff with it. You could then create an extension that could handle multiple shelf-icons (say by appending ?COMMAND=ls to the URL to do different shell commands(. The security implications for this would probably be huge obviously.
Update: More on embedding hterm is here.
Nolirum said:
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
I posted up some further details at http://nolirium.blogspot.com/shell-command-shelf-shortcut-chromeos.html
Click to expand...
Click to collapse
Nice post - Some good food for thought, changing up the contents of crosh etc directly is an interesting idea.
fattire said:
Another way to approach this, since you're modifying system stuff anyway, might be to edit crosh at /usr/bin/crosh. It's a regular ol' dash/bash shell program, and you can create a shortcut to it on the shelf by opening crosh (ctrl-alt-T), then right click the top right of the browser and select More Tools --> Add to shelf...
Click to expand...
Click to collapse
Interesting! ....Aaaaand, now I've broken crosh. lol. Lucky I had my SSH shortcut setup... (actually, we can still get into the VTs with CtrlAltF2 etc anyway).
Some good potential for experimentation with this, definitely.
fattire said:
This is probably harder, but a third way, which probably is the "right" way is to see how the crosh extension works and learn about opening the hterm.Terminal instance chrome.terminalprivate object directly, sending it output, and closing it in the same way crosh does it. There's a file in the crosh extension at js/crosh.js that shows the basics of how it's done:
Click to expand...
Click to collapse
Again, very interesting. Now you come to mention it, an approach such as this does seem like it might be do-able without too much messing around (maybe)...
Any possible method we can get e.g. an extension to 'talk' to the shell is worth looking into I think; as you say, if we can cut out the middleman (ssh) and maybe do it more elegantly, that might be pretty useful indeed.

ADB usage question

Again not sure this is the best place for this question but I used the debloat guide (and linked uninstall guide) from https://www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access/ and everything is pretty much operating the way I want it to. I have kept explicit records of packages that I've uninstalled just in case, but ...
Is there a combination of switches I can use to see the modules I explicitly uninstalled using this method?
Also there are a number of packages that would normally be downloaded and installed on my Walmart tablet that I disabled and deleted prior to net access. Is there a way to differentiate these from packages installed on device startup or by the store or by side-loaded APK from the ones I disabled using the above guide?
I do have some confusion as to why the -d, -e, -s -3, etc. options seem to list only that type whereas the -u option appears to list the uninstalled packages all mixed up with with all other package types without making the distinction as to which are which.
A pointer to an ADB command manual would be helpful or even an explanation of in-command help (I tried -q -? -h)
just type help after whichever main command you want to use.
PhotonIce said:
just type help after whichever main command you want to use.
Click to expand...
Click to collapse
Ah ... "pm help" not "pm list packages help"
OK thanks that does help.
However the documentation does seem to say what I thought it did which is -u shows uninstalled packages in addition to whatever is listed with no option.
Then I have to weed out the 180 "pm list packages" from the 205 "pm list packages -u" to get the 25 actual uninstalled packages.
I was kind of hoping that there was some combination of options that will just list the 25 uninstalled packages directly.
Code:
echo $(pm list packages) $(pm list packages -u)|tr ' ' '\n'|sort|uniq -u
CXZa said:
echo $(pm list packages) $(pm list packages -u)|tr ' ' '\n'|sort|uniq -u
Click to expand...
Click to collapse
Thanks. This is exactly what I was looking for.

Categories

Resources