GSam battery monitor/BBS on MIUI devices - Xiaomi Mi 8 Questions & Answers

Hello guys.
I can't get the two apps in the title to work. GSam doesn't even load once opened (all set to 0:00:00 and on "loading"), and both of them reject the command from adb for advanced stats, telling me "operation not allowed [...] neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS."
Do you know what's going on?

Answer on your question. Give all permissions to bbs from security app.

xdamami said:
Answer on your question. Give all permissions to bbs from security app.
Click to expand...
Click to collapse
Still no luck, I went to security app, manage application, BBS and activated all it needs, so permissions to phone, storage, start in background, lockscreen and home screen.
What am I still missing? From my PC I can't use the adb command..

Up
Anyone?

"operation not allowed [...] neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS."
Be sure you enabled TWO settings in Developer Options :
USB Debugging
USB Debugging (Security Settings)
Good luck!

virgil31 said:
"operation not allowed [...] neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS."
Be sure you enabled TWO settings in Developer Options :
USB Debugging
USB Debugging (Security Settings)
Good luck!
Click to expand...
Click to collapse
Thanks, found that two days ago! Now it's fine

virgil31 said:
"operation not allowed [...] neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS."
Be sure you enabled TWO settings in Developer Options :
USB Debugging
USB Debugging (Security Settings)
Good luck!
Click to expand...
Click to collapse
Thanks man. It was giving me issues on Android Pie

Related

[Q] No USB Debugging

No USB Debugging option
From what I have read it should be located under Development but the only options I see are:
Android Debugging
ADB over Network
Debugging Notify
Stay Awake
Allow Mock Locations
Stop App Via Long Press
Device Hostname
can someone please point me in the right direction, thanks
kind regards
tabutcher said:
No USB Debugging option
From what I have read it should be located under Development but the only options I see are:
Android Debugging
ADB over Network
Debugging Notify
Stay Awake
Allow Mock Locations
Stop App Via Long Press
Device Hostname
can someone please point me in the right direction, thanks
kind regards
Click to expand...
Click to collapse
In gingerbread it is called USB debugging, in ICS it's Android Debugging. Just the words changed but same purpose

Need help trying to unlock bootloader on HTC One

