itsdrnoob / DataMonitor

Data usage monitoring app for android.
GNU General Public License v3.0
558 stars 49 forks source link

App crashes when clicked on a non system app #54

Closed killerrook closed 1 year ago

killerrook commented 1 year ago

Describe the bug App crashes when clicked on a non system app for info about data sent and data received

To Reproduce Steps to reproduce the behavior:

  1. Open the app
  2. Click on mobile data denoted by a red antenna icon
  3. Scroll down to any non system app
  4. Click on app for more info
  5. App crashes after 2-3sec

Expected behavior App should show more info about data sent and received by the selected app

Screenshots Step 2 Screenshot_2022-10-27-01-31-47-13_4658bfd74d73f2a7c13010ce808ba7ad

For step 3 and 4

Screenshot_2022-10-27-01-31-17-41_4658bfd74d73f2a7c13010ce808ba7ad

just before crashing

Screenshot_2022-10-27-01-31-09-89_4658bfd74d73f2a7c13010ce808ba7ad

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

itsdrnoob commented 1 year ago
killerrook commented 1 year ago

Does this happen every time?

Yes

So the crash was probably due to this issue.

I don't know for sure but I don't have any issues viewing data sent and received for system apps the issue only occurs with non- system aka user apps

killerrook commented 1 year ago

I can see in the screenshot for step 3 & 4 that apps appear twice

Sometimes app appear twice may be 1 in 3 times but other times they only appear once

killerrook commented 1 year ago

Might be something related to #41 not sure though

itsdrnoob commented 1 year ago

If it happens every time, even when the apps appear once, then it might be some other issue. Have you granted all permissions? Could be related to #41 but not sure. Can you grab logs?

killerrook commented 1 year ago

Have you granted all permissions?

Allowed access to app usage Denied battery optimization

Can you grab logs?

Not at the moment no pc/adb and my device is non rooted as I'm on a holiday for a couple of months. If you have a debug version with logcat inbuilt I will more than happy to help. Many apps have created same debug type version to access the problems better one example is new pipe in github. So either you should create a debug version or get a logcat inbuilt in the app to catch crash reports

killerrook commented 1 year ago

One more thing that I noticed is that app only crashes after loading the screen time in just before crash screenshot above. Here is what happens

  1. The screen time says loading
  2. As soon as the screen time finishes loading and give me a value like 40 minutes or something the app crashes.

Pretty consistent bug

itsdrnoob commented 1 year ago

Strange, seems like accessing screen time data is causing the error. Is there any additional permission in ColorOS that I'm unaware of?

get a logcat inbuilt in the app to catch crash reports

Crash reporter has been implemented in the app for upcoming versions. I can provide you with a build for reporting logs. Can you pm me on telegram ?

killerrook commented 1 year ago

Can you pm me on telegram ?

sorry don't use telegram never felt the need

Can you provide me the app here or somewhere else like in mail or something or do I have to create a new account on telegram for this specific purpose

itsdrnoob commented 1 year ago

sorry don't use telegram

That's alright, you can drop me a mail

killerrook commented 1 year ago

Done

On Thu, Oct 27, 2022, 1:33 PM Dr.NooB @.***> wrote:

sorry don't use telegram

That's alright, you can drop me a mail @.***>

— Reply to this email directly, view it on GitHub https://github.com/itsdrnoob/DataMonitor/issues/54#issuecomment-1293144803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG37PFXGRICWUC2ZBG44LX3WFIZO3ANCNFSM6AAAAAARPLG25A . You are receiving this because you authored the thread.Message ID: @.***>

killerrook commented 1 year ago

Well it doesn't work either it still crashes and then takes me to the following screen

Screenshot_2022-10-27-15-59-23-15_4658bfd74d73f2a7c13010ce808ba7ad

  1. Clicking on anything other than github will simply close the app
  2. Clicking on github takes me to open a new issue page of this repository using default browser.
  3. The app doesn't even have an option to copy logs or something neither does it autofill when selecting the github option
  4. The scaling of text is also incorrect cause message beneath email header is only partially visible and the page could not be scrolled further.
killerrook commented 1 year ago

Here are permissions screens if you need Screenshot_2022-10-27-16-02-29-68 Screenshot_2022-10-27-16-11-38-19 Screenshot_2022-10-27-16-10-54-18

killerrook commented 1 year ago

Your crash reporter should allow at least ability to copy crash logs to be further posted into github or other support forums

killerrook commented 1 year ago

Something like this should be implemented for error reporting Screenshot_2022-10-27-16-23-10-07

itsdrnoob commented 1 year ago

Clicking on anything other than github will simply close the app

Will check what's happening here.

The app doesn't even have an option to copy logs

When you select github, it automatically copies the crash logs to clipboard.

The scaling of text is also incorrect

Will be fixed

itsdrnoob commented 1 year ago

Your crash reporter should allow at least ability to copy crash logs

Yeah, will add an option to manually copy logs

killerrook commented 1 year ago

When you select github, it automatically copies the crash logs to clipboard

  1. Nothing gets copied
  2. Suggestion to add a toast that error report is copied to clipboard if it's intended to be that way
itsdrnoob commented 1 year ago

Once the logs are copied to clipboard, a Toast is shown regarding the same. As logs are no being copied in your case, maybe that's why you weren't shown any Toast.

killerrook commented 1 year ago

Also make debug version separate from original app as it unnecessarily increases the app size if appropriate

itsdrnoob commented 1 year ago

Also make debug version separate from original app

Debug version is not released. Only release builds are available for download.

killerrook commented 1 year ago

@itsdrnoob Copy data button still doesn't work and once clicked on copy logs the app crashes but I got the file from cache folder as advised Here is the log obtained

--------- beginning of main 11-06 18:16:30.889 22931 22931 W main : type=1400 audit(0.0:1860474): avc: denied { search } for name="/" dev="mmcblk0p40" ino=2 scontext=u:r:zygote:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0 11-06 18:16:31.025 22931 22931 W re-initialized>: type=1400 audit(0.0:1860476): avc: denied { read } for name="u:object_r:mtk_amslog_prop:s0" dev="tmpfs" ino=2254 scontext=u:r:untrusted_app:s0:c110,c261,c512,c768 tcontext=u:object_r:mtk_amslog_prop:s0 tclass=file permissive=0 11-06 18:16:31.917 22931 22931 W oob.datamonitor: type=1400 audit(0.0:1860481): avc: denied { search } for name="/" dev="mmcblk0p40" ino=2 scontext=u:r:untrusted_app:s0:c110,c261,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0 11-06 18:16:34.173 22931 22931 W RenderThread: type=1400 audit(0.0:1860485): avc: denied { search } for name="/" dev="mmcblk0p40" ino=2 scontext=u:r:untrusted_app:s0:c110,c261,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0 11-06 18:16:34.193 22931 22931 W RenderThread: type=1400 audit(0.0:1860486): avc: denied { search } for name="/" dev="mmcblk0p40" ino=2 scontext=u:r:untrusted_app:s0:c110,c261,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0 11-06 18:16:34.325 22931 22931 W RenderThread: type=1400 audit(0.0:1860487): avc: denied { search } for name="/" dev="mmcblk0p40" ino=2 scontext=u:r:untrusted_app:s0:c110,c261,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0

itsdrnoob commented 1 year ago

Copy data button still doesn't work

Because there were no logs to copy as happened in earlier cases.

Here is the log obtained

Is that all? I don't see any crash logs here.

killerrook commented 1 year ago

Yup that's all it gives in a text file

I can send you screenshot and log file in txt format on mail if you like

killerrook commented 1 year ago

Every other apps works fine which i downloaded from Google Play and they all show usage time as well i can send you screenshot of multiple apps if you like which will confirm that the problem is not device specific or due to some ROM issues

itsdrnoob commented 1 year ago

Yup that's all it gives in a text file

That's odd. I am still wondering what the issue might be, as it's not even throwing any crash logs.

killerrook commented 1 year ago

Sent via mail as well

killerrook commented 1 year ago

Yup the latest app you sent fixed the problem of crash but permission denied toast still appears

killerrook commented 1 year ago

Shall i close this issue now

itsdrnoob commented 1 year ago

Yup the latest app you sent fixed the problem of crash

:)

permission denied toast still appears

I haven't done anything about it yet. Will look into it.

Shall i close this issue now

Nope, will push the fix first.

killerrook commented 1 year ago

The problem appears to be fixed