ACS: Prevent platform bug that can cause ACS to crash and deactivate - #1019
Merged
Conversation
Check if we are launched by a 3rd party and if we are, don't init and abort early. Crashing repeatedly could block the ACS from being launched until reboot. This can happen if the app is launched in a `restricted` mode by the system. e.g. ```java Exception java.lang.RuntimeException: at android.app.ActivityThread.handleCreateService (ActivityThread.java:4681) at android.app.ActivityThread.access$100 (ActivityThread.java:255) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2204) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:238) at android.os.Looper.loop (Looper.java:349) at android.app.ActivityThread.main (ActivityThread.java:8262) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:584) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1034) Caused by java.lang.IllegalStateException: Hilt service must be attached to an @androidentrypoint Application. Found: class android.app.Application at dagger.hilt.internal.Preconditions.checkState (Preconditions.java:2) at dagger.hilt.android.internal.managers.ServiceComponentManager.generatedComponent (ServiceComponentManager.java) at eu.darken.sdmse.automation.core.Hilt_AutomationService.generatedComponent (Hilt_AutomationService.java) at eu.darken.sdmse.automation.core.Hilt_AutomationService.inject (Hilt_AutomationService.java) at eu.darken.sdmse.automation.core.Hilt_AutomationService.onCreate (Hilt_AutomationService.java) at eu.darken.sdmse.automation.core.AutomationService.onCreate (AutomationService.java) at android.app.ActivityThread.handleCreateService (ActivityThread.java:4668) ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check if we are launched by a 3rd party and if we are, don't init and abort early. Crashing repeatedly could block the ACS from being launched until reboot. This can happen if the app is launched in a
restrictedmode by the system.e.g.