yariksoffice / venom Goto Github PK
View Code? Open in Web Editor NEWA lightweight tool that simplifies testing of the process death scenario.
License: MIT License
A lightweight tool that simplifies testing of the process death scenario.
License: MIT License
In Android 14 on init of Venom Service system throws an exception:
java.lang.RuntimeException: Unable to create service com.github.venom.service.VenomService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type ... targetSDK=34
https://developer.android.com/about/versions/14/changes/fgs-types-required
If your app targets Android 14, it must specify appropriate foreground service types.
Like in example
<service
android:name=".MyMediaPlaybackService"
android:foregroundServiceType="mediaPlayback"
android:exported="false">
</service>
I created a pull request with a fix #51
This would an ideal tool for our QA team for testing events that happen after the process has been destroyed. Things like handling push notifications that trigger a cold start for instance.
When I kill process, it auto restarts. Is there a way to block the restart part of it?
And showcase the new kill vs restart feature.
Do you need some help to update those elements?
I keep getting a "RollerToaster keeps stopping" dialog even though my app is closed. I also don't see venom in the notication tray. I believe I hit the "cancel" button in the notifaction tray.
Now like every minute or so I get this dialog, so I looked in logout. I have this same stacktrace over and over and over.
2022-01-26 22:46:51.785 17245-17245/com.rollertoaster.app.free E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.rollertoaster.app.free, PID: 17245
java.lang.RuntimeException: Unable to create application com.rollertoaster.app.MyApplication: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service com.rollertoaster.app.free/com.github.venom.service.VenomService
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6730)
at android.app.ActivityThread.access$1500(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service com.rollertoaster.app.free/com.github.venom.service.VenomService
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
at android.os.Parcel.readParcelable(Parcel.java:3333)
at android.os.Parcel.createExceptionOrNull(Parcel.java:2420)
at android.os.Parcel.createException(Parcel.java:2409)
at android.os.Parcel.readException(Parcel.java:2392)
at android.os.Parcel.readException(Parcel.java:2334)
at android.app.IActivityManager$Stub$Proxy.startService(IActivityManager.java:5971)
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1847)
at android.app.ContextImpl.startForegroundService(ContextImpl.java:1823)
at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:779)
at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(ContextCompat.java:931)
at androidx.core.content.ContextCompat.startForegroundService(ContextCompat.java:703)
at com.github.venom.service.ServiceDelegate.startService(ServiceDelegate.kt:12)
at com.github.venom.Venom.start(Venom.kt:61)
at com.github.venom.Venom.initialize(Venom.kt:52)
at com.github.venom.Venom.initialize$default(Venom.kt:49)
at com.github.venom.Venom.initialize(Unknown Source:2)
at com.rollertoaster.app.MyApplication.onCreate(MyApplication.java:388)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6725)
at android.app.ActivityThread.access$1500(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActiveServices.startServiceLocked(ActiveServices.java:691)
at com.android.server.am.ActiveServices.startServiceLocked(ActiveServices.java:616)
at com.android.server.am.ActivityManagerService.startService(ActivityManagerService.java:11850)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2519)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2498)
```
Can we do anything about it?
Android 12 has changes with pending intents which requires declaration of mutability. https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability
Venom uses its own SharedPreferences
file to store its active
state: VenomPreferenceManager.kt
.
Unfortunately this state is private and leads to some issues.
For instance, suppose my app is bundled with a dedicated debug panel where you can toggle features.
There is currently no way (other than hardcoding the same SharedPreferences file name and key) to sync with Venom internal state.
Disabling Venom with the cancel
notification action will not change the host setting, and vice-versa. Which means that, when the app is later re-started, my host will try to start Venom again.
It would be great to allow the host to get, or even set this internal state. Maybe setActive
/isActive
isn't the right wording for that.
Hey,
I just wanted to inform, since Venom is running as a Foreground Service, calling: adb shell am kill <app-id>
will not work, since that was the thing I was using usually, maybe we could make others aware as well by putting it into read me?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.