[Q] How do I send an email from the command line shell? - Android Q&A, Help & Troubleshooting

Hi all
I am looking for a way to send an email, preferably with an attachment, from a command line shell script (bourn/ash/whatever-it-is). No user interaction is a requirement.
It looks like an "am start" command might be able to do it via launching another app, and I've seen some examples out there, but nothing that I've had success with.
I have a big rsync backup script that I run to back up my device to my server, but I want to be able to email myself a notification if the backup fails, along with a copy of a log file. This script runs on a regular basis via a scheduler without any user interaction, but I have noticed that rsync has been failing recently and I've needed to re-run it manually later.
I am a pro Linux sysadmin but don't know jack about Java. I do bash, python, perl, and some C. My current script is just a sh shell script.
FYI my device is a Nexus One on Cyanogen 7.2. FYI I own the mail server here. I use k9mail as my primary mail app but the gmail app could be used as well.
If there was just a "mail" command, there would be no problem here...

jmomo said:
If there was just a "mail" command, there would be no problem here...
Click to expand...
Click to collapse
Not very reliable but you can use busybox telnet and SMTP commands.
http://motersho.com/blog/index.php/2009/10/12/smtp-commands-via-bash-script-and-devtcp-device-file/

psychart said:
Not very reliable but you can use busybox telnet and SMTP commands.
http://motersho.com/blog/index.php/2009/10/12/smtp-commands-via-bash-script-and-devtcp-device-file/
Click to expand...
Click to collapse
Yes, that's pretty horrible, but I will go there if I get desperate. I could also probably just port a lightweight mail command from somewhere else.
I know I can do something like this, but I can't quite get it to work...
am start -a android.intent.action.SEND -t "text/plain" --es android.intent.extra.EMAIL "[email protected]" --es android.intent.extra.TEXT "message here" --es android.intent.extra.SUBJECT "subject here" --activity-no-user-action
But I would also need to specify the exact app used (gmail or k9mail), and I am pretty sure that EMAIL data isn't going to work.

"sendmail" is a part of busybox, but for some reason it is not in CM 7.2.
It looks like it was added to the BusyBox installer on the market recently, but when I am looking at the installer, it's not there...
http://code.google.com/p/busybox-android/issues/detail?id=6
I'll see about compiling my own busybox and installing it that way. That would solve my problem.
It would still be really nice if anyone knew how to send an email using "am start" to send the intent to an existing android app. That would be really educational for me. I've seen examples for sending an SMS out there, but I am confused about sending an email... and I have no idea how I would do an attachment.

Related

[APP] GetLogs - Get dmesg, logcat, radio, etc with one click!

I know how annoying it is trying to set up ADB, open a terminal, export logs to local files, copy, paste, etc just to submit a bug report or help a developer diagnose an issue.
That is why I put together this little app to do all of that for you!
This app runs the following commands:
dmesg
logcat -v time -d
logcat -v time -b radio -d
getprop
uname -a
ps
It puts these together into a single document and uploads it to Pastebin, so you can just put a link in a forum thread or IRC or in the bug tracker.
To run these, sadly it needs root. It also requires permissions to read phone identity so that it can automatically mask your ESN/MDN/etc in the logs before it uploads them. It also requires permissions to read account information so that it can mask all of your accounts in the logcat.
EVEN WITH ALL OF THOSE THINGS BLOCKED AUTOMATICALLY PLEASE LOOK OVER YOUR LOG BEFORE GIVING OUT THE URL. IT IS A PRIVATE PASTEBIN AND IF YOU FIND SOMETHING PRIVATE YOU CAN REMOVE IT.
Usage:
Install the app on your phone.
Run the app.
Add any information that should be masked (keep in mind private phone ids and accounts will be masked automatically).
Hit PasteBin! and wait for the upload to finish.
Note the url at the bottom of the screen and give it to whoever requested your logs.
This is just a simple app to help get logs, but if you have any suggestion of how it might be better, do let me know by posting in this thread.
Known Issues:
If you add too many mask strings the app doesn't scroll so you lose the PasteBin! button and/or the resulting URL.
Google Code Project: http://code.google.com/p/getlogs/
Version History:
Version 1.2
Added filtering to "just a file" output
Limited dmesg and both logcats to only 1000 lines each to prevent OutOfMemory Exceptions.
Version 1.1
Added ability to just save the file, no upload. (/sdcard/Android/apps/com.GetLogs/data/)
App now remembers the last message, in case you forget to write down your pastebin address.
Added ps to the list of processes run.
Version 1.0
Initial Version
Upgrade Instructions:
Uninstall current version if installed.
Install new version.
good work, thanks button pushed
Ok so, update - application not installed error, yes I have unknown sources selected, just doesn't install. Any ideas?
Sent from my MSM using XDA App
VistroDistro said:
Ok so, update - application not installed error, yes I have unknown sources selected, just doesn't install. Any ideas?
Sent from my MSM using XDA App
Click to expand...
Click to collapse
Hm, I get the same thing, I've never published an android app before and I chose not to sign it, maybe I need to do that...
EDIT: Ok I signed it and it installs now, sorry about that.
worked like a charm : )
again, good work
Hi,
Is there any way for the file to be dumped on the phone instead of uploading it to pastebin. The user can then pick his way of displaying the file to the world.
This is awesome, gonna install it when I get home so I can get highlandsun some logs of radio failures that occur when I'm at my desk at work. (I never have time to get the logs from the terminal when working, and I can't ADB at work.)
New version in first post, see the Version History for the updates.
Awesome work!
Nice work rpierce99. This should help get us a flood of logs .
Awesome! Will have a try.
I'm running this but it's not giving me a url and I can't see to find the file that it's supposed to create.
Demonic240 said:
I'm running this but it's not giving me a url and I can't see to find the file that it's supposed to create.
Click to expand...
Click to collapse
If you hit the pastebin button the url gets spit out just below the button. If you want the file it is in /sdcard/Android/apps/com.GetLogs/data/
Deleted...
Demonic240 said:
I posted the data file in another thread but I don't think anyone was able to look at it. Here is the logs for my tilt2. The issue I'm running into is that wifi loses the data connection immediately when the phone goes to sleep. The wifi signal does not drop, and in fact still says I'm connected, so the only way to regain data is to turn off the wifi then back on. Would someone be able to look at these logs and help me out here?
Click to expand...
Click to collapse
Hrm...
No offense, but this really doesn't belong here. IIRC, you posted the logs in the FRX06 thread - which is good, but don't you remember me mentioning opening a bug on the tracker? Obviously if there's already a bug open, just add your comments/logs to it... if there isn't already a bug on it, open a new bug with your comments/logs .
Seriously, this has absolutely nothing to do with this thread.
arrrghhh said:
Hrm...
No offense, but this really doesn't belong here. IIRC, you posted the logs in the FRX06 thread - which is good, but don't you remember me mentioning opening a bug on the tracker? Obviously if there's already a bug open, just add your comments/logs to it... if there isn't already a bug on it, open a new bug with your comments/logs .
Seriously, this has absolutely nothing to do with this thread.
Click to expand...
Click to collapse
Ah, I'll remove it then. Sorry about that.
Better dmesg binary
In the interest of having more readable kernel logs...
Delete your current /bin/dmesg and put this one in there instead. Make sure you chmod it 755.
highlandsun said:
In the interest of having more readable kernel logs...
Delete your current /bin/dmesg and put this one in there instead. Make sure you chmod it 755.
Click to expand...
Click to collapse
At work without adb. Using terminal on Rhod.
What am I missing?
Code:
$ $ su
# mount -o remount,rw /
# rm /bin/dmesg
# cp /sdcard/dropbox/dmesg /bin
cp: write error: No space left on device
# ls -l /bin/dm*
-rwxrwxrwx 1 0 0 0 Jun 29 10:10 /bin/dmesg
It does remove dmesg, it does copy the new, but filesize=0
Your rootfs is full. You can install it in /system/bin or /system/xbin instead. There's already one in there too, which is a symlink to toolbox. You should delete the symlink first, of course.
@HYC: Oh yes, sweet. Thanks.
@rpierce99: "Just a file" gives me..... just a file ... and crashes. However, the file is good. Thanks.

[MOD] Email.apk With Exchange Security Removed

Tired of having to type in a password or PIN into your phone just because your Corporate Email account requires it? I know I am.
This modified Email.apk will allow you to bypass the password, and possibly other exchange security policies, simply because, when it evaluates the policy to see if it is active, it always returns that it is. And so, when it checks to see if your PIN is active, it simply thinks it is, and continues to go about it's business as normal.
To install do the following:
Code:
adb shell mount -o remount rw /system
adb push Email.apk /system/app/Email.apk
adb shell rm /system/app/Email.odex
adb reboot
Now with MOAR flashable zip.
YMMV, I am not responsible if you get fired for circumventing your company's Exchange Policies.
Appreciate my work? Buy Me a Beer:
Fenny said:
Tired of having to type in a password or PIN into your phone just because your Corporate Email account requires it? I know I am.
This modified Email.apk will allow you to bypass the password, and possibly other exchange security policies, simply because, when it evaluates the policy to see if it is active, it always returns that it is. And so, when it checks to see if your PIN is active, it simply thinks it is, and continues to go about it's business as normal.
To install do the following:
Code:
adb shell mount -o remount rw /system
adb push Email.apk /system/app/Email.apk
adb shell rm /system/app/Email.odex
adb reboot
Now with MOAR flashable zip.
YMMV, I am not responsible if you get fired for circumventing your company's Exchange Policies.
Click to expand...
Click to collapse
Anyone else use this? I'm interested...
My work installs a policy stating pw has to be typed in after 29mins...On Atrix I could hit the power button and it wouldn't require the me to type password until after 29 mins.
With S2, if I let the screen time out, I can awaken it and not type in password. If I hit the power button it makes me type it in.
Would love the behavior my Atrix had, I don't mind typing it in after no usage for 29 mins...but I hate that I have to type it in every time I hit the power button to turn off screen.
Does this still display all of the source formatting and header inform in verbosity that the stock email app displays in messages?
That's a really unpleasant visual experience. Thanks.
--
Sent from a mobile device, all typos are errors in transmission. Please excuse my brevity.
jank0023 said:
Anyone else use this? I'm interested...
My work installs a policy stating pw has to be typed in after 29mins...On Atrix I could hit the power button and it wouldn't require the me to type password until after 29 mins.
With S2, if I let the screen time out, I can awaken it and not type in password. If I hit the power button it makes me type it in.
Would love the behavior my Atrix had, I don't mind typing it in after no usage for 29 mins...but I hate that I have to type it in every time I hit the power button to turn off screen.
Click to expand...
Click to collapse
That behavior is in the system frameworks. This mod will allow you to, for instance use a pattern unlock where your work's exchange policies may require a numeric pin. Or no pin at all, it won't change the behavior of the system's lock/unlock timeout policies, just the exchange enforced ones.
prata said:
Does this still display all of the source formatting and header inform in verbosity that the stock email app displays in messages?
That's a really unpleasant visual experience. Thanks.
--
Sent from a mobile device, all typos are errors in transmission. Please excuse my brevity.
Click to expand...
Click to collapse
It does nothing more than remove exchange policy enforcement.
Thanks for the info.
Do you know if this email.apk supportss multi select for "Mark Read" and "Mark Unread" and "Delete" ?
SNadler said:
Do you know if this email.apk supportss multi select for "Mark Read" and "Mark Unread" and "Delete" ?
Click to expand...
Click to collapse
Fenny said:
It does nothing more than remove exchange policy enforcement.
Click to expand...
Click to collapse
Hope that answers the question!
Also, fyi , all variations of the email client support multiple delete, just choose the delete menu item when viewing your inbox or some other folder.
Thanks. This is awesome I've always hated having zero timeout.
Quick newb question..anyone know why I wouldn't be able to perform:
adb shell mount -o remount rw /system
I get error mount: Operation not permitted
I know I have root and I have debugging enabled....I'm familiar with running adb on my Atrix...for the life of me can't figure out what I may have missed.
Try doing this:
Code:
adb push Email.apk /sdcard/Email.apk
adb shell
su
//Here accept the superuser request on the phone.
mount -o remount rw /system
rm /system/app/Email.odex
cp /sdcard/Email.apk /system/app/Email.apk
chmod 644 /system/app/Email.apk
reboot
If it gives you an error on 'cp' reinstall busybox... you can download the busybox installer from the market.
Will this APK work on other phones? Thinking about giving it a try on my DInc.
Also, any idea if you have to re-add your Exchange account after replacing the APK? Or should all of my Exchange settings (username/pw etc) remain unchanged?
chrikenn said:
Will this APK work on other phones? Thinking about giving it a try on my DInc.
Also, any idea if you have to re-add your Exchange account after replacing the APK? Or should all of my Exchange settings (username/pw etc) remain unchanged?
Click to expand...
Click to collapse
this one probably will not work on your device. However, if you can get me a deodexed version of that Email.apk I can probably mod it for you.
Sweet, thanks for the offer! I'm actually in the process of switching phones, but once I actually get one that I'm gonna hang on to for awhile I might drop you a line.
What is a MOAR flashable zip (ref OP)? I googled this and still found nothing.
I flashed the zip file with my CWR and it didn't seem to change my EMAIL.APK app. I added my Exchange account and it went through the same wizard with password and both USB and SD card file encryption requirement. I was not sure what file encryption they were going to use, so I removed the account from "Accounts and sync" before rebooting. But still when I rebooted, it prompted for the password, but so far has not encrypted any of my data. I then removed the password and was back to normal with no Exchange email. Any thoughts?
Try http://forum.xda-developers.com/showthread.php?t=775007 -- I can't speak for the SGS II, but works fine on SGS4G under Froyo
tone_la said:
What is a MOAR flashable zip (ref OP)? I googled this and still found nothing.
Click to expand...
Click to collapse
It's a comical corruption of the word "more," meaning that the zip is now flashable. Imagine a cat saying it.
Could someone please confirm if this has worked on AT&T Samsung galaxy s2 that is rooted but still on Stock ROM?
Basically I would like to get rid of password (PIN, alphanumeric) requirement for Microsoft exchange email setup on my phone, would like to use "Draw pattern Unlock" , simple and good lock mechanism.
My problem is I got used to iphone's 4 digit unlock pin and this password screen does not show boxy fields and in iphone once you type in 4 digits it automatically opens up, you don't need to specifically press "OK" button as in S2.
rav4kar said:
Could someone please confirm if this has worked on AT&T Samsung galaxy s2 that is rooted but still on Stock ROM?
Basically I would like to get rid of password (PIN, alphanumeric) requirement for Microsoft exchange email setup on my phone, would like to use "Draw pattern Unlock" , simple and good lock mechanism.
My problem is I got used to iphone's 4 digit unlock pin and this password screen does not show boxy fields and in iphone once you type in 4 digits it automatically opens up, you don't need to specifically press "OK" button as in S2.
Click to expand...
Click to collapse
Yeah, it works perfectly on rooted stock, enjoy!
Massael said:
Yeah, it works perfectly on rooted stock, enjoy!
Click to expand...
Click to collapse
Thanks much for confirming this..
Okay folks, I applied this and worked fine but got panicked!
For those who try this be advised from my experience...once you follow the steps as given in the original post, it may remove the Email icon (shortcut) on the home screen and all email setup, so do not get panicked please make sure you save important details such as Exchange server name, etc. beforehand that you can reconfigure later.
Thanks!

[Q] Secure Box Password Reset/Retrieval

Hi there,
I have an HTC Evo 3d, running LeeDroid's ROM from very early days. To be honest, never really messed about with it much, but had noticed it added a 'Secure' box to SMS.
Now, i don't 'think' i ever set a password for this, however it keeps asking for one, and i cannot access my secure messages. So, i was wondering if anyone knows if there is a way i can reset this password, or somehow backup the messages so they are not lost, then maybe reinstall something, and start from scratch, but WITHOUT losing the messages within?
I have had a look on both this site, and Google, however so far have been unable to find the correct answer, as not sure i'm even asking the right questions, lol!
Hopefully someone can point me in the right direction!
Thanks.
R0N4LD said:
Hi there,
I have an HTC Evo 3d, running LeeDroid's ROM from very early days. To be honest, never really messed about with it much, but had noticed it added a 'Secure' box to SMS.
Now, i don't 'think' i ever set a password for this, however it keeps asking for one, and i cannot access my secure messages. So, i was wondering if anyone knows if there is a way i can reset this password, or somehow backup the messages so they are not lost, then maybe reinstall something, and start from scratch, but WITHOUT losing the messages within?
I have had a look on both this site, and Google, however so far have been unable to find the correct answer, as not sure i'm even asking the right questions, lol!
Hopefully someone can point me in the right direction!
Thanks.
Click to expand...
Click to collapse
Have you tried your carrier password? Like on Sprint usually my default password is 1) the last 4 of my phone number (most likely) or 2) my voicemail password. Start with one of those.
Hello there, I know that this an old thread but just in case anyone is still interested in this I found out some information(the hard way). First of, if you aren't rooted then there is little than you can do apart from cry and try to guess the password. Trust me, I've tried alternatives and even though both the password and secure box messages are stored in plain text, the directories they are in are inaccessible without root access. Unfortunately rooting your device deletes all messages and there is NO way to backup the secure box messages. If you do have root access then carry on reading.
I'm yet to find out where the secure box messages database is but the password is stored on plain text in this file "/data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml" either read it or delete the file to reassert the password. Deleting the file will not affect the secure box messages in anyway.
Stefan3 said:
Hello there, I know that this an old thread but just in case anyone is still interested in this I found out some information(the hard way). First of, if you aren't rooted then there is little than you can do apart from cry and try to guess the password. Trust me, I've tried alternatives and even though both the password and secure box messages are stored in plain text, the directories they are in are inaccessible without root access. Unfortunately rooting your device deletes all messages and there is NO way to backup the secure box messages. If you do have root access then carry on reading.
I'm yet to find out where the secure box messages database is but the password is stored on plain text in this file "/data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml" either read it or delete the file to reassert the password. Deleting the file will not affect the secure box messages in anyway.
Click to expand...
Click to collapse
Thank you very much for your assistance. Can you explain I. Detail how to get to that file? I put that link in the search bar (internal storage) and it won't pull anything up. I'm not super savy when it comes to stuff like this. Do you mind helping me out?
Stefan3 said:
Hello there, I know that this an old thread but just in case anyone is still interested in this I found out some information(the hard way). First of, if you aren't rooted then there is little than you can do apart from cry and try to guess the password. Trust me, I've tried alternatives and even though both the password and secure box messages are stored in plain text, the directories they are in are inaccessible without root access. Unfortunately rooting your device deletes all messages and there is NO way to backup the secure box messages. If you do have root access then carry on reading.
I'm yet to find out where the secure box messages database is but the password is stored on plain text in this file "/data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml" either read it or delete the file to reassert the password. Deleting the file will not affect the secure box messages in anyway.
Click to expand...
Click to collapse
thanks a bunch!!!
If you haven't rooted your device and don't remember setting the password for the secure box, you can try the same password you have for your HTC account. It worked for me, thankfully.
Stefan3 said:
Hello there, I know that this an old thread but just in case anyone is still interested in this I found out some information(the hard way). First of, if you aren't rooted then there is little than you can do apart from cry and try to guess the password. Trust me, I've tried alternatives and even though both the password and secure box messages are stored in plain text, the directories they are in are inaccessible without root access. Unfortunately rooting your device deletes all messages and there is NO way to backup the secure box messages. If you do have root access then carry on reading.
I'm yet to find out where the secure box messages database is but the password is stored on plain text in this file "/data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml" either read it or delete the file to reassert the password. Deleting the file will not affect the secure box messages in anyway.
Click to expand...
Click to collapse
Thanks it worked for me 100%
Stefan3 said:
Hello there, I know that this an old thread but just in case anyone is still interested in this I found out some information(the hard way). First of, if you aren't rooted then there is little than you can do apart from cry and try to guess the password. Trust me, I've tried alternatives and even though both the password and secure box messages are stored in plain text, the directories they are in are inaccessible without root access. Unfortunately rooting your device deletes all messages and there is NO way to backup the secure box messages. If you do have root access then carry on reading.
I'm yet to find out where the secure box messages database is but the password is stored on plain text in this file "/data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml" either read it or delete the file to reassert the password. Deleting the file will not affect the secure box messages in anyway.
Click to expand...
Click to collapse
Thank you so much for the password file location. I was able to recover the secure box password for a Desire 500 using this info without having root.
Here's what I did:
* Backup com.android.mms
Code:
adb backup -f backup.ab com.android.mms
* Extract the resulting backup.ab to backup.tar using Android Backup Extractor (can't post link, so search GitHub for it - author nelenkov)
Code:
java -jar abe.jar unpack backup.ab backup.tar
one could also use dd if available
Code:
dd if=backup.ab bs=1 skip=24|openssl zlib -d > backup.tar
* Find com.android.mms.categoryInfo.xml in apps/com.android.mms/sp directory of extracted .tar
help
positivew said:
Thank you so much for the password file location. I was able to recover the secure box password for a Desire 500 using this info without having root.
Here's what I did:
* Backup com.android.mms
Code:
adb backup -f backup.ab com.android.mms
* Extract the resulting backup.ab to backup.tar using Android Backup Extractor (can't post link, so search GitHub for it - author nelenkov)
Code:
java -jar abe.jar unpack backup.ab backup.tar
one could also use dd if available
Code:
dd if=backup.ab bs=1 skip=24|openssl zlib -d > backup.tar
* Find com.android.mms.categoryInfo.xml in apps/com.android.mms/sp directory of extracted .tar
Click to expand...
Click to collapse
hey, i am new in these stuffs, can you please provide a better tutorial of what you did and how you did, i am also not having root and also i am not having the secure box password.
Hello!
positivew said:
Thank you so much for the password file location. I was able to recover the secure box password for a Desire 500 using this info without having root.
Here's what I did:
* Backup com.android.mms
Code:
adb backup -f backup.ab com.android.mms
* Extract the resulting backup.ab to backup.tar using Android Backup Extractor (can't post link, so search GitHub for it - author nelenkov)
Code:
java -jar abe.jar unpack backup.ab backup.tar
one could also use dd if available
Code:
dd if=backup.ab bs=1 skip=24|openssl zlib -d > backup.tar
* Find com.android.mms.categoryInfo.xml in apps/com.android.mms/sp directory of extracted .tar
Click to expand...
Click to collapse
positivew, thanks for your contribution! I got really excited when you mentioned there is a way to access the information without being rooted, but I am encountering some trouble when trying to backup com.android.mms through adb. Initially the process seems to be working fine, but the resulting backup only appears as a 1kb file. When I subsequently unpack to tar, the file shows no information. Certain posts online indicate that this might be due to com.android.mms being a system file and thus inaccessible unless you are rooted. Could you please detail the process you used a little further, I would be very grateful!
for HTC users - solution is a bit differrent
briggsjoshua said:
positivew, thanks for your contribution! I got really excited when you mentioned there is a way to access the information without being rooted, but I am encountering some trouble when trying to backup com.android.mms through adb. Initially the process seems to be working fine, but the resulting backup only appears as a 1kb file. When I subsequently unpack to tar, the file shows no information. Certain posts online indicate that this might be due to com.android.mms being a system file and thus inaccessible unless you are rooted. Could you please detail the process you used a little further, I would be very grateful!
Click to expand...
Click to collapse
If you've got same issue as I do, then first you need to figure out the exact name of your messaging app. To do this, one could install "App extractor" from the market, and extract the Messaging application. File name .apk will be the package name, which for HTC Sense goes like this:
Code:
com.htc.sense.mms
and NOT
Code:
com.android.mms
Then, do the backup as suggested above, using
Code:
adb backup -f somenameofyourbackup.ab com.htc.sense.mms
You should get .ab file of around 8 to 12kb, depends on your message file.
Than just use whatever method for extraction you prefer (I used dd on ubuntu, but not the openssl version, rather python one)
Code:
dd if=yourbackupfile.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf
make sure to set correct path to yourbackupfile.ab (or place it in the home directory)
Then you should get folder app/com.htc.sense.mms/sp/ and here the file com.htc.sense.mms.categoryInfo.xml where the password is stored in plaintext.
Voila
Worked Like A Charm!
Many thanks. Recovered my password on my HTC One (M7)
Please help, I cant find the ./data/data only ./data - I use x-plore file manager

Difficulty granting permission with adb / terminal

Per this issue, and specifically this comment, I'm trying to grant the BATTERY_STATS permission to GSam Battery Monitor. I've tried the adb command "pm grant com.gsamlabs.bbm android.permission.BATTERY_STATS" but can't get it to work. I've also tried "pm grant com.gsamlabs.bbm android.Manifest.permission.BATTERY_STATS" but the results are the same. Doing it through ConnectBot gives me the following error:
Operation not allowed: java.lang.SecurityException: grantRuntimePermission: Neither user 10338 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
Doing it through adb gives me this:
Bad argument: java.lang.IllegalArgumentException: Unknown package: com.gsamlabs.bbm
This is on a stock Moto Z Play, 7.1.1
kernel:
3.18.31-perf-g757c8d9
[email protected] #1
Build number NPN26.118-22
Are you running the pro version? Then it needs to be com.gsamlabs.bbm.pro
The error is because it can't find a package named com.gsamlabs.bbm, so I would investigate why that's occurring. Either there's a typo (I don't see one) or that's not the correct package name.
ConnectBot won't work because ConnectBot doesn't have superuser permissions. Unless your device is rooted it'll have to be done through adb or using a PC-side program which effectively does the same thing.
Thanks! I think that was it, as adding .pro to the end didn't give an error. But it didn't actually say it was successful, either. It just spit out all the adb usage info like if you just type "adb" with no parameters. Any idea how I know if it worked?
vertigo_2_20 said:
Thanks! I think that was it, as adding .pro to the end didn't give an error. But it didn't actually say it was successful, either. It just spit out all the adb usage info like if you just type "adb" with no parameters. Any idea how I know if it worked?
Click to expand...
Click to collapse
Do the advanced stats in BBM work now? Also, are you on the paid version of BBM? That's the pro version, iirc.
You are typing "adb -d shell pm grant com.gsamlabs.bbm.pro android.permission.BATTERY_STATS", right?
Got busy with other stuff and just now got back to this, but I got it working. The reason I got the output I did before was because I was typing an invalid command, since pm grant isn't one of the commands of adb.exe. I had to type adb shell THEN type the command, and then it worked (and I just noticed you said that, I must have overlooked that when I looked at it before since I was busy). Also, for anyone that might come across this trying to do this, GSam didn't automatically recognize that this was done. I had to go through the steps of having it show me how to do it and at the end of that it worked. One final note, I had to update to the latest SDK for it to work, the version I was using was too old. Thanks again for the help apraetor!
Yea, I had a feeling after re-reading your original post that you were missing the "adb -d shell" portion, glad it's working.
vertigo_2_20 said:
Got busy with other stuff and just now got back to this, but I got it working. The reason I got the output I did before was because I was typing an invalid command, since pm grant isn't one of the commands of adb.exe. I had to type adb shell THEN type the command, and then it worked (and I just noticed you said that, I must have overlooked that when I looked at it before since I was busy). Also, for anyone that might come across this trying to do this, GSam didn't automatically recognize that this was done. I had to go through the steps of having it show me how to do it and at the end of that it worked. One final note, I had to update to the latest SDK for it to work, the version I was using was too old. Thanks again for the help apraetor!
Click to expand...
Click to collapse

FydeOS with full Google sync and without using a FydeOs account

FydeOs is a good chromium fork and it supports android, but it lacks a full google sync and that’s not so good, since sync across multiple devices is the best thing ever and that’s where Google services do play their best. At least I think so.
Moreover, FydeOs by default sends the user’s data to their servers. They do such thing in an open way, through a FydeOs account, so they shouldn’t be blamed, but we are free to use the Os which is in our device without sharing our data with FydeOs so as some don’t like sharing their data with Google.
So, I have found a quite easy way to remove those limitations. The purpose is to use FydeOs without a FydeOs account, without sharing our data (passwords and so on) with them, while retaining a fully functional play store and a full google sync.
This is a simple how-to written in a few spare time. If I get more time, I will make it less rough.
First of all, press CTRL + ALT + T
then use this commands
shell
sudo su
and you’ll have got to insert the password chronos
then go on and mount the system to read and write
sudo mount -o remount,rw /
then remove a couple of files
cd /etc/chromium/policies/managed
sudo rm *.*
Then edit the conf file
cd /etc
sudo vim chrome_dev.conf
(disclaimer: please google for vim commands, it’s preinstalled in chrome os)
comment the lines referring to FydeOs account like that and add a line referring to google account (maybe useless)
#--fydeos-account-enabled
#--fydemina
--google-account-enabled
Close the tab and open a chromium tab in incognito mode, then type
chrome://flags
Look for the flag Support secondary accounts for Sync standalone transport
and switch it on.
Then reboot and you’ll be able to add a secondary account, then you'll be prompted to insert your google account.
Follow the usual steps to configure the device and your apps and settings will be restored (if you already have got another chromebook). The file manager now will show your google drive folder
To install the play store you have got to edit chrome_dev.conf, by uncommenting the lines which you had previously commented, and reboot...
Then you can use the app provided by FydeOs to install the Play store. This step will remove the google sync and you won’t see google drive inside the file manager.
Now you can comment those lines again and reboot and everything will be fine i.e. google sync will be back.
After rebooting, you can go to chromium extensions and remove the FydeOs extension (the one which sends your data to their servers) and you can go to the shelf and remove the installer with the chinese name, by simply clicking it.
Now you can use the secondary account, which is fully working and syncing to google servers (only) and forget about the other one (i.e. the FydeOs one).
I tested these steps once only and maybe not all of them were required, but my device has been working fine for 3 days straight without any issue.
lucaoldb said:
FydeOs is a good chromium fork and it supports android, but it lacks a full google sync and that’s not so good, since sync across multiple devices is the best thing ever and that’s where Google services do play their best. At least I think so.
Moreover, FydeOs by default sends the user’s data to their servers. They do such thing in an open way, through a FydeOs account, so they shouldn’t be blamed, but we are free to use the Os which is in our device without sharing our data with FydeOs so as some don’t like sharing their data with Google.
So, I have found a quite easy way to remove those limitations. The purpose is to use FydeOs without a FydeOs account, without sharing our data (passwords and so on) with them, while retaining a fully functional play store and a full google sync.
This is a simple how-to written in a few spare time. If I get more time, I will make it less rough.
First of all, press CTRL + ALT + T
then use this commands
shell
sudo su
and you’ll have got to insert the password chronos
then go on and mount the system to read and write
sudo mount -o remount,rw /
then remove a couple of files
cd /etc/chromium/policies/managed
sudo rm *.*
Then edit the conf file
cd /etc
sudo vim chrome_dev.conf
(disclaimer: please google for vim commands, it’s preinstalled in chrome os)
comment the lines referring to FydeOs account like that and add a line referring to google account (maybe useless)
#--fydeos-account-enabled
#--fydemina
--google-account-enabled
Close the tab and open a chromium tab in incognito mode, then type
chrome://flags
Look for the flag Support secondary accounts for Sync standalone transport
and switch it on.
Then reboot and you’ll be prompted to insert your google account.
Follow the usual steps to configure the device and your apps and settings will be restored (if you already have got another chromebook). The file manager now will show your google drive folder
Click to expand...
Click to collapse
Thanks for the walkthrough! Thankfully I'm familiar with VIM so your instructions were easy peasy.
I did up until here on my flash drive with my main laptop but since it's AMD and won't run Android apps or Linux, I switched to my Intel. First boot let me log into Google right away and appeared to have Android enabled but kept erroring when trying to connect so I proceeded with the steps to progress and was successful. I don't even have a fydeos account on here at all!
I assume you could follow these steps the way I did to get it on a he's without having the fydeos account as well (this was all on a flash drive)
coolloser said:
Thanks for the walkthrough! Thankfully I'm familiar with VIM so your instructions were easy peasy.
I did up until here on my flash drive with my main laptop but since it's AMD and won't run Android apps or Linux, I switched to my Intel. First boot let me log into Google right away and appeared to have Android enabled but kept erroring when trying to connect so I proceeded with the steps to progress and was successful. I don't even have a fydeos account on here at all!
I assume you could follow these steps the way I did to get it on a he's without having the fydeos account as well (this was all on a flash drive)
Click to expand...
Click to collapse
Yes, I had just reported the way I had gone, but I was quite sure that some steps were redundant
lucaoldb said:
Yes, I had just reported the way I had gone, but I was quite sure that some steps were redundant
Click to expand...
Click to collapse
I'm just glad you were successful, I knew there had to be a way to do it!
I'll try installing it onto the hard drive maybe tonight, it'll be a triple boot setup with win 7 and 10 though so I may try and find a different old computer to try instead to save the head ache...
I have fyde os on USB working but my issue is full install on my laptop is using EMMC storage and when installing it aborts at the end. What are the commands to install on EMMC drive? Thanks again.
primod808 said:
I have fyde os on USB working but my issue is full install on my laptop is using EMMC storage and when installing it aborts at the end. What are the commands to install on EMMC drive? Thanks again.
Click to expand...
Click to collapse
I just followed these instructions https://neverware.zendesk.com/hc/en-us/articles/213131287-Manual-Installation-Via-the-Cmd-Line
Hello. Thank you very much for these instructions.
But i got stuck at this point
"After rebooting, you can go to chromium extensions and remove the FydeOs extension (the one which sends your data to their servers) and you can go to the shelf and remove the installer with the chinese name, by simply clicking it."
I can't delete these apps because they seem to be installed with enterprise policies. Can someone help please?:silly:
Ah... I did a powerwash and logged in with my Google account. I could then delete the fydeos extensions
Ok feeling stupid I did his before but now I'm having trouble putting the commands. Stuck after incognito enabled secondary account sync flag then it ask to reboot browser. Not the computer reboot but chrome browser reboot but it doesn't prompt me to login to my Google account. Went back to she'll mount remount to try again but get this. After cd etc/chromium/policies/managed hit enter add sudo rm *.* It say cannot remove no such file found. When i did it the first time I can get to the vim part I commented last 2 lines and added the Google enabled line then i :wq to save and quit. Do suppose save and quit right or does it save automatically?
primod808 said:
Ok feeling stupid I did his before but now I'm having trouble putting the commands. Stuck after incognito enabled secondary account sync flag then it ask to reboot browser. Not the computer reboot but chrome browser reboot but it doesn't prompt me to login to my Google account. Went back to she'll mount remount to try again but get this. After cd etc/chromium/policies/managed hit enter add sudo rm *.* It say cannot remove no such file found. When i did it the first time I can get to the vim part I commented last 2 lines and added the Google enabled line then i :wq to save and quit. Do suppose save and quit right or does it save automatically?
Click to expand...
Click to collapse
The file is removed which is why it can't find it. wq saves and quits the editor so that's ready. Try a full reboot and see if adding a new account goes through Google now instead of fyde servers.
coolloser said:
The file is removed which is why it can't find it. wq saves and quits the editor so that's ready. Try a full reboot and see if adding a new account goes through Google now instead of fyde servers.
Click to expand...
Click to collapse
Thanks I tried but still didn't work.
primod808 said:
Thanks I tried but still didn't work.
Click to expand...
Click to collapse
Open up the chrome_dev.conf and see if your changes are there perhaps?
coolloser said:
Open up the chrome_dev.conf and see if your changes are there perhaps?
Click to expand...
Click to collapse
I checked it's like it never saved the first time i don't see google-account-enabled I always have to keep adding the line.
[
primod808 said:
I checked it's like it never saved the first time i don't see google-account-enabled I always have to keep adding the line.
Click to expand...
Click to collapse
you'll have to mount the drive as read and write again then apply changes.
shell
sudo su (enter your pw)
sudo mount -o remount,rw /
Then edit the conf file
cd /etc
sudo vim chrome_dev.conf
coolloser said:
[
you'll have to mount the drive as read and write again then apply changes.
shell
sudo su (enter your pw)
sudo mount -o remount,rw /
Then edit the conf file
cd /etc
sudo vim chrome_dev.conf
Click to expand...
Click to collapse
Strange I always do that but it never keeps my changes every time I check to see if my changes applied it never saves it. In the instructions op it didn't say to save I use :wq close tab and go to chrome://flags enabled secondary account let it reboot also did full system reboot and still doesn't prompt me for my Google account. Check again in vim and I always see that my changes never is saved.
primod808 said:
Strange I always do that but it never keeps my changes every time I check to see if my changes applied it never saves it. In the instructions op it didn't say to save I use :wq close tab and go to chrome://flags enabled secondary account let it reboot also did full system reboot and still doesn't prompt me for my Google account. Check again in vim and I always see that my changes never is saved.
Click to expand...
Click to collapse
It is weird!
Try saving the file with :w before quitting with :q to see if there are errors shown
coolloser said:
It is weird!
Try saving the file with :w before quitting with :q to see if there are errors shown
Click to expand...
Click to collapse
Damn have to head in to work I'll give a try when I get home. Thanks for the help and advise and will report my findings.
primod808 said:
Damn have to head in to work I'll give a try when I get home. Thanks for the help and advise and will report my findings.
Click to expand...
Click to collapse
Have fun at work! Hope it works out for you in the end, sorry if I haven't helped
What is chrome.dev.conf.swp I see this after entering vim command. Do I suppose to delete this ?
primod808 said:
What is chrome.dev.conf.swp I see this after entering vim command. Do I suppose to delete this ?
Click to expand...
Click to collapse
It's like a temp copy of the configuration file, you shouldn't need to delete it but it won't hurt if you do.

Categories

Resources