AnotherMonitor icon indicating copy to clipboard operation
AnotherMonitor copied to clipboard

Other processes with root?

Open RichyHBM opened this issue 5 years ago • 6 comments

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?

RichyHBM avatar Apr 21 '20 06:04 RichyHBM

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

AntonioRedondo avatar Apr 27 '20 03:04 AntonioRedondo

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 avatar Apr 30 '20 12:04 RichyHBM

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

RichyHBM avatar Apr 30 '20 13:04 RichyHBM

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 https://github.com/AntonioRedondo/AnotherMonitor/issues/9#issuecomment-437648397.

AntonioRedondo avatar May 01 '20 01:05 AntonioRedondo

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.

AntonioRedondo avatar May 02 '20 10:05 AntonioRedondo

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

VA1DER avatar Apr 29 '22 03:04 VA1DER