talsec / Free-RASP-Flutter

Flutter library for improving app security and threat monitoring on Android and iOS mobile devices.
https://github.com/talsec/Free-RASP-Community
MIT License
194 stars 20 forks source link

bug: IllegalStateException Talsec is not running #70

Closed kreativityapps closed 1 year ago

kreativityapps commented 1 year ago

Describe the bug Crashes in release, got this crash log from users in crashlytics:

Caused by java.lang.IllegalStateException: Talsec is not running. at com.aheaditec.talsec_security.security.api.Talsec.stop(SourceFile:6) at com.aheaditec.freerasp.handlers.TalsecThreatHandler.stop$freerasp_release(TalsecThreatHandler.kt:35) at com.aheaditec.freerasp.FreeraspPlugin.onStateChanged(FreeraspPlugin.kt:60) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314) at androidx.lifecycle.LifecycleRegistry.backwardPass(LifecycleRegistry.kt:266) at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.kt:283) at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.kt:136) at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.kt:119) at androidx.lifecycle.ReportFragment$Companion.dispatch$lifecycle_runtime_release(ReportFragment.kt:192) at androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPreDestroyed(ReportFragment.kt:148) at android.app.Activity.dispatchActivityPreDestroyed(Activity.java:1532) at android.app.Activity.performDestroy(Activity.java:8464) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1344) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5660) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5720) at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2325) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8633) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Device state for the crash is 100% in the background so far.

To Reproduce Could not reproduce it locally.

Expected behavior No crash

Screenshots

Please complete the following information:

Additional context My implementation follows closely the example from the repo. Maybe worth mentioning is my proguard rule, which was needed to build the app: -keepclasseswithmembernames,includedescriptorclasses class com.aheaditec.talsec_security.security.Natives { native <methods>; }

msikyna commented 1 year ago

Hello @kreativityapps , we are looking into the issue and fix it soon. Stay tuned!

Kind regards, Talsec team

tompsota commented 1 year ago

Hello @kreativityapps,

We just released freeRASP v5.0.3, please update the package to that version. This should resolve the problem you encountered.

Let us know if this helped.

Best,

Tomas, Talsec developer

yardexx commented 1 year ago

Hello.

Does this issue still persists?

Kind regards, Talsec team

kreativityapps commented 1 year ago

Hi, thank you, it looks good now.