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

App Crashes on Call #533

Closed
nutzboi opened this issue Apr 21, 2024 · 6 comments
Closed

App Crashes on Call #533

nutzboi opened this issue Apr 21, 2024 · 6 comments
Assignees
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project

Comments

@nutzboi
Copy link

nutzboi commented Apr 21, 2024

App crashes when call starts. Crash log says:

msg: java.io.IOException: Failed to create file ERROR_20240421_123211.501+0200_in_sim2_<phone number(s)>_<contact name(s)>.log in file:///storage/emulated/0/Android/data/com.chiller3.bcr/files
stacktrace: java.io.IOException: Failed to create file ERROR_20240421_123211.501+0200_in_sim2_<phone number(s)>_<contact name(s)>.log in file:///storage/emulated/0/Android/data/com.chiller3.bcr/files
	at com.chiller3.bcr.output.OutputDirUtils.createFile(Unknown Source:124)
	at com.chiller3.bcr.output.OutputDirUtils.createFileInDefaultDir(Unknown Source:53)
	at com.chiller3.bcr.RecorderThread.run(Unknown Source:34)

Also, my recordings directory was not the default one, although changing it back to the default one yields the same crash log.

MatLog also displays the errors:

04-21 13:09:51.289 W/ResourcesManager(5044): failed to preload asset path '/system/priv-app/com.chiller3.bcr/app-release.apk'
04-21 13:09:51.289 W/ResourcesManager(5044): java.io.IOException: Failed to load asset path /system/priv-app/com.chiller3.bcr/app-release.apk
04-21 13:09:51.289 W/ziparchive(5044): Unable to open '/system/priv-app/com.chiller3.bcr/app-release.apk': No such file or directory
04-21 13:09:51.289 E/gs.intelligence(5044): Failed to open APK '/system/priv-app/com.chiller3.bcr/app-release.apk': I/O error
04-21 13:09:51.289 E/ResourcesManager(5044): failed to add asset path '/system/priv-app/com.chiller3.bcr/app-release.apk'
04-21 13:09:51.289 E/ResourcesManager(5044): java.io.IOException: Failed to load asset path /system/priv-app/com.chiller3.bcr/app-release.apk
04-21 13:09:51.289 W/PackageManager(5044): Failure retrieving resources for com.chiller3.bcr
04-21 13:09:55.495 D/ActivityManager(1757): freezing 12708 com.chiller3.bcr

crDroid 10.4 with Kitsune. BCR is on the SuList and has all permissions except Read Call Log.

@chenxiaolong
Copy link
Owner

Hmm, the I/O error in:

04-21 13:09:51.289 E/gs.intelligence(5044): Failed to open APK '/system/priv-app/com.chiller3.bcr/app-release.apk': I/O error

is concerning. That was reported before in #251 too. Are you able to try with official Magisk? (I don't know that it would fix the problem, but a lot of people have reported bugs with how Kitsune mounts the module directories in the past.)

Also, my recordings directory was not the default one, although changing it back to the default one yields the same crash log.

BCR always records to the default directory first and then moves it to the output directory after the call ends. This is likely why you see the crash no matter what directory is selected.

This is unfortunately necessary because some ROMs have a really slow implementation of Android's storage access framework. On these devices, writing directly to the output directory is slow enough to lose ~20 seconds of the beginning of the recording and have constant audio drops throughout the recording.

@chenxiaolong chenxiaolong self-assigned this Apr 21, 2024
@chenxiaolong chenxiaolong added the bug/limitation elsewhere Bug/limitation in the ROM or another project label Apr 21, 2024
@nutzboi
Copy link
Author

nutzboi commented Apr 22, 2024

Same error with official Magisk 27.0 TwT.

@chenxiaolong
Copy link
Owner

Hmm, sorry, I don't really have any other suggestions. I don't know why certain Android components would be hitting the I/O error when accessing BCR's APK.

Just in case the permission issue has a different root cause than the I/O error, can you try removing BCR and manually deleting /data/media/0/Android/data/com.chiller3.bcr with a root file manager before installing it again?

@nutzboi
Copy link
Author

nutzboi commented Apr 23, 2024

can you try removing BCR and manually deleting /data/media/0/Android/data/com.chiller3.bcr with a root file manager before installing it again?

Worked. 💀🥳
Thank you. 🙏

I think this means the app lost access to its own data folder (like here too) after upgrading android and reinstalling the app? If you believe that's true, do you know a quick fix for that issue (like chmodding the folder perhaps)?
Thanks again, and sorry for the trouble as well. 😓

@nutzboi nutzboi closed this as completed Apr 23, 2024
@chenxiaolong
Copy link
Owner

Great! Yeah, it's possible to manually fix the permissions. Assuming you're familiar with running commands as root in adb shell, this is how you would do it:

  1. Get the app's user ID and SELinux MLS by running:

    ps -efZ | grep com.chiller3.bcr

    The output will look something like this:

    u:r:priv_app:s0:c512,c768      u0_a156      23463   970 5 09:51:54 ?     00:00:00 com.chiller3.bcr
                    ^^^^^^^^^      ^^^^^^^
                       MLS         User ID
    
  2. Set the permissions (replacing <User ID> with the actual value):

    chown -R <User ID>:ext_data_rw /data/media/0/Android/data/com.chiller3.bcr
  3. Set the SELinux labels (replacing <MLS> with the actual value):

    For the main directory:

    chcon u:object_r:media_rw_data_file:s0 /data/media/0/Android/data/com.chiller3.bcr

    and then for the files inside of it:

    chcon -R u:object_r:media_rw_data_file:s0:<MLS> /data/media/0/Android/data/com.chiller3.bcr/*

(If you run into this with other apps, the same procedure should work for them too. Just replace com.chiller3.bcr with the proper app ID.)

@nutzboi
Copy link
Author

nutzboi commented Apr 23, 2024

Thank you sooooo much! you're a lifesaver ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project
Projects
None yet
Development

No branches or pull requests

2 participants