chenxiaolong / BCR

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

BCR resets every time OS updates (Possibly also when BCR updates.) #237

Closed bagarwa closed 1 year ago

bagarwa commented 1 year ago

I've noticed that every time the phone's OS updates, BCR gets reset completely. In recent weeks, I had updated from Android 13 QPR2 Beta 2, to 3 to 3.1. Every time I found out later that the BCR has reset completely - call recording is turned off, "start as paused" is disabled, download location is reset to the default one, recording quality setting is reset etc.

This possibly also happens when BCR itself updates; but I'm not 100% sure on that.

(While I'm here, can you please also give less options in the bitrate slider? Instead of the slider having increments of 1, I think it'd be better if the slider just had standard bitrates on it.)

chenxiaolong commented 1 year ago

I've noticed that every time the phone's OS updates, BCR gets reset completely. In recent weeks, I had updated from Android 13 QPR2 Beta 2, to 3 to 3.1. Every time I found out later that the BCR has reset completely - call recording is turned off, "start as paused" is disabled, download location is reset to the default one, recording quality setting is reset etc.

This possibly also happens when BCR itself updates; but I'm not 100% sure on that.

Do you have any other Magisk modules installed? Also, have you ever restored BCR's data from a backup? The only time I've ever seen Android do this is if the ownership or SELinux label on the /data/data/<app ID> directory is incorrect.

EDIT: Does a simple reboot cause the app data to be cleared too?

(While I'm here, can you please also give less options in the bitrate slider? Instead of the slider having increments of 1, I think it'd be better if the slider just had standard bitrates on it.)

Yeah, I'll change that for OGG/Opus. It currently has 253 increments, which is pretty excessive. I'll make it at least an order of magnitude fewer.

bagarwa commented 1 year ago

Do you have any other Magisk modules installed?

Yes - Detach3, Substratum Lite Overlay Helper, Systemless Hosts, Universal Safetynet Fix.

Also, have you ever restored BCR's data from a backup?

No, I never restore any system / root app's data from backup.

Does a simple reboot cause the app data to be cleared too?

No, reboot doesn't reset BCR.

Yeah, I'll change that for OGG/Opus. It currently has 253 increments, which is pretty excessive. I'll make it at least an order of magnitude fewer.

Thanks. :)

chenxiaolong commented 1 year ago

Yes - Detach3, Substratum Lite Overlay Helper, Systemless Hosts, Universal Safetynet Fix.

Detach3, Systemless Hosts, and Universal Safetynet Fix shouldn't have any effect. Not sure about Substratum Lite Overlay Helper--doesn't seem to be open source.

I'm not really sure what might be causing this. You're setup is not too different from mine, except I'm on the stable QPR1 builds. Probably need to look at the full adb logcat output immediately after it happens, to try and see what Android's installd is doing.

bagarwa commented 1 year ago

Updated to version 1.32 just now. Happy to report that that didn't reset the app. So, I'm guessing it happens only after OS updates. How would I capture the logcat for this after OS update though? Immediately after an OS update reboot, wouldn't the logcat catch a whole bunch of too much stuff?

chenxiaolong commented 1 year ago

I think running adb logcat first thing after the OS update reboot is the best way. It will log a bunch of stuff (but hopefully not too much that the installd messages are already out of the log history).

bagarwa commented 1 year ago

Ok, I'll try to do that next time the OS updates.

lbdroid commented 1 year ago

When you do the update, do you boot the device at least once without magisk installed in the boot image? If so, then BCR will be "uninstalled" during that boot, and "reinstalled" the following boot when magisk is re-enabled.

bagarwa commented 1 year ago

When you do the update, do you boot the device at least once without magisk installed in the boot image? If so, then BCR will be "uninstalled" during that boot, and "reinstalled" the following boot when magisk is re-enabled.

Yes, after flashing the updated factory image, the first boot is without magisk installed. I then have to reboot into bootloader again, flash the magisk patched init_boot img and boot into system to have a magisk rooted Android.

chenxiaolong commented 1 year ago

Ah, that explains it then. @lbdroid is correct--Android will delete an app's data if the .apk disappears, even for one boot.

For BCR, you can work around this by extracting the .apk from the .zip and installing it manually (in addition to having the Magisk module). When you do this, Android will see that BCR is a system app with an "update" installed. During the first boot without Magisk, Android will only see the "update" (which no longer has system privileges), but that's enough to preserve the data until you reinstall Magisk.


Alternatively, in the factory image flash-all script, you can add --skip-reboot to the fastboot update line so that you have a chance to flash both the factory image and the Magisk-patched init_boot in one go.

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 1 year ago

i also found today that since 11 jul i had no saved files. in app, the recording was disabled for some reason