Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other processes with root? #14

Open
RichyHBM opened this issue Apr 21, 2020 · 6 comments
Open

Other processes with root? #14

RichyHBM opened this issue Apr 21, 2020 · 6 comments

Comments

@RichyHBM
Copy link

Hello, I am awear that android removed this functionality from normal apps, but have just noticed SystemPanel 2 is able to gather per app CPU usage using root. Is this something that might be doable in Another monitor?

@AntonioRedondo
Copy link
Owner

Hi @RichyHBM,

I had a look at SystemPanel 2 and among all the options the app has I haven't seen real-time CPU use information per app available. Granting development permissions to the app (same effect than having a rooted device) I've seen time spent, battery and power use per app but not what AnotherMonitor tracked before Android 7.0.

SystemPanel 2 has however a somewhat confusing interface. So if you post a screenshot of the part of the app you mean it will help to understand your question.

Antonio

@RichyHBM
Copy link
Author

Sorry I just saw your reply! I'm trying to find it but it now isnt appearing to me, I'll spend some more time navigating the UI and see if I can find it

@RichyHBM
Copy link
Author

RichyHBM commented Apr 30, 2020

Hey @AntonioRedondo

Ok, so finally managed to figure it out, and it does indeed seem you need root access.

So this is how it looks like by default:
Screenshot_20200430-130524_SystemPanel_2

But then if you go into the settings and enable superuser mode
Screenshot_20200430-130332_SystemPanel_2

It looks like this (notice the additional processes)
Screenshot_20200430-130543_SystemPanel_2

If you then click that live tile, it brings up a better view where you can see the app usage
Screenshot_20200430-130417_SystemPanel_2

@AntonioRedondo
Copy link
Owner

Umm, I see. I have no idea how they do it. A pity it isn't an open source app. I guess they're using some of the methods mentioned on #9 (comment).

@AntonioRedondo
Copy link
Owner

AntonioRedondo commented May 2, 2020

So my personal phone is a gorgeous Asus Zenfone 6. Yesterday I tried to root it in order to see this SystemPanel 2 app working. And I almost brick my phone in the try...

Rooting phones have become an increasing complicated task. In the past I rooted and installed Cyanogen in several phones. It was a fairly standard process: unlocking the bootloader, flashing TWRP on the recovery partition and install the ROM of choice.

However now, all these steps have become ridiculously complex:

  • Unlocking the bootloader will erase your phone, which it's a hassle because you need to backup pictures and videos and setup all the apps and the entire configuration of the phone after bootloader unlocking.
  • On Android 7 Google introduced A/B system updates. Which means duplicated system, boot and recovery partitions. This complicates things. fastboot boot TWRP.img didn't work on my Zenfone 6 and failed to boot on TWRP even when on screen there were no errors. It just restarted into the main partition rather than on the booted image. I gave up at this point because on XDA-Developers I saw many comments of people with the same issue. And trying alternative methods to boot TWRP caused bootloops or parts of the OEM img stopping working well (like the fingerprint). Not only that, if you want to install the recovery img that you can download from the Asus support website you first need to do some processing and patch it.
  • Making things worse, now to root devices you need Magisk. And the installation isn't pretty.
  • To add insult to injury, many apps check whether the device is bootloader-unlocked or rooted, and if so, they won't work, like Google Pay or banking apps. Magisk has some functionality to prevent this. But it won't work anymore. I use Google Pay on a daily basis. Not having this app working means an absolute no-way to bootloader-unlocking and rooting.

Jesus! Things have changed a lot in the last 6 years for Android!

I wish I knew all this before starting to fiddle with my Asus Zenfone 6. Now I have to relock the bootloader if I want to use Google Pay. That means yet another OS reset... After configuring it yesterday which took me several hours. 😭😭😭😭😭

Thankfully I also got an old Google Nexus 10 tablet with TRWP and Android 7.1. Rooting it was a much simpler task. And now I have running SystemPanel 2 seeing apps CPU usage in real time. This means in the future I could investigate how to implement this functionality back to AnotherMonitor, which it seems it can be done on rooted devices with dumpsys cpuinfo.

@VA1DER
Copy link

VA1DER commented Apr 29, 2022

Um, I see. I have no idea how they do it. A pity it isn't an open source app. I guess they're using...

... normal Linux methods. Once you invoke su you can use /proc as per normal.

Attached is a screenshot of htop running under termux. Both are open source.

I hope you'll consider adding support for root. The need for good utilities that use su to get at what Google is locking down is growing.

Screenshot_20220429-003028_Termux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants