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

Crashing in onInit() #156

Closed
androidacy-user opened this issue Jul 6, 2023 · 4 comments
Closed

Crashing in onInit() #156

androidacy-user opened this issue Jul 6, 2023 · 4 comments

Comments

@androidacy-user
Copy link

androidacy-user commented Jul 6, 2023

When using a minified Kotlin app, Shell.onInit() crashes complaining about a null Context parameter.

Full stacktrace from Sentry:

java.lang.NullPointerException: Parameter specified as non-null is null: method com.fox2code.mmm.installer.InstallerInitializer.a, parameter context
    at com.fox2code.mmm.installer.InstallerInitializer.a(SourceFile:3)
    at com.topjohnwu.superuser.internal.BuilderImpl.build(SourceFile:157)
    at com.topjohnwu.superuser.internal.BuilderImpl.build(SourceFile:136)
    at com.topjohnwu.superuser.internal.BuilderImpl.build(SourceFile:103)
    at com.topjohnwu.superuser.internal.MainShell.get(SourceFile:52)
    at com.topjohnwu.superuser.Shell.getShell
    at com.topjohnwu.superuser.io.SuFile.getShell(SourceFile:146)
    at com.topjohnwu.superuser.io.SuFile.cmdBool(SourceFile:133)
    at com.topjohnwu.superuser.io.SuFile.isDirectory(SourceFile:347)
    at com.topjohnwu.superuser.io.SuFile.list(SourceFile:562)
    at com.topjohnwu.superuser.io.SuFile.list
    at com.fox2code.mmm.manager.ModuleManager.scanInternal(SourceFile:55)
    at com.fox2code.mmm.utils.SyncManager.update(SourceFile:37)
    at com.fox2code.mmm.utils.SyncManager.scan
    at com.fox2code.mmm.utils.SyncManager.scanAsync$lambda$0
    at androidx.activity.ComponentActivity$$InternalSyntheticLambda$1$f7979a7b7286ed37b664e8d41a94ec65e3d54774ca037fa175dd9df0faa673c4$0.run$bridge(SourceFile:0)
    at java.lang.Thread.run(Thread.java:1012)

Our InstallerInitializer extends Shell.Initializer.

@Fox2Code
Copy link
Contributor

Fox2Code commented Jul 7, 2023

have nothing to do with this.
I have not touched the app in months because health issues.
I'm sorry in advance for having health issues, I wish I could have helped more.

@androidacy-user
Copy link
Author

have nothing to do with this.
I have not touched the app in months because health issues.
I'm sorry in advance for having health issues, I wish I could have helped more.

It's not a bug in AMM/FoxMMM I don't believe. We simply override the method, we don't call it ourselves. libsu does on shell creation and it randomly isn't getting a Context.

We have mitigated the issue somewhat but it's insufficient for background tasks (we loop up to five times, with a wait between, to get the first shell)

@androidacy-user
Copy link
Author

androidacy-user commented Jul 7, 2023

Note this issue doesn't occur almost at all on debug builds and did not occur with a pure java app, if that helps any.

@androidacy-user
Copy link
Author

With the ability to pass context to the builder this is resolved.

However, custom initializers seem to have other issues, but that's not directly related so we'll close this issue.

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

2 participants