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

BCR KSU #650

Open
damondiamond opened this issue Jan 3, 2025 · 14 comments
Open

BCR KSU #650

damondiamond opened this issue Jan 3, 2025 · 14 comments

Comments

@damondiamond
Copy link

after installing bcr via ksu the application does not appear

@chenxiaolong
Copy link
Owner

Make sure BCR is given root access in KernelSU (even though it doesn't actually need it). If you have any root hiding modules, please try temporarily disabling them.

@fabio-87
Copy link

fabio-87 commented Feb 4, 2025

I'm on Xiaomi 12 Pro with Android 14 stock global MIUI HyperOS ROM, GKI_KernelSU_SUSFS Kernel, KernelSU Next manager, SuSFS for KernelSU v1.5.4, Zygisk Next, Play Integrity Fix v18.5 and Tricky Store v1.2.0.
It happened to me too; in addiction to the module, I installed the apk and, for a short period, it worked. I tried BCR module without other modules enabled but now, also with only apk installed (without BCR module), it crashes as soon as I click on it, so I cannot long click on the version number to enable the debug mode and understand what happens.

@chenxiaolong
Copy link
Owner

Please grab a logcat with adb logcat -d > logcat.txt right after it crashes and upload that here.

@fabio-87
Copy link

fabio-87 commented Feb 4, 2025

Here it is.

logcat.txt

@chenxiaolong
Copy link
Owner

Thanks for the logs. The issue is this:

02-04 16:32:49.896 31436 31436 W om.chiller3.bcr: Accessing hidden field Landroid/media/AudioFormat;->SAMPLE_RATE_HZ_MIN:I (max-target-o, reflection, denied)

BCR is blocked from accessing some private Android APIs. BCR's module normally grants access to these APIs by installing a /system/etc/sysconfig/config-com.chiller3.bcr.xml file.

I'm guessing there's something in KernelSU itself or another module that's causing this file to be hidden from Android system components. Unfortunately, I have no idea what settings you could try changing to fix this.

@fabio-87
Copy link

fabio-87 commented Feb 5, 2025

Thanks for the logs. The issue is this:

02-04 16:32:49.896 31436 31436 W om.chiller3.bcr: Accessing hidden field Landroid/media/AudioFormat;->SAMPLE_RATE_HZ_MIN:I (max-target-o, reflection, denied)

BCR is blocked from accessing some private Android APIs. BCR's module normally grants access to these APIs by installing a /system/etc/sysconfig/config-com.chiller3.bcr.xml file.

I'm guessing there's something in KernelSU itself or another module that's causing this file to be hidden from Android system components. Unfortunately, I have no idea what settings you could try changing to fix this.

Can be useful if I grab the logcat with module installed (BCR crash anyway) and then the logcat with the module+manual apk installed?

@chenxiaolong
Copy link
Owner

Sure, I can take a look to see if the error is any different.

@fabio-87
Copy link

fabio-87 commented Feb 5, 2025

I tried flashing module and, after giving it all permissions and root privileges, now it works but, as you can see from the attached images (BCR icon and the name of app in the App permission page), there are some strange behaviors, also after rebooting again.

PS: In the meanwhile I upgraded to SuSFS for KernelSU v1.5.5, but I'm not sure if it's really correlated.
PS2: After rebooting, the App permissions page appears to be back to normal, but the icon is not.

Here is the new logcat file, after I opened BCR, although it no longer crashes (for now):
logcat.txt

BCR Icon
BCR Android App Permissions

@chenxiaolong
Copy link
Owner

Thanks for the new logs! Yeah, Android definitely picking up the config file properly now:

02-05 09:53:40.608  2353  3511 I SystemConfig: Reading permissions from /system/etc/sysconfig/config-com.chiller3.bcr.xml

That would explain why it no longer crashes.

As for the icon, you'll probably need to extract BCR's APK and install it to work around the problem. This happens because something is still blocking parts of Android from accessing the module's APK in /system/priv-app/com.chiller3.bcr/app-release.apk. I'm not familiar with susfs, so I'm not sure if it's causing files to be hidden or something else.

@jbro129
Copy link

jbro129 commented Feb 10, 2025

I was having a similar issue after migrating from Magisk to KSU Next + SusFS.

I would open BCR and it would immediately crash with this error:

FATAL EXCEPTION: main
Process: com.chiller3.bcr, PID: 30982
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference
	at android.app.ConfigurationController.updateLocaleListFromAppContext(ConfigurationController.java:293)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7703)
	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2486)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:9063)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

I don't know if my issue and this are related, but I was able to fix BCR by clearing it's app data and permissions and then making sure BCR was getting root permissions in KSU and not unmounting.

I tried flashing module and, after giving it all permissions and root privileges, now it works but, as you can see from the attached images (BCR icon and the name of app in the App permission page), there are some strange behaviors, also after rebooting again.

PS: In the meanwhile I upgraded to SuSFS for KernelSU v1.5.5, but I'm not sure if it's really correlated. PS2: After rebooting, the App permissions page appears to be back to normal, but the icon is not.

Here is the new logcat file, after I opened BCR, although it no longer crashes (for now): logcat.txt

BCR Icon BCR Android App Permissions

I was having the same issue where the package name would show as the app name and icon would be default.

@chenxiaolong
Copy link
Owner

I don't know if my issue and this are related, but I was able to fix BCR by clearing it's app data and permissions and then making sure BCR was getting root permissions in KSU and not unmounting.

Yep, that crash is a similar issue, except Android was having trouble loading the list of supported languages from BCR's APK instead of the icon. The "not unmounting" part is likely what fixed it.

@jbro129
Copy link

jbro129 commented Mar 2, 2025

On an unrelated but maybe actually related note, I updated my kernel from KSU next 12335 to 12437 and now BCR crashes whenever I open it.

FATAL EXCEPTION: main
Process: com.chiller3.bcr, PID: 15629
java.lang.ExceptionInInitializerError
	at com.chiller3.bcr.format.WaveFormat.<clinit>(Unknown Source:15)
	at com.chiller3.bcr.format.Format$$ExternalSyntheticLambda0.invoke(Unknown Source:140)
	at com.chiller3.bcr.format.Format$$ExternalSyntheticLambda0.invoke(Unknown Source:185)
	at kotlin.SynchronizedLazyImpl.getValue(Unknown Source:20)
	at com.chiller3.bcr.format.Format.<clinit>(Unknown Source:13)
	at com.chiller3.bcr.settings.SettingsFragment.refreshOutputFormat(Unknown Source:0)
	at com.chiller3.bcr.settings.SettingsFragment.onCreatePreferences(Unknown Source:128)
	at androidx.preference.PreferenceFragmentCompat.onCreate(Unknown Source:67)
	at androidx.fragment.app.FragmentStateManager.create(Unknown Source:70)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(Unknown Source:182)
	at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(Unknown Source:1166)
	at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(Unknown Source:81)
	at androidx.fragment.app.FragmentManagerImpl.execPendingActions(Unknown Source:172)
	at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(Unknown Source:66)
	at androidx.appcompat.app.AppCompatActivity.onStart$androidx$fragment$app$FragmentActivity(Unknown Source:33)
	at androidx.appcompat.app.AppCompatActivity.onStart(Unknown Source:0)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1582)
	at android.app.Activity.performStart(Activity.java:9034)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4206)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:225)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:205)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:177)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2693)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:9063)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Caused by: java.lang.NoSuchFieldException: No field SAMPLE_RATE_HZ_MIN in class Landroid/media/AudioFormat; (declaration of 'android.media.AudioFormat' appears in /system/framework/framework.jar!classes2.dex)
	at java.lang.Class.getDeclaredField(Native Method)
	at com.chiller3.bcr.extension.AudioFormatExtensionsKt.<clinit>(Unknown Source:4)
	... 31 more

When the crash first happened, I saw an alert saying there was an issue and I should clear the app data before using it again. However clearly app data did not fix the issue...

@chenxiaolong
Copy link
Owner

Something is probably unmounting BCR's files again. That crash occurs if /system/etc/sysconfig/config-com.chiller3.bcr.xml isn't visible to Android's system components.

@Kellwaxx11
Copy link

Kellwaxx11 commented Mar 5, 2025

I had similar problem were BCR is not detected
I solved by disabling the option "Umount Modules" under KSU manager settings, but didn't test if calls are recorded correctly

after some research I think similar issue was present with systemless hosts modules, and they solved by adding something like this to the services.sh of the module, to kind off force mount the module files

mount --bind "${0%/*}/hosts" /system/etc/hosts

i believe by doing so for every file of BCR module that needs to be injected into the system it could solve the above issues without disabling the Umount Modules for all modules which can affect root hiding maybe but I need yet to test

Edit: tried adding those lines to services.sh
mount --bind "${0%/*}/system/priv-app/com.chiller3.bcr/app-release.apk" /system/priv-app/com.chiller3.bcr/app-release.apk

mount --bind "${0%/*}/system/etc/permissions/privapp-permissions-com.chiller3.bcr.xml" /system/etc/permissions/privapp-permissions-com.chiller3.bcr.xml

mount --bind "${0%/*}/system/etc/sysconfig/config-com.chiller3.bcr.xml" /system/etc/sysconfig/config-com.chiller3.bcr.xml

mount --bind "${0%/*}/system/addon.d/51-com.chiller3.bcr.sh" /system/addon.d/51-com.chiller3.bcr.sh

didn't work so...bad luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants