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

Error when installing dev release 3.27.0 #12253

Closed
4 tasks done
exstntlmsnthrp opened this issue Dec 7, 2023 · 22 comments · Fixed by #12257 or #12263
Closed
4 tasks done

Error when installing dev release 3.27.0 #12253

exstntlmsnthrp opened this issue Dec 7, 2023 · 22 comments · Fixed by #12257 or #12263

Comments

@exstntlmsnthrp
Copy link

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

This is a new report as requested in #12229.

Expected behaviour

Please see below or #12229

Actual behaviour

See previous

Android version

14 - GrapheneOS

Device brand and model

Pixel 7 Pro

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

3.27.0

Nextcloud server version

27

Using a reverse proxy?

No

Android logs

No response

Server error logs

No response

Additional information

I don't know if you want a new bug opened for this or if it's appropriate to post here. I've installed the release candidate (Android 14, GrapheneOS, Pixel 7 Pro) from GitHub and I've two issues. The first is it conflicts with the previous release candidate and I had to uninstall the previous in order to update. Secondly, the app will not open. Keeps crashing with the following log.

### Cause of error
```java
Exception in thread "main" java.lang.RuntimeException: Unable to resume activity {com.nextcloud.client/com.owncloud.android.authentication.AuthenticatorActivity}: java.lang.SecurityException: com.nextcloud.client: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4979)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5012)
    at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
    at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2450)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8199)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: Exception in thread "main" java.lang.SecurityException: com.nextcloud.client: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3066)
    at android.os.Parcel.createException(Parcel.java:3050)
    at android.os.Parcel.readException(Parcel.java:3026)
    at android.os.Parcel.readException(Parcel.java:2968)
    at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5699)
    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1883)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1823)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1811)
    at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
    at de.cotech.hw.internal.transport.usb.UsbConnectionDispatcher.onResume(UsbConnectionDispatcher.java:113)
    at de.cotech.hw.SecurityKeyManager$DispatcherActivityLifecycleCallbacks.onActivityResumed(SecurityKeyManager.java:281)
    at android.app.Application.dispatchActivityResumed(Application.java:437)
    at android.app.Activity.dispatchActivityResumed(Activity.java:1489)
    at android.app.Activity.onResume(Activity.java:2075)
    at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:309)
    at com.owncloud.android.authentication.AuthenticatorActivity.onResume(AuthenticatorActivity.java:727)
    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1608)
    at android.app.Activity.performResume(Activity.java:8799)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4969)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5012)
    at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
    at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2450)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8199)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: Exception in thread "main" android.os.RemoteException: Remote stack trace:
	at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:14007)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2578)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2724)
	at android.os.Binder.execTransactInternal(Binder.java:1368)
	at android.os.Binder.execTransact(Binder.java:1299)


App information

  • ID: com.nextcloud.client
  • Version: 30270051
  • Build flavor: generic

Device information

  • Brand: google
  • Device: cheetah
  • Model: Pixel 7 Pro
  • Id: UP1A.231105.003
  • Product: cheetah

Firmware

  • SDK: 34
  • Release: 14
  • Incremental: 2023112900
@joshtrichards
Copy link
Member

Confirmed. I can trigger this on-demand as well, without doing a new install, by trying to add another account in latest Dev from F-Droid.

@AndyScherzinger
Copy link
Member

@alperozturk96 @tobiasKaminsky I suspect this comes from bumping the target sdk to 34

@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.27.0 milestone Dec 8, 2023
@alperozturk96
Copy link
Collaborator

Member

Yes its related with targetSDK 34 when we receive broadcast we need to specify explicitly. I will create PR asap.

@alperozturk96 alperozturk96 linked a pull request Dec 8, 2023 that will close this issue
1 task
@alperozturk96
Copy link
Collaborator

@exstntlmsnthrp Could you try with this branch?

@alperozturk96
Copy link
Collaborator

@AndyScherzinger We need to check Android-library as well, fyi. I will check it.

@exstntlmsnthrp
Copy link
Author

exstntlmsnthrp commented Dec 8, 2023

@exstntlmsnthrp Could you try with this branch?

@alperozturk96 No, that branch also fails. Here's the debug:

type: crash
osVersion: google/cheetah/cheetah:14/UQ1A.231205.015/2023120701:user/release-keys
package: com.nextcloud.android.qa:12257
process: com.nextcloud.android.qa
processUptime: 3343 + 52 ms
installer: com.android.packageinstaller

java.lang.RuntimeException: Unable to resume activity {com.nextcloud.android.qa/com.owncloud.android.authentication.AuthenticatorActivity}: java.lang.SecurityException: com.nextcloud.android.qa: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4999)
	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5032)
	at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2455)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8216)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.SecurityException: com.nextcloud.android.qa: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3066)
	at android.os.Parcel.createException(Parcel.java:3050)
	at android.os.Parcel.readException(Parcel.java:3026)
	at android.os.Parcel.readException(Parcel.java:2968)
	at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5699)
	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1883)
	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1823)
	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1811)
	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
	at de.cotech.hw.internal.transport.usb.UsbConnectionDispatcher.onResume(UsbConnectionDispatcher.java:113)
	at de.cotech.hw.SecurityKeyManager$DispatcherActivityLifecycleCallbacks.onActivityResumed(SecurityKeyManager.java:281)
	at android.app.Application.dispatchActivityResumed(Application.java:437)
	at android.app.Activity.dispatchActivityResumed(Activity.java:1499)
	at android.app.Activity.onResume(Activity.java:2085)
	at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:309)
	at com.owncloud.android.authentication.AuthenticatorActivity.onResume(AuthenticatorActivity.java:727)
	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1608)
	at android.app.Activity.performResume(Activity.java:8825)
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4989)
	... 13 more
Caused by: android.os.RemoteException: Remote stack trace:
	at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:14075)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2578)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2767)
	at android.os.Binder.execTransactInternal(Binder.java:1361)
	at android.os.Binder.execTransact(Binder.java:1302)


@alperozturk96
Copy link
Collaborator

alperozturk96 commented Dec 8, 2023

@AndyScherzinger @tobiasKaminsky We are using HWSecurity library and obviously even latest version 4.4.0 (24 Mar 2021) not handling broadcast receiver for Android 14. We need to fork this library and update the codebase if this library so vital or we can get rid of this library. What do you think?

Issue created in their Github page

p

@tobiasKaminsky
Copy link
Member

HWSecurity is used for 2fa during login.

@alperozturk96
Copy link
Collaborator

HWSecurity is used for 2fa during login.

Can we fork and use it as AAR file?

@AndyScherzinger
Copy link
Member

Can we fork and use it as AAR file?

Given zero responses in hwsecurity-sdk/hwsecurity#5 I suppose we kind of have to I fear. But looping in @dschuermann for feedback. Given it breaks Android 14 we either

  • fork for a quick fix, potentially going back when upstream release
  • look for an alternative

So to not loose time @alperozturk96 is it easily possible to fork and build ourselves - just in case we have to go down that road, fingers crossed we don't? However see #8933 4.4.0 is broken, so we would need to fix it for the version we use.

@alperozturk96
Copy link
Collaborator

alperozturk96 commented Dec 8, 2023

Can we fork and use it as AAR file?

Given zero responses in cotechde/hwsecurity#5 I suppose we kind of have to I fear. But looping in @dschuermann for feedback. Given it breaks Android 14 we either

  • fork for a quick fix, potentially going back when upstream release
  • look for an alternative

So to not loose time @alperozturk96 is it easily possible to fork and build ourselves - just in case we have to go down that road, fingers crossed we don't? However see #8933 4.4.0 is broken, so we would need to fix it for the version we use.

Fix is simple we are just going to add one more parameter. It's my prediction, if some other things not surprise us. Or basically we can reduce targetSDKLevel to 33. Which version we are using exactly? 4.3.0?

@AndyScherzinger
Copy link
Member

@AndyScherzinger
Copy link
Member

Turns out we already did have to fork...

-> https://github.com/nextcloud-deps/hwsecurity

@tobiasKaminsky
Copy link
Member

Found the same :)
We are working on it.

@AndyScherzinger
Copy link
Member

😆

@alperozturk96
Copy link
Collaborator

Great I will create PR with fix asap

@AndyScherzinger
Copy link
Member

Awesome finding btw @alperozturk96 👍

@dschuermann
Copy link
Member

Hey, yeah sorry, hwsecurity development is frozen right now.

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Dec 8, 2023

Hi @dschuermann

thanks a lot for the feedback, highly appreciate it. Hope all is well for you, no worries about it - yet good to know.
If you folks ever pick it up again and want the changes up-streamed, just give us a ping 👍

Great work you did in creating this library is very much appreciated 🙏

@tobiasKaminsky
Copy link
Member

@exstntlmsnthrp can you try this #12263 (comment) ?

Many thanks for your help!

@joshtrichards
Copy link
Member

Fixes crash for me.

@exstntlmsnthrp
Copy link
Author

exstntlmsnthrp commented Dec 11, 2023

@tobiasKaminsky Yes! I can confirm that QA version works as expected and I successfully logged into my NC27 instance without any problems. Thank you and I'm glad to help test. It's the least I can do, since I have no dev skills.

@tobiasKaminsky tobiasKaminsky linked a pull request Dec 11, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants