chenxiaolong / BCR

A Basic Call Recorder for rooted Android devices
GNU General Public License v3.0
1.49k stars 98 forks source link

Crash on Lineage OS 21 #539

Closed 2shrestha22 closed 1 month ago

2shrestha22 commented 1 month ago

App does not start at all. It crashes immediately. I have attached log.

crash.log.txt

BRC: v1.62 Lineage OS: 20 Installation type: System (via flashable zip)

chenxiaolong commented 1 month ago

Can you double check that the /system/etc/sysconfig/config-com.chiller3.bcr.xml file exists with a root file manager?

It's crashing because Android is denying BCR access to some system APIs. This config file is required to allow that access.

1223421 commented 1 month ago

same problem, file /system/etc/sysconfig/config-com.chiller3.bcr.xml exists:

$ cat /system/etc/sysconfig/config-com.chiller3.bcr.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
    <hidden-api-whitelisted-app package="com.chiller3.bcr" />
</config>

BRC: v1.62 Lineage OS: 21 Installation type: System (via flashable zip)

after first reboot it's work, after second reboot - crash

crash.log.txt

with 1.61 no problem.

twu2 commented 1 month ago

same issue (No field SAMPLE_RATE_HZ_MIN) here (integrated with rom, not flash zip). after flash rom, 1st boot work, but 2nd boot not working. but sometimes, 1st boot not work, but 2nd boot working.

chenxiaolong commented 1 month ago

Please grab a logcat with adb logcat -d > logcat.txt after a reboot. (If you're able to grab one for a working boot and one for a non-working boot, even better.)

I don't really have any idea why the issue would be intermittent. Hopefully the logcat will have some indication as to why.

2shrestha22 commented 1 month ago

Can you double check that the /system/etc/sysconfig/config-com.chiller3.bcr.xml file exists with a root file manager?

It's crashing because Android is denying BCR access to some system APIs. This config file is required to allow that access.

Yes there is /system/etc/sysconfig/config-com.chiller3.bcr.xml

twu2 commented 1 month ago

not working log: logcat_not_working.txt

working log: logcat_working.txt

chenxiaolong commented 1 month ago

Thanks for the logs. It confirms that the issue indeed is Android denying access to the hidden APIs:

(from logcat_not_working.txt)

05-07 11:29:50.910 28887 28887 W om.chiller3.bcr: Accessing hidden field Landroid/media/AudioFormat;->SAMPLE_RATE_HZ_MIN:I (max-target-o, reflection, denied)

I really have no idea why LineageOS is sometimes not respecting /system/etc/sysconfig/config-com.chiller3.bcr.xml. Since you're flashing directly and not using Magisk, the file always exists.


This is a total crapshoot, but can you give #541 a try? Test build: BCR-1.62.r9.g0b843bc-release.zip

It fixes a bug where the sysconfig file is deleted when flashing a LineageOS update without also flashing BCR again. I highly doubt it'll fix this issue though.

twu2 commented 1 month ago

Using zip file as kernelsu module work fine for me. but integrated to rom might not working. I found the zip put the files under /system, but integrated to rom put it under /product. I change it to /system and build the rom again, it seems work fine now.

radzix88 commented 1 month ago

Thanks for the logs. It confirms that the issue indeed is Android denying access to the hidden APIs:

(from logcat_not_working.txt)

05-07 11:29:50.910 28887 28887 W om.chiller3.bcr: Accessing hidden field Landroid/media/AudioFormat;->SAMPLE_RATE_HZ_MIN:I (max-target-o, reflection, denied)

I really have no idea why LineageOS is sometimes not respecting /system/etc/sysconfig/config-com.chiller3.bcr.xml. Since you're flashing directly and not using Magisk, the file always exists.

This is a total crapshoot, but can you give #541 a try? Test build: BCR-1.62.r9.g0b843bc-release.zip

It fixes a bug where the sysconfig file is deleted when flashing a LineageOS update without also flashing BCR again. I highly doubt it'll fix this issue though.

It works for me only after first boot. After second boot it crashes again. LOS 21, flashed zip in TWRP, phone without root. crash.log (7).txt crash.log (6).txt

twu2 commented 1 month ago

Using zip file as kernelsu module work fine for me. but integrated to rom might not working. I found the zip put the files under /system, but integrated to rom put it under /product. I change it to /system and build the rom again, it seems work fine now.

still get same error sometimes after this. but if I got this issue, just install the apk again, then it will work. so my workaround is: integrated the old version (1.61) to the rom, then install new version (1.62) again

twu2 commented 1 month ago

still get same error sometimes after this. but if I got this issue, just install the apk again, then it will work. so my workaround is: integrated the old version (1.61) to the rom, then install new version (1.62) again

still got this sometimes after reboot. but install apk again will make it work (uninstall it after install still working). so I use a script to install and uninstall the apk after boot.

chenxiaolong commented 1 month ago

@twu2 It sounds like you're building your own ROM. If so, can you give this build a try? BCR-1.62.r19.gc4346df-release.zip (source code: c4346df7db3376f4623fa956c0b0ee03967a4f87)

This uses an alternative method of allowing access to system APIs. Maybe it'll avoid this OS bug where the sysconfig file is sometimes ignored.

When testing, please don't use any workarounds (like installing the apk as a user app). Also, please delete the sysconfig file because the new method doesn't use it.

twu2 commented 1 month ago

@twu2 It sounds like you're building your own ROM. If so, can you give this build a try? BCR-1.62.r19.gc4346df-release.zip (source code: c4346df)

This uses an alternative method of allowing access to system APIs. Maybe it'll avoid this OS bug where the sysconfig file is sometimes ignored.

When testing, please don't use any workarounds (like installing the apk as a user app). Also, please delete the sysconfig file because the new method doesn't use it.

this build work fine for me.