So last night I tried unlocking my bootloader so I could root my HTC One, but I've had one issue. Whenever I get to the part where you make the back up of my apps I get the following message "adb: unable to connect for backup". My phone is conncected, and I have USB debugging enabled. I also checked the device status and it keeps reporting it as offline. I don't quite know what to do, if anyone can help it'll be appreciated.
First off, I barely know anything with regards to phones as I still learning. However, last night had a similar issue and ended up having to use cmd prompt to navigate to adb and then used it to see the device.
MrTechie890 said:
So last night I tried unlocking my bootloader so I could root my HTC One, but I've had one issue. Whenever I get to the part where you make the back up of my apps I get the following message "adb: unable to connect for backup". My phone is conncected, and I have USB debugging enabled. I also checked the device status and it keeps reporting it as offline. I don't quite know what to do, if anyone can help it'll be appreciated.
Click to expand...
Click to collapse
New security enhancements in android 4.2.2 builds (and above) require the end user to explicitly grant adb access to any connecting computers before that connecting machine can successfully issue any adb commands to your device. When you connect a 4.2.2 (and above) android device to your machine (with USB debugging enabled) for the first time, you should be prompted with a confirmation message to allow or disallow USB debugging. This message will display your computers unique RSA key fingerprint and provide you a checkbox to “Always allow from this computer”. Check this box and select ‘OK’. Your device should no longer be listed as ‘offline’
If you don’t see this prompt then you should try the following:
With your device connected via usb and the toolkit running, toggle USB debugging off/on in Settings > ‘Developer Options’ and see if the prompt comes up
Also try unplugging and re-plugging the usb connection.
BD619 said:
New security enhancements in android 4.2.2 builds (and above) require the end user to explicitly grant adb access to any connecting computers before that connecting machine can successfully issue any adb commands to your device. When you connect a 4.2.2 (and above) android device to your machine (with USB debugging enabled) for the first time, you should be prompted with a confirmation message to allow or disallow USB debugging. This message will display your computers unique RSA key fingerprint and provide you a checkbox to “Always allow from this computer”. Check this box and select ‘OK’. Your device should no longer be listed as ‘offline’
If you don’t see this prompt then you should try the following:
With your device connected via usb and the toolkit running, toggle USB debugging off/on in Settings > ‘Developer Options’ and see if the prompt comes up
Also try unplugging and re-plugging the usb connection.
Click to expand...
Click to collapse
I've already done this. I had usb debugging enable since I started this. I even tried unplugging and replugging multiple times while trying to do this. Are there any other settings I need to enable?
MrTechie890 said:
I've already done this. I had usb debugging enable since I started this. I even tried unplugging and replugging multiple times while trying to do this. Are there any other settings I need to enable?
Click to expand...
Click to collapse
You have to help us with a little more info -- ADB and Fastboot just *have* to work or you'll get nowhere:
1) What OS are you using? Version included;
2) Plug in your phone, open a command window in the appropriate place and type: adb devices
Tell us the output.
If you don't get a device listed, either your drivers are bogus on your machine and need to reload, or you're not getting USB debugging setup correctly (not sure how you miss that, so I'd think the former).
tdhite said:
You have to help us with a little more info -- ADB and Fastboot just *have* to work or you'll get nowhere:
1) What OS are you using? Version included;
2) Plug in your phone, open a command window in the appropriate place and type: adb devices
Tell us the output.
If you don't get a device listed, either your drivers are bogus on your machine and need to reload, or you're not getting USB debugging setup correctly (not sure how you miss that, so I'd think the former).
Click to expand...
Click to collapse
The version of android I'm using is 4.3, for my computer I'm using OSX 10.9, and the code that is listed when I search for my device through adb is FA3A8S902431.
MrTechie890 said:
The version of android I'm using is 4.3, for my computer I'm using OSX 10.9, and the code that is listed when I search for my device through adb is FA3A8S902431.
Click to expand...
Click to collapse
Then try this:
adb backup
That should create a backup file called: backup.ab
tdhite said:
Then try this:
adb backup
That should create a backup file called: backup.ab
Click to expand...
Click to collapse
Still get the same issue I've been getting. I typed that command in, it just tells me all the options for adb, and I then retried the other command I was using and squat.
MrTechie890 said:
Still get the same issue I've been getting. I typed that command in, it just tells me all the options for adb, and I then retried the other command I was using and squat.
Click to expand...
Click to collapse
I know you don't want to read this, but you'll need to read all about Macs and this issue. A quick Google on "adb unable to connect for backup mac" brings up all sorts of folks fighting exactly what you are. I don't have a Mac -- use Linux almost exclusively, but it all appears related to either usb debugging, or a connection timeout setting.
tdhite said:
I know you don't want to read this, but you'll need to read all about Macs and this issue. A quick Google on "adb unable to connect for backup mac" brings up all sorts of folks fighting exactly what you are. I don't have a Mac -- use Linux almost exclusively, but it all appears related to either usb debugging, or a connection timeout setting.
Click to expand...
Click to collapse
For me, doing it on Linux wouldn't be a huge issue but since I have a mac as my primary machine I'm trying to make due with it.
I think I just firgured it out actually. I just had to install the android sdk, I was using the abd files provided from a tutorial. anyhow, thanks for trying to help tdhite.

adb device not found

the device is not found however I installed the drivers and I am using windows 7 I tried it with another computer and it didn't work
and it works with the recovery I want it to work to gain s-off
RedBlackPellet said:
the device is not found however I installed the drivers and I am using windows 7 I tried it with another computer and it didn't work
and it works with the recovery I want it to work to gain s-off
Click to expand...
Click to collapse
check FAQ#2: http://forum.xda-developers.com/showpost.php?p=52135024&postcount=2
nkk71 said:
check FAQ#2: http://forum.xda-developers.com/showpost.php?p=52135024&postcount=2
Click to expand...
Click to collapse
I tried with different devices laptops and mobiles and I always get device not found and different adb sdks
RedBlackPellet said:
I tried with different devices laptops and mobiles and I always get device not found and different adb sdks
Click to expand...
Click to collapse
if your booted into a rom, do you have usb debugging enabled ?
its in system, developer options, if you cant see developer options then goto about - software information - more - and tap build number 7 times, it will count down and eventually say you are now a developer, you should now see developer options in your system menu.
when you enable usb debugging and plug your phone into the computer.....eventually.....and sometimes it takes a while, you will get a pop up on your phone saying your computer wants to connect to this device, allow or deny, I suggest you allow.
if you don't get the message, then with the phone still plugged into the computer, open developer options again and disable usb debugging, then enable it again.
Seanie280672 said:
if your booted into a rom, do you have usb debugging enabled ?
its in system, developer options, if you cant see developer options then goto about - software information - more - and tap build number 7 times, it will count down and eventually say you are now a developer, you should now see developer options in your system menu.
when you enable usb debugging and plug your phone into the computer.....eventually.....and sometimes it takes a while, you will get a pop up on your phone saying your computer wants to connect to this device, allow or deny, I suggest you allow.
if you don't get the message, then with the phone still plugged into the computer, open developer options again and disable usb debugging, then enable it again.
Click to expand...
Click to collapse
Ofcourse i even tried different devices and cables and I always get device not found and simetimes device offline
RedBlackPellet said:
Ofcourse i even tried different devices and cables and I always get device not found and simetimes device offline
Click to expand...
Click to collapse
im at a loss, sorry I couldn't help any further, but if its doing it with different devices, it has to be a software issue, especially as you say its working in recovery and bootloader, the only thingf I picked out from your picture is it states your adb is out of date, but you say you've tried that too, all I can suggest is you try this one.
http://forum.xda-developers.com/showthread.php?t=2588979
also where did you get the drivers from
RedBlackPellet said:
and sometimes device offline
Click to expand...
Click to collapse
reboot PC and phone, use a USB2 port
RedBlackPellet said:
Ofcourse i even tried different devices and cables and I always get device not found and simetimes device offline
Click to expand...
Click to collapse
why are you using an adb shell to push the file? push the file using adb and then enter the shell to chmod the "ff" file (I suppose you are pushing firewater but your renamed the file to "ff" ?) And btw "adb devices" will not output your device ID from an adb shell.
Code:
adb devices
adb push ff /data/local/tmp
then
Code:
adb shell
su ---> [COLOR="blue"]to get a # prompt[/COLOR]
chmod 775 /data/local/tmp/ff [COLOR="Blue"]--> to give read/write/execute permission[/COLOR]
/data/local/tmp/ff

Changing the DPI/"display size" on the stock global rom without root

tldr; the stock global MIUI rom lacks a display size setting, but an awesome free option by zacharee1 lets you set it anyway, even without root, and with no need to reboot or anything:
https://labs.xda-developers.com/store/app/com.zacharee1.dpichanger
----
I love the Max 2 -- way more than I thought I would! I bought it as a replacement for my old, sadly dead Nexus 7 tablet, but if it had LTE bands for US T-Mobile, this might have been my next phone. But for all that, MIUI made some "customization" decisions to android that I just don't understand... like two finger drag for expanding a notification... and removing the "Display Size" setting.
On other Android N roms, you can easily adjust the zoom/DPI/display size, making things smaller or larger. The stock global MIUI version on the Max 2, however, is missing the setting (and the "Smallest width" setting in developer options.) I thought I was out of luck after trying an option from the play store that failed, but found an app in XDA Labs from zacharee1 that worked!
It did require enabling adb, and developer options; in addition steps, I had to go to developer options and enable "USB debugging (security settings)" with a sim card inserted. Normally I used the Max 2 without one, but if you don't have a sim card inserted it will tell you to insert one, then fail.
Anyway, if anyone else would like to fit a bit more content on the screen, I'm really happy with this app so far! Some of Xiaomi's own apps don't quite scale well, which is probably why they disabled it, but they just have extra padding around the content. They still work just fine.
Awesome!
Sorry, noob here. When I run the command it tells me "error : no devices/emulators found"
I have turned on both USB debugging options in developer options and am using Minimal ADB and Fastboot. No Root.
Any help would be greatly appreciated!
Worked well!
Just chiming in and letting you guys know that the app package is zacharee1 (one), not zachareel (L). Gave me some problems for a bit!
user4001 said:
I have turned on both USB debugging options in developer options and am using Minimal ADB and Fastboot. No Root.
Any help would be greatly appreciated!
Click to expand...
Click to collapse
Oh, sorry. I've never used minimal adb before -- have you tried running the adb command as an administrator? (You might have to run "adb kill-server" first, it will used an existing adb server with fewer privileges if it exists.)
whd5015 said:
Worked well!
Just chiming in and letting you guys know that the app package is zacharee1 (one), not zachareel (L). Gave me some problems for a bit!
Click to expand...
Click to collapse
Nice! That's a good tip, too, thanks. (I've wasted hours before figuring out a capital O wasn't a 0 before...)
ldrn said:
Oh, sorry. I've never used minimal adb before -- have you tried running the adb command as an administrator? (You might have to run "adb kill-server" first, it will used an existing adb server with fewer privileges if it exists.)
Nice! That's a good tip, too, thanks. (I've wasted hours before figuring out a capital O wasn't a 0 before...)
Click to expand...
Click to collapse
I'll try the administrator thing, thanks. I have no idea what
what ADB kill server is but will Google when I get home.
I tried it without root. I using adb in administrator mode, but it gives me an error:
C:\adb>adb shell pm grant com.zacharee1.dpichanger android.permission.WRITE_SECURE_SETTINGS
Operation not allowed: java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
Any suggestions?
ruairi said:
Operation not allowed: java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
Click to expand...
Click to collapse
Actually, yep! In developer options, there is a "USB debugging" toggle, then three lines down a "USB Debugging (Security settings)" toggle, that's the error you get when you have the first one toggled but not the second. You need both turned on.
(I'm speaking from personal experience, I made that same mistake at first; it's a bit confusing that the names are almost the same!)
thanks @ldrn, I'll give it a shot.
Works like Charm. I have set the DPI to 410 Thanks!
adb shell wm density XXX
i use "adb shell wm density 420"
display will refresh every time i change dpi. no sestart require
Is this safe for MIUI rom?
w4h1d said:
Is this safe for MIUI rom?
Click to expand...
Click to collapse
Yes it is safe tested in MIUI Global 8.5 | Stable
make sure USB debugging (Security settings) is enabled in developer options
The link is dead. Where can I download the app?
inunt said:
i use "adb shell wm density 420"
display will refresh every time i change dpi. no sestart require
Click to expand...
Click to collapse
So do I have to write this command on my computer? No app needed? If app from first post is needed, where can i find it?
Link is not working. Please new link? Thank you.
Link dont work
Can some one tell me what is the stock value of DPI
reversegear said:
Can some one tell me what is the stock value of DPI
Click to expand...
Click to collapse
stock value of dpi is 440
Link does not exist
The link to above app says that the file does not exist on the server. Can anyone please give me the valid link for it?

Unable to grant permissions using adb

xiaomi mi max 2
I get an error:
adb -d shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS
Operation not allowed: java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
Turn on the USB debugging (Security settings)
Permissions not allowed
I'm not able to get permission either
./adb -d shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS
Operation not allowed: java.lang.SecurityException: Permission android.permission.BATTERY_STATS is not a changeable permission type
Poley59 said:
Turn on the USB debugging (Security settings)
Click to expand...
Click to collapse
The option is enabled and still nothing!
MadK9 said:
The option is enabled and still nothing!
Click to expand...
Click to collapse
You have to turn all 3 usb debugging options on for miui.
thanks man
cpthero said:
You have to turn all 3 usb debugging options on for miui.
Click to expand...
Click to collapse
thanks dear it did worked for my Redmi Note 8 Pro :laugh:
cpthero said:
You have to turn all 3 usb debugging options on for miui.
Click to expand...
Click to collapse
Where you do that? Im on miui 11 android 9 (redmi note 8 pro)
danielofata said:
Where you do that? Im on miui 11 android 9 (redmi note 8 pro)
Click to expand...
Click to collapse
In the developers menu, you will find usb debugging and a bit more down the other one. I had to select both to get it working (mi 9t pro on miui 11 android 10)
Dxue said:
In the developers menu, you will find usb debugging and a bit more down the other one. I had to select both to get it working (mi 9t pro on miui 11 android 10)
Click to expand...
Click to collapse
Hi,
i am struggling with this right now. I got a Note 8 Pro with MIUI Global 11.0.3. I am trying to get BetterBatteryStats to show me what wakes up my phone. When using ADB i get the same error message ticatc3 got.
What exact setting do i need to activate? Most of them want me to "sign in to my Mi Account first" (what the heck for?).
If i knew how to attach a screenshot i would do so.
The Settings i got are:
USB debugging
Install via USB
USB Debugging (Security Settings)
Select debug app
Greetings
Realme X2 Pro - Color OS6 - USB debugging
Hey,
I just had the same problem with my Realme X2 Pro. USB debugging was not enough. It worked after I activated the bottom most option in the developer options:
"Disable Permission Monitoring" (English) / "Erlaubnisüberwachung deaktivieren" (German)
Just for completeness.
dadri said:
Hey,
I just had the same problem with my Realme X2 Pro. USB debugging was not enough. It worked after I activated the bottom most option in the developer options:
"Disable Permission Monitoring" (English) / "Erlaubnisüberwachung deaktivieren" (German)
Just for completeness.
Click to expand...
Click to collapse
thanks !
I was exactly looking for this
tschesny said:
Hi,
i am struggling with this right now. I got a Note 8 Pro with MIUI Global 11.0.3. I am trying to get BetterBatteryStats to show me what wakes up my phone. When using ADB i get the same error message ticatc3 got.
What exact setting do i need to activate? Most of them want me to "sign in to my Mi Account first" (what the heck for?).
If i knew how to attach a screenshot i would do so.
The Settings i got are:
USB debugging
Install via USB
USB Debugging (Security Settings)
Select debug app
Greetings
Click to expand...
Click to collapse
You have to enable all of them so that you can grant permissions
thanks a lot dadri, I was having the exact same problem on my x2 pro with realme ui and with yoyur input I finally got betterbatterystats working has it should
dadri said:
Hey,
I just had the same problem with my Realme X2 Pro. USB debugging was not enough. It worked after I activated the bottom most option in the developer options:
"Disable Permission Monitoring" (English) / "Erlaubnisüberwachung deaktivieren" (German)
Just for completeness.
Click to expand...
Click to collapse
Thanks, it worked on my realme 1
For COLOR OS you have to disable permission monitoring, is at the botton of developer options. USB Debugging and disable permissions, you have to select both options.
Not sure if this is the same issue or not but I am trying to run an adb command for the first time, the command is this
adb shell pm grant com.maxmpz.equalizer
android.permission.dump
These commands are listed under two different lines. When I try to run them separately I get an error saying no permissions specified. When I run them under one line I get an error that says,
Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown permission: android.permission.dump
on my LG G7 the developer options are a bit different, under USB debugging, this is what i see..
https://imgur.com/JbEFacE
What should I do to get this to work?
cpthero said:
You have to turn all 3 usb debugging options on for miui.
Click to expand...
Click to collapse
This worked for POCO X3 Pro. Thank you very much.
swagmuel said:
For COLOR OS you have to disable permission monitoring, is at the botton of developer options. USB Debugging and disable permissions, you have to select both options.
Click to expand...
Click to collapse
you are a savior!!!!
thank you!!!
I'm having this problem on my LG V20 with Oreo. It let me enable 2 of 3 permissions, but not PACKAGE.USAGE.STATS.
The error:
Operation not allowed: java.lang.SecurityException: Package com.asksven.betterbatterystats_xdaedition has not requested permission android.permission.PACKAGE_USAGE_STATS
dadri said:
Realme X2 Pro - Color OS6 - USB debugging
Hey,
I just had the same problem with my Realme X2 Pro. USB debugging was not enough. It worked after I activated the bottom most option in the developer options:
"Disable Permission Monitoring" (English) / "Erlaubnisüberwachung deaktivieren" (German)
Just for completeness.
Click to expand...
Click to collapse
THANK YOU!!!!! Man i thought i was screwed as a use taser a lot and needs a LOT of ADB functions like monitoring Clipboard. this should be the 1st google search entry when searching for this problem. I literally made an account just to post this .

Categories

Resources