GithubHelp home page GithubHelp logo

talsec / free-rasp-flutter Goto Github PK

View Code? Open in Web Editor NEW
172.0 8.0 16.0 28.56 MB

Flutter library for improving app security and threat monitoring on Android and iOS mobile devices.

Home Page: https://github.com/talsec/Free-RASP-Community

License: MIT License

Kotlin 3.63% Ruby 0.52% Swift 1.56% Objective-C 0.47% Dart 13.41% C 74.81% C++ 5.60%
flutter flutter-library flutter-package flutter-plugin flutter-security flutter-tools flutter-app-shielding flutter-application-security flutter-frida flutter-rasp

free-rasp-flutter's People

Contributors

matussikyna avatar msikyna avatar sirionrazzer avatar syakymchuk avatar talsec-app avatar tompsota avatar yardexx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

free-rasp-flutter's Issues

Not working in Android

Hi,

Callback functions does not detect even I open the app on emulator. I think onDebuggerDetected trigger.
In ios, there is nothing wrong.

Output is

Accessing hidden method Lcom/android/internal/os/PowerProfile;-><init>(Landroid/content/Context;)V (unsupported, reflection, allowed)
W/PowerProfile(16444): ambient.on is deprecated! Use ambient.on.display0 instead.
W/PowerProfile(16444): screen.on is deprecated! Use screen.on.display0 instead.
W/PowerProfile(16444): screen.full is deprecated! Use screen.full.display0 instead.
W/*****(16444): Accessing hidden method Lcom/android/internal/os/PowerProfile;->getBatteryCapacity()D (unsupported, reflection, allowed)
I/DrmHal  (16444): found instance=clearkey [email protected]::IDrmFactory
I/DrmHal  (16444): found instance=default [email protected]::IDrmFactory
I/DrmHal  (16444): found instance=widevine [email protected]::IDrmFactory
E/HMSSDK_HMSPackageManager(16444): resolveInfoList is null or empty
E/HMSSDK_HMSPackageManager(16444): PackagePriorityInfo list is null
E/HMSSDK_HMSPackageManager(16444): <initHmsPackageInfoForMultiService> Failed to find HMS apk
I/HMSSDK_HMSPackageManager(16444): Enter getHMSPackageNameForMultiService
E/HMSSDK_HMSPackageManager(16444): resolveInfoList is null or empty
E/HMSSDK_HMSPackageManager(16444): PackagePriorityInfo list is null
E/HMSSDK_HMSPackageManager(16444): <initHmsPackageInfoForMultiService> Failed to find HMS apk
I/HMSSDK_HuaweiMobileServicesUtil(16444): hmsPackageName is com.huawei.hwid
E/HMSSDK_HMSPackageManager(16444): resolveInfoList is null or empty
E/HMSSDK_HMSPackageManager(16444): PackagePriorityInfo list is null
E/HMSSDK_HMSPackageManager(16444): <initHmsPackageInfoForMultiService> Failed to find HMS apk
I/HMSSDK_HuaweiMobileServicesUtil(16444): HMS is not installed
I/HMSSDK_HMSPackageManager(16444): enter asyncOnceCheckMDMState
I/HMSSDK_HMSPackageManager(16444): quit asyncOnceCheckMDMState
I/TestLibrary(16444): REQ OK
I/EngineFactory(16444): Provider GmsCore_OpenSSL not available

Not receiving Watcher Alert emails

I am using FreeRasp v3.0.2 on my Flutter app. Flutter version is 3.3.2 (as of today). I am not receiving any Watcher email alerts after updating the FreeRasp to version 3.0.0 and above on my Production as well as UAT builds. I was successfully receiving the alerts previously but after updating to 3.0.0, I stopped receiving the mails. I have correctly configured the watcher email field to my gmail as well, I have also written separate config for android and iOS as well. Still not receiving any mail, kindly help in solving the issue as I don't know what configuration error I have made (I have not changed the same from the beginning).
Is there a way to test the mail sending functionality?

iOS build error, TalsecRuntime module not found

On android works great, but on ios I can't build the app since won't find the TalsecRuntime module
here is the error:

    /Users/macbookpro/Documents/flutterSDK/.pub-cache/hosted/pub.dartlang.org/freerasp-1.0.0/ios/Classes/SwiftFreeraspPlugin.swift:3:8: error: no such module
    'TalsecRuntime'
    import TalsecRuntime
                ^
    /Users/macbookpro/Documents/flutterSDK/.pub-cache/hosted/pub.dartlang.org/freerasp-1.0.0/ios/Classes/SwiftFreeraspPlugin.swift:3:8: error: no such module
    'TalsecRuntime'
    import TalsecRuntime
                ^

java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference

Can not reproduce this NPE locally. It happened on Android 11 & 12 for a few users.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
       at com.aheaditec.talsec.security.k1.e(SourceFile:10)
       at com.aheaditec.talsec.security.k1.g(SourceFile:10)
       at com.aheaditec.talsec.security.k1.$r8$lambda$llnNtpFpp0MEWB0RhtqrUDAuXaY(SourceFile)
       at com.aheaditec.talsec.security.k1$$InternalSyntheticLambda$1$fa5e170b00cd179a7b8aca1202b01d848d1d21c7b74151c65d5fdb6fc8039d8d$0.run(k1.java:4)
       at com.aheaditec.talsec.security.m1.a(SourceFile:25)
       at com.aheaditec.talsec.security.k1.d(SourceFile:1)
       at com.aheaditec.talsec.security.k1.a(SourceFile:2)
       at com.aheaditec.talsec.security.s1.d(SourceFile:3)
       at com.aheaditec.talsec.security.s1.$r8$lambda$DEiFfqTS15ahlVEiavfeOkwe6KI(SourceFile)
       at com.aheaditec.talsec.security.s1$$InternalSyntheticLambda$1$70e647751427081963304fa1c05aa9eb4e5c1786996cb107c2e81f823c0c2dce$0.run(s1.java:4)
       at java.lang.Thread.run(Thread.java:923)

Build module Fail in IOS

Hi, I install this plugin but it failed to compile.

here is the error message

Failed to build module 'TalsecRuntime' from its module interface; the compiler that produced it, 'Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)'

Flutter (Channel stable, 2.5.0, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
• Flutter version 2.5.0
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (6 months ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Platform android-31, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode12.5.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Community Edition (version 2021.1.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

Could you please help? thanks

feat: Rerun checks when coming from background

I have added free-rasp at the entry point of our app. When app is open for the first time, all call-backs coming from andoirdCallbacks are working.

But then, I will press back button from android device, the app is closed, and when I will open the app again (without clearing app from Recent menu) then call-backs are not working. If I remove app from Recent menu, and then open the app again then it is working again.

Technically, if app is open at any point of time, call-backs should work.

Using freerasp 3.0.1 version.

Build fails on Profile mode with FreeRASP

While applicatiion build successfully on Debug and Release modes, it fails on Profile mode.

Here is console output.

Launching lib/main.dart on SM A115F in profile mode...
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (4, 22): Unresolved reference: talsec_security
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (5, 22): Unresolved reference: talsec_security
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (6, 22): Unresolved reference: talsec_security
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (10, 49): Unresolved reference: ThreatListener
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (20, 22): Unresolved reference: TalsecConfig
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (26, 9): Unresolved reference: ThreatListener
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (27, 9): Unresolved reference: Talsec

e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (34, 5): 'onRootDetected' overrides nothing
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (39, 5): 'onDebuggerDetected' overrides nothing
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (43, 5): 'onEmulatorDetected' overrides nothing

e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (47, 5): 'onTamperDetected' overrides nothing
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (51, 5): 'onHookDetected' overrides nothing

e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (55, 5): 'onDeviceBindingDetected' overrides nothing
e: /Users/suleymancalik/Development/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-2.0.0/android/src/main/kotlin/com/aheaditec/freerasp/TalsecApp.kt: (59, 5): 'onUntrustedInstallationSourceDetected' overrides nothing

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':freerasp:compileProfileKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 57s
Exception: Gradle task assembleDevProfile failed with exit code 1
#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:400:9)
<asynchronous suspension>
#2      AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:179:5)
<asynchronous suspension>
#3      AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:579:7)
<asynchronous suspension>
#4      FlutterDevice.runCold (package:flutter_tools/src/resident_runner.dart:501:33)
<asynchronous suspension>
#5      ColdRunner.run (package:flutter_tools/src/run_cold.dart:71:28)
<asynchronous suspension>
#6      AppDomain.launch.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:621:9)
<asynchronous suspension>
#7      AppDomain.launch (package:flutter_tools/src/commands/daemon.dart:619:5)
<asynchronous suspension>
#8      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:571:15)
<asynchronous suspension>
#9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11     CommandRunner.runCommand
<asynchronous suspension>
#12     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#15     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#17     main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>

Exited (sigterm)

bug: Unwanted Tampered detected issue

When downloading app from playstore with freeRASP in some devices, it is giving "Tampered Detected" error, whereas the device is not tampered.

Mostly we are observing this on Samsung and One plus devices.

Using freeRASP version 3.0.1.

FreeRASP not working in iOS in Debug/Release mode

I am using M1 based MAC having Xcode version 13.4.1. FreeRASP version is 2.0.0 as well. In android Freerasp is detecting root/emulator etc. but in iOS the package is not detecting anything. If I remember correctly when I began developing the app, I installed free rasp first and checked whether its detecting emulator/jailbroken etc. that was on Intel based MAC. After that I continued with development on M1 based MAC and after the app is almost completed I once again checked whether FREERASP is working. But as I mentioned its not detecting anything in iOS. There is no error as well.
I am occasionally getting an error while doing Hot restart like mentioned below:-

The following MissingPluginException was thrown while activating platform stream on channel plugins.aheaditec.com/events:
MissingPluginException(No implementation found for method listen on channel plugins.aheaditec.com/events)

When the exception was thrown, this was the stack
#0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:165

#1 EventChannel.receiveBroadcastStream.
package:flutter/…/services/platform_channel.dart:506

I searched for the above mentioned error as did as mentioned in #6 and got information that it was solved in latest versions. But I am still getting this error. Is this connected to FreeRasp not detecting emulator/jailbroken/ any detection for that matter.

I am currently on flutter version 3.0.5. Please help me solve this issue.

Bypass Every Methods

Hi,

I created a new flutter project to test freerasp capabilities and found out that jailbreak detection could be bypass using hopper and NOP region.
I'm also aware that anti tampering protection and other methods are still valid (didn't test to bypass them yet) so even if someone bypass jb detection the framework should still be able to inform the app about that.

So I'm just opening this one to let you know what you probably already know.

Feel free to close this if you think that jb detection bypass is not a big deal and thanks for your amazing framework.

Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release

Hi,

When running in Gitlab CI/CD, SOMETIMES the build crashes:

...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeProdReleaseAssets'.
> Could not resolve all files for configuration ':app:prodReleaseRuntimeClasspath'.
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app
      > Skipped due to earlier error
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app
      > Skipped due to earlier error
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app > project :freerasp
      > Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org/
BUILD FAILED in 6m 58s
Running Gradle task 'bundleProdRelease'...                        419.4s
Gradle task bundleProdRelease failed with exit code 1

Should I declare the package's Maven repositories? If yes, what is the URL?

Thanks.

Crash in Android 8.0.0

We have seen this from a Android 8.0.0 device in the while, apparently causing a complete crash of the app.

OS Version: Android 8.0.0 (R16NW.A520WVLSECTJ1)
Report Version: 104

Exception Type: Unknown (SIGSEGV)

Application Specific Information:
Segfault

Thread 0 Crashed:
0   libc.so                         0x7ee620f758        pthread_mutex_lock
1   libc.so                         0x7ee61c6b4c        readdir
2   split_config.arm64_v8a.apk      0x7ebac4eccc        idr
3   split_config.arm64_v8a.apk      0x7ebac4fb84        Java_com_aheaditec_talsec_1security_security_Natives_a
4   base.odex                       0x7ec50fcdfc        oatexec

Hello,

Hello,

application is considered tampered if it has incorrect package name or if it was signed/resigned with an unknown signing key (signing certificate mismatch). If the application is installed from an untrusted application store, onUntrustedInstallationDetected is triggered. Please verify, that your expectedSigningCertificateHash is correct. You can use this link for Base64 -> Hex conversion: https://base64.guru/converter/decode/hex
We will try to add expectedSigningCertificateHash checks to the next version of Talsec.

Talsec Team

Originally posted by @talsec-app in #12 (comment)


Hello,

onPackageTamperDetected is getting called when I am installing the release build in emulator as well as real device. I have certain doubt regarding the expectedSigningCertificateHash.

sha256 value is in the format 'xx:xx:xx:xx:xx' right? So should we covert that to Base64 format?
I converted to Base64. format using the code base64.encode(utf8.encode(xx:xx:xx:xx:xx)). Is it the right way?
The above link provided converts base64 to hex value and I am not getting back mu sha256 value from the encoded one. So should I convert sha256 to hex and then hex to base64?
Please revert at the earliest as I am wanna make sure all the checks works before continuing my work. Thanks is advance.

Duplicate class a.a.a.a found

When building the app with freeRASP SDK on Android, I'm getting the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkAppDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class a.a.a.a found in modules jetified-TalsecSecurity-Community-Flutter-4.2.1-dev-runtime (com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.1-dev) and jetified-dv-3.9.2-runtime (com.jumio.android:dv:3.9.2)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 49s

Seems like the other lib has obfuscated a.a.a.a class too.

The solution could be to change ProGuard configuration with -keeppackagenames or -flattenpackagehierarchy flags or to use

-useuniqueclassmembernames
-keeppackagenames doNotKeepAThing

as described here.

Root detected on unrooted AVD system images

I have added freeRASP to my app and I can confirm that root is detected on a rooted API 31 level system image using an android emulator. I can also confirm that android emulators using unrooted system images with API level 31 or higher do not get detected, as I would expect. The trouble is that any android emulator running an unrooted system image with API level 30 or lower (I've tested down to API level 27) always get detected as a rooted device.

Here is the main.dart I used for testing:

import 'package:flutter/material.dart';
import 'package:freerasp/talsec_app.dart';

void main() {
  runApp(const MyApp());
  initFreeRASP();
}

void initFreeRASP() {
  final callback = TalsecCallback(
    androidCallback: AndroidCallback(
      onRootDetected: () => print('ROOT DETECTED'),
    ),
    iosCallback: const IOSCallback(),
  );
  final app = TalsecApp(
    config: TalsecConfig(
      watcherMail: '[email protected]',
      androidConfig: AndroidConfig(
        expectedPackageName: 'abc',
        expectedSigningCertificateHash:
            'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE=',
      ),
      iosConfig: const IOSconfig(
        appBundleId: 'abc',
        appTeamId: 'abc123',
      ),
    ),
    callback: callback,
  );
  app.start();
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => Container();
}

Here are the android emulator configurations I have tested (all unrooted):

  • Pixel 5 API 30
  • Pixel 4a API 30
  • Pixel 3a XL API 29
  • Pixel 3 XL API 28
  • Pixel 3 XL API 27

bug: iOS app crash on hot restart

When I am hot restarting flutter app in ios devices, then it is crashing.

Used the same code as mentioned in example.

Have tried to comment out
app.start();
afterwards Hot restart works fine.

But when it is not commented, then unable to hot restart flutter app.

Using freerasp version 3.0.1

FreeRASP is not working as intended in a Flutter app despite proper configuration as depicted in their website

We have developed a Flutter app and recently added FreeRASP. Below is the code.

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:freerasp/talsec_app.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  ...
  runApp(MyApp(...));
}

class MyApp extends StatefulWidget {
  const MyApp({...})
      : super(key: key);
  ...
  @override
  _MyAppState createState() =>
      _MyAppState(...);
}

class _MyAppState extends State<MyApp> {
  _MyAppState({...});

  ...

  @override
  void initState() {
    super.initState();
    initSecurityState();
  }

  Future<void> initSecurityState() async {
    TalsecConfig config = TalsecConfig(
      // For Android
      androidConfig: AndroidConfig(
        expectedPackageName: 'com.company.mypackage',
        expectedSigningCertificateHash: 'xxxxxxxx',
        supportedAlternativeStores: ["com.sec.android.app.samsungapps"],
      ),

      // Common email for Alerts and Reports
      watcherMail: '[email protected]',
    );
    TalsecCallback callback = TalsecCallback(
      // For Android
      androidCallback: AndroidCallback(
        onRootDetected: () => exit(0),
        onEmulatorDetected: () => exit(0),
        onHookDetected: () => exit(0),
        onTamperDetected: () => exit(0),
        onDeviceBindingDetected: () => print('device binding'),
        onUntrustedInstallationDetected: () => print('untrusted install'),
      ),
      // Common for both platforms
      onDebuggerDetected: () => print('debugger'),
    );

    TalsecApp app = TalsecApp(
      config: config,
      callback: callback,
    );

    app.start();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(...);
  }
}

But when it is run on an emulator, it is not even detecting that, even though we have directed it to exit(0) in that case. On debugging, the execution of app.start() gives the following log. Please advise.

W/india.mobileap( 4242): Accessing hidden method Lcom/android/internal/os/PowerProfile;-><init>(Landroid/content/Context;)V (unsupported, reflection, allowed)
W/PowerProfile( 4242): ambient.on is deprecated! Use ambient.on.display0 instead.
W/PowerProfile( 4242): screen.on is deprecated! Use screen.on.display0 instead.
W/PowerProfile( 4242): screen.full is deprecated! Use screen.full.display0 instead.
W/india.mobileap( 4242): Accessing hidden method Lcom/android/internal/os/PowerProfile;->getBatteryCapacity()D (unsupported, reflection, allowed)
I/DrmHal  ( 4242): found instance=clearkey [email protected]::IDrmFactory
I/DrmHal  ( 4242): found instance=default [email protected]::IDrmFactory
I/DrmHal  ( 4242): found instance=widevine [email protected]::IDrmFactory
E/HMSSDK_HMSPackageManager( 4242): resolveInfoList is null or empty
E/HMSSDK_HMSPackageManager( 4242): PackagePriorityInfo list is null
E/HMSSDK_HMSPackageManager( 4242): <initHmsPackageInfoForMultiService> Failed to find HMS apk
I/HMSSDK_HMSPackageManager( 4242): Enter getHMSPackageNameForMultiService
E/HMSSDK_HMSPackageManager( 4242): resolveInfoList is null or empty
E/HMSSDK_HMSPackageManager( 4242): PackagePriorityInfo list is null
E/HMSSDK_HMSPackageManager( 4242): <initHmsPackageInfoForMultiService> Failed to find HMS apk
I/HMSSDK_HuaweiMobileServicesUtil( 4242): hmsPackageName is com.huawei.hwid
E/HMSSDK_HMSPackageManager( 4242): resolveInfoList is null or empty
E/HMSSDK_HMSPackageManager( 4242): PackagePriorityInfo list is null
E/HMSSDK_HMSPackageManager( 4242): <initHmsPackageInfoForMultiService> Failed to find HMS apk
I/HMSSDK_HuaweiMobileServicesUtil( 4242): HMS is not installed
I/HMSSDK_HMSPackageManager( 4242): enter asyncOnceCheckMDMState
I/HMSSDK_HMSPackageManager( 4242): quit asyncOnceCheckMDMState
W/System  ( 4242): A resource failed to call close. 
I/TestLibrary( 4242): Failed with error code 7
W/System  ( 4242): A resource failed to call close

Problems with checks in Release Mode

Hi!
I'm trying to use this library to secure the project I'm working on. The problem is that I have a lot of problems with some check that I will list below:

Android

  • Root check: In both DEV and RELEASE mode, the emulator and the physical device is detected as Rooted while it's not (tested on Xiaomi Redmi Note 8).
  • Tamper check: I'm having problem with this check. I tried to generate the hash code in numerous ways but every time I run the app in release mode, the check fails... Is there a tutorial on how to generate the hash code? I'm generating it starting from the upload keystore
  • Untrusted installation: This triggers every time I start the app through flutter run... how it should work properly? It triggers every time the user install the app from outside the playstore? Is there the possibility to have a "white list"?

IOs

  • Signature check: it's triggered even if the bundleid and teamId are correct
  • Passcode features refers to FaceID and similar?

I'm sure at 100% that I'm using the release mode when it's necessary

Thanks in advance!

Frida ByPass Possible

I´m testing the solution, but with "anti-frida-bypass" is possible to avoid the checks.

Adroid Enterprise support

Does this library support android enterprise?

I'm using this library to write an app for this version of android and the devices are detected as tampered.
The "non Android Enterprice" devices works correctly

If this library doesn't support this particular version of Android, will support it in future?

bug: UnsatisfiedLinkError in Flutter release version

Release version on Play Store crashes with stack trace:

Exception java.lang.UnsatisfiedLinkError:
  at com.aheaditec.talsec_security.security.Natives.b (Natives.java)
  at com.aheaditec.talsec_security.security.Natives.d (Natives.java)
  at com.aheaditec.talsec.security.p1.a (p1.java:7)
  at com.aheaditec.talsec.security.o1.b (o1.java:7)
  at com.aheaditec.talsec.security.o1.g (o1.java:7)
  at com.aheaditec.talsec.security.o1.lambda$pQuqSPVg98SPzityJyeCuWmt-cM (o1.java:7)
  at com.aheaditec.talsec.security.-$$Lambda$o1$pQuqSPVg98SPzityJyeCuWmt-cM.run (-.java:7)
  at com.aheaditec.talsec.security.b.a (b.java)
  at com.aheaditec.talsec.security.o1.d (o1.java:1)
  at com.aheaditec.talsec.security.o1.a (o1.java:1)
  at com.aheaditec.talsec.security.z1.d (z1.java:1)
  at com.aheaditec.talsec.security.z1.lambda$R8aaFX36gDYmbo_QFUzjIfRwELs (z1.java:1)
  at com.aheaditec.talsec.security.-$$Lambda$z1$R8aaFX36gDYmbo_QFUzjIfRwELs.run (-.java:1)
  at java.lang.Thread.run (Thread.java:1012)

Google reports these crashes as being on samsung p3q & samsung r8q and it also fails locally on Pixel 7 Pro.

I tried using the Free-RASP-Community suggestion

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.google.android.gms:play-services-ads:21.4.0"
    implementation "com.android.billingclient:billing:5.1.0"
    // Talsec Release
    releaseImplementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.0.0-release'
    // Talsec Debug
    // implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.0.0-dev'
}

but (probably not surprising) this gave me

Launching lib\main.dart on Pixel 7 Pro in release mode...
√  Built build\app\outputs\flutter-apk\app-release.apk (15.0MB).
E/AndroidRuntime(11270): FATAL EXCEPTION: Thread-5
E/AndroidRuntime(11270): Process: app.fourfit.fourfit, PID: 11270
E/AndroidRuntime(11270): java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String[] e.a.c.a.a.f() (tried Java_e_a_c_a_a_f and Java_e_a_c_a_a_f__)
E/AndroidRuntime(11270): 	at e.a.c.a.a.f(Native Method)
E/AndroidRuntime(11270): 	at e.a.c.a.a.k(Unknown Source:0)
E/AndroidRuntime(11270): 	at e.a.b.a.e.run(:7)
E/AndroidRuntime(11270): 	at e.a.b.a.p.c(Unknown Source:8)
E/AndroidRuntime(11270): 	at e.a.b.a.i0.b(:1)
E/AndroidRuntime(11270): 	at e.a.b.a.h.run(:1)
E/AndroidRuntime(11270): 	at java.lang.Thread.run(Thread.java:1012)
I/flutter (11270): _loadLocal result: false

I'm running:

  • Flutter 3.7.12
  • Dart 2.19.6
  • freerasp: ^4.0.0
  • VS Code

Everything works fine in debug AND profile modes. Thanks for any help :-)

Package not working for me

I am interested in this package

I used it as follows in documntion but it detected nothing ..

I used SHA1 that I got from gradlew signingReport command so I am not sure if it's the right way
it was under the following lines

 Task :app:signingReport
Variant: debug
Config: debug
Store: C:\Users\myuserhere\.android\debug.keystore
Alias: AndroidDebugKey
MD5: here is md5
SHA1: here is the one I used ..

image

image
`
image
image
image

    • Result on Emulator for app-relase Memu Emulator *

image

I did something wrong or there is a problem that emualtor not getting detected ? I know there is a different between debug and relase but not understanding if I did mistake relayed to that ... not professional to know that details

Error on android

Hi,

I follow the example and got the following error in android.

MissingPluginException(No implementation found for method setConfig on channel plugins.aheaditec.com/config)
I/flutter ( 8987): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)

Could you please help take a look? thanks

How to test features?

After following the Readme file and implementing the code, I do not know if this is working or not.
The doc says something about Dev and Release version, but not much information.

I tried running the app in Debug mode, hoping that the onDebuggerDetected callback is called, but I don't see any output.

ANR in production on init

Hi, several ANR's in production shown in Play Console and Crashlytics for Flutter Android.
Android versions: 9, 10, 11, 12.
Can't reproduce it locally, I hope the logs help.

  #00  pc 0x000000000009aec4  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
  #01  pc 0x0000000000057ca0  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02  pc 0x000000000008808c  /system/lib64/libhidlbase.so (android::hardware::IPCThreadState::transact(int, unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int)+564)
  #03  pc 0x000000000008353c  /system/lib64/libhidlbase.so (android::hardware::BpHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+76)
  #04  pc 0x000000000007caa0  /system/lib64/libhidlbase.so (android::hidl::base::V1_0::BpHwBase::_hidl_interfaceChain(android::hardware::IInterface*, android::hardware::details::HidlInstrumentor*, std::__1::function<void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>)+248)
  #05  pc 0x000000000007db0c  /system/lib64/libhidlbase.so (android::hidl::base::V1_0::BpHwBase::interfaceChain(std::__1::function<void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>)+144)
  #06  pc 0x000000000004b590  /system/lib64/libhidlbase.so (android::hardware::details::canCastInterface(android::hidl::base::V1_0::IBase*, char const*, bool)+292)
  #07  pc 0x000000000004e5f0  /system/lib64/libhidlbase.so (android::hardware::details::getRawServiceInternal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool)+1088)
  #08  pc 0x000000000003b61c  /system/lib64/<EMAIL_ADDRESS> (android::sp<android::hardware::drm::V1_0::IDrmFactory> android::hardware::details::getServiceInternal<android::hardware::drm::V1_0::BpHwDrmFactory, android::hardware::drm::V1_0::IDrmFactory, void, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool)+96)
  #09  pc 0x0000000000022730  /system/lib64/libmediadrm.so (android::hardware::drm::V1_0::IDrmFactory::getService(android::hardware::hidl_string const&, bool)+176)
  #10  pc 0x000000000002256c  /system/lib64/libmediadrm.so (std::__1::__function::__func<void android::DrmUtils::(anonymous namespace)::MakeHidlFactories<android::hardware::drm::V1_0::IDrmFactory, std::__1::vector<android::sp<android::hardware::drm::V1_0::IDrmFactory>, std::__1::allocator<android::sp<android::hardware::drm::V1_0::IDrmFactory> > > >(unsigned char const*, std::__1::vector<android::sp<android::hardware::drm::V1_0::IDrmFactory>, std::__1::allocator<android::sp<android::hardware::drm::V1_0::IDrmFactory> > >&)::'lambda'(android::hardware::hidl_vec<android::hardware::hidl_string> const&), std::__1::allocator<void android::DrmUtils::(anonymous namespace)::MakeHidlFactories<android::hardware::drm::V1_0::IDrmFactory, std::__1::vector<android::sp<android::hardware::drm::V1_0::IDrmFactory>, std::__1::allocator<android::sp<android::hardware::drm::V1_0::IDrmFactory> > > >(unsigned char const*, std::__1::vector<android::sp<android::hardware::drm::V1_0::IDrmFactory>, std::__1::allocator<android::sp<android::hardware::drm::V1_0::IDrmFactory> > >&)::'lambda'(android::hardware::hidl_vec<android::hardware::hidl_string> const&)>, void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>::operator()(android::hardware::hidl_vec<android::hardware::hidl_string> const&)+116)
  #11  pc 0x000000000006749c  /system/lib64/libhidlbase.so (std::__1::__function::__func<android::hidl::manager::V1_0::BpHwServiceManager::_hidl_list(android::hardware::IInterface*, android::hardware::details::HidlInstrumentor*, std::__1::function<void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>)::$_5, std::__1::allocator<android::hidl::manager::V1_0::BpHwServiceManager::_hidl_list(android::hardware::IInterface*, android::hardware::details::HidlInstrumentor*, std::__1::function<void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>)::$_5>, void (android::hardware::Parcel&)>::operator()(android::hardware::Parcel&)+300)
  #12  pc 0x0000000000083558  /system/lib64/libhidlbase.so (android::hardware::BpHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+104)
  #13  pc 0x0000000000076c6c  /system/lib64/libhidlbase.so (android::hidl::manager::V1_2::BpHwServiceManager::_hidl_listManifestByInterface(android::hardware::IInterface*, android::hardware::details::HidlInstrumentor*, android::hardware::hidl_string const&, std::__1::function<void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>)+312)
  #14  pc 0x00000000000775c8  /system/lib64/libhidlbase.so (android::hidl::manager::V1_2::BpHwServiceManager::listManifestByInterface(android::hardware::hidl_string const&, std::__1::function<void (android::hardware::hidl_vec<android::hardware::hidl_string> const&)>)+156)
  #15  pc 0x0000000000021648  /system/lib64/libmediadrm.so (android::DrmUtils::MakeDrmFactories(unsigned char const*)+208)
  #16  pc 0x00000000000154f4  /system/lib64/libmediadrm.so (android::DrmHal::makeDrmFactories()+48)
  #17  pc 0x0000000000015674  /system/lib64/libmediadrm.so (android::DrmHal::DrmHal()+84)
  #18  pc 0x0000000000021478  /system/lib64/libmediadrm.so (android::DrmUtils::MakeDrm(int*)+48)
  #19  pc 0x00000000000503bc  /system/lib64/libmedia_jni.so (android::JDrm::JDrm(_JNIEnv*, _jobject*, unsigned char const*, android::String8 const&)+164)
  #20  pc 0x0000000000052344  /system/lib64/libmedia_jni.so (android_media_MediaDrm_native_setup(_JNIEnv*, _jobject*, _jobject*, _jbyteArray*, _jstring*)+344)
  at android.media.MediaDrm.native_setup (MediaDrm.java)
  at android.media.MediaDrm.<init> (MediaDrm.java:282)
  at com.aheaditec.talsec.security.t2.b (SourceFile:4)
  at com.aheaditec.talsec.security.t2.a (SourceFile:1)
  at com.aheaditec.talsec.security.t2$a.a (SourceFile:1)
  at com.aheaditec.talsec.security.t2$a.invoke (SourceFile:1)
  at com.aheaditec.talsec.security.d5.a (SourceFile:1)
  at com.aheaditec.talsec.security.t2.a (SourceFile:2)
  at com.aheaditec.talsec.security.p4.<init> (SourceFile:6)
  at com.aheaditec.talsec.security.r.c (SourceFile:6)
  at com.aheaditec.talsec.security.r.b (SourceFile:7)
  at com.aheaditec.talsec.security.r.a (SourceFile:8)
  at com.aheaditec.talsec.security.j.<init> (SourceFile:3)
  at com.aheaditec.talsec.security.y1.a (SourceFile:5)
  at com.aheaditec.talsec.security.r1.<init> (SourceFile:4)
  at com.aheaditec.talsec.security.r1.a (SourceFile:4)
  at com.aheaditec.talsec_security.security.api.Talsec.start (SourceFile:1)
  at com.aheaditec.freerasp.TalsecApp.init (TalsecApp.kt:27)
  at com.aheaditec.freerasp.MethodCallHandlerImpl.init (MethodCallHandlerImpl.kt:54)
  at com.aheaditec.freerasp.MethodCallHandlerImpl.onMethodCall (MethodCallHandlerImpl.kt:21)
  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage (MethodChannel.java:262)
  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler (DartMessenger.java:295)
  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0 (DartMessenger.java:319)
  at io.flutter.embedding.engine.dart.DartMessenger.$r8$lambda$TsixYUB5E6FpKhMtCSQVHKE89gQ (DartMessenger.java)
  at io.flutter.embedding.engine.dart.DartMessenger$$InternalSyntheticLambda$0$ceffc6bae7d364cb48afaf1aaebd60bf9050360d0efb9035ebc54f0851df0a05$0.run (DartMessenger.java)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:250)
  at android.app.ActivityThread.main (ActivityThread.java:7803)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:958)

Failed build iOS with Codemagic

Hello @talsec-app
I tried to build and distribute app within codemagic, but i got this error

Swift Compiler Error (Xcode): No such module 'TalsecRuntime'
/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/freerasp-3.0.1/ios/Classes/SwiftFreeraspPlugin.swift:2:7

Cannot install app from testflight

Used ios instruction, build is going ok, w/o any problems is deployed to testflight

But cannot install from testflight, shows message, that error occurs while installing

cd "${SRCROOT}/.symlinks/plugins/freerasp/ios" if [[ "${CONFIGURATION}" =~ "Release" ]]; then rm -rf ./TalsecRuntime.xcframework ln -s ./Release/TalsecRuntime.xcframework/ TalsecRuntime.xcframework else rm -rf ./TalsecRuntime.xcframework ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework fi

"The app cannot be installed because its integrity could not be verified"

Swift Compiler Error (Xcode): No such module 'TalsecRuntime'

We have used Free-RASP-Flutter for our app. The Android build is working fine, but the iOS one gives the following error.

Swift Compiler Error (Xcode): No such module 'TalsecRuntime'
/Users/eil-its/flutter-sdk/.pub-cache/hosted/pub.dartlang.org/freerasp-3.0.2/ios/Classes/SwiftFreeraspPlugin.swift:2:7

Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.

Please advise.

Get the status of check

Hi,

Is there any way to listen to the checks that are going on . Like if the security check is started and completed , If we can listen to it then we can show a different UI based on the current status , like showing a loading screen when it's checking and showing a login screen when the checks are success and showing a error screen when check did not passed.

Build failed due to duplicated class with App Langa

hey @talsec-app

after following instructions for adding dev and release dependency of the lib, I've encountered duplicated class issue for both build types:

Duplicate class a.a.a.a found in modules jetified-Applanga-3.0.153-runtime (com.applanga.android:Applanga:3.0.153) and jetified-TalsecSecurity-Community-4.2.1-release-runtime (com.aheaditec.talsec.security:TalsecSecurity-Community:4.2.1-release)

For translations in app we are using App Langa

app.gradle:
debugImplementation (com.aheaditec.talsec.security:TalsecSecurity-Community:4.2.1-dev")
implementation ("com.aheaditec.talsec.security:TalsecSecurity-Community:4.2.1-release")

gradle.properties:
android.enableJetifier=true

any thoughts about this one?

Any suggestion would be very helpful,
thanks in advance

Warning on Play store when submitting builds with FreeRasp

When submitting app to the Play store with FreeRASP v3.0.2 we get this warning regarding critical issue with play-services-safetynet com.google.android.gms:play-services-safetynet:18.0.1

image

On investigating further we do see It's being included as a transitive dependency.

image

Error while lauching my app

I've trying to run my app using freerasp and when it's launched I get this error at runtime:

======== Exception caught by services library ======================================================
The following MissingPluginException was thrown while activating platform stream on channel plugins.aheaditec.com/events:
MissingPluginException(No implementation found for method listen on channel plugins.aheaditec.com/events)

When the exception was thrown, this was the stack: 
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
<asynchronous suspension>
#1      EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:506:9)
<asynchronous suspension>

When I remove this line
TalsecApp(callback: callback, config: talsecConfig).start();

It's not throwing it anymore.

I have a dependency on freerasp: ^1.1.0

Have you experienced something alike in the past?

Some of the real devices Is consider as emulator

Describe the bug
i use the package in production and some of our user get onEmulatorDetected()

To Reproduce
try to used the package in this device

Expected behavior
onEmulatorDetected() should not launch

Please complete the following information:

  • Device: [ Samsung Galaxy A11 ]
  • Model: [ SM-A115F ]
  • OS version: [ Android 12 ]
  • Version of freeRASP: [ 4.0.0 ]
  • Users: [ 4 user ]

Additional context
thanks for awesome work .

Not working

I'm testing on Emulator, there is no error. There is no notification that it works. I put print everywhere, nothing happens. What is the problem. Android 12.

onTamperDetected is executed when running on physical device

Hi,

Can you tell me under what conditions this plugin would detect it as a tampering case?

I enabled this onTamperDetected feature in android and found that it was invoked on a physical device (developer mode is enable) and simulator as well. Is this expected behaviour? for example, it restricts the app must be download from google/Apple Store?

Or does it means I did something else wrong? like the expectedSigningCertificateHash is wrong?

Please help. Thanks

expectedSigningCertificateHash

Hey guys.

I'm using such function to get the expectedSigningCertificateHash:
String encodedCert = base64.encode(utf8.encode('MY_SHA-256'));

expectedPackageName - the same value as in AndroidManifest.xml
supportedAlternativeStores - just an empty array ([])

But after I'm running the app in a release mode on the device I'm getting the next:
MissingPluginException(No implementation found for method listen on channel plugins.aheaditec.com/events)
MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165)
EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:506)

For iOS, this lib works fine.

What can I do to make it work on Android too?

libpolarssl.so not found

Describe the bug
When I try to run my app with freerasp 4.0.0 in a android with api 28-30 It crash

To Reproduce
Configure a app with freerasp and run in android api 30

Please complete the following information:

  • Device: Pixel 4a
  • OS version: Android R api 30
  • Version of freeRASP: 4.0.0

Additional context
Logs

E/AndroidRuntime( 5054): java.lang.UnsatisfiedLinkError: dlopen failed: library "libpolarssl.so" not found
E/AndroidRuntime( 5054): at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E/AndroidRuntime( 5054): at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E/AndroidRuntime( 5054): at java.lang.System.loadLibrary(System.java:1664)
E/AndroidRuntime( 5054): at com.aheaditec.talsec.security.z1.(SourceFile:1)
E/AndroidRuntime( 5054): at com.aheaditec.talsec.security.y1.(SourceFile:5)
E/AndroidRuntime( 5054): at com.aheaditec.talsec.security.y1.a(SourceFile:4)
E/AndroidRuntime( 5054): at com.aheaditec.talsec_security.security.api.Talsec.start(SourceFile:1)
E/AndroidRuntime( 5054): at com.aheaditec.freerasp.TalsecApp.init(TalsecApp.kt:27)
E/AndroidRuntime( 5054): at com.aheaditec.freerasp.MethodCallHandlerImpl.init(MethodCallHandlerImpl.kt:54)
E/AndroidRuntime( 5054): at com.aheaditec.freerasp.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:21)
E/AndroidRuntime( 5054): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/AndroidRuntime( 5054): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/AndroidRuntime( 5054): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/AndroidRuntime( 5054): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/AndroidRuntime( 5054): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime( 5054): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5054): at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime( 5054): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime( 5054): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5054): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime( 5054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Deprecated DexFile APIs

I have walked through the guide for adding the package to my project, and I doesn't seem to be working in my project.

I've been missing with the expected values to test if any callback would be invoked, but nothing gets invoked. Instead, I am getting these warnings over and over every 10 seconds

I/System  (24218): Opening DexFile: /data/app/com.test.project.dev-LGO3HZxe32u2d8rLunK-_A==/base.apk
W/est.project.de(24218): Opening an oat file without a class loader. Are you using the deprecated DexFile APIs?
W/System  (24218): A resource failed to call close.

I hope it would help.

Talsec causes app crash at startup

Hi,

we're having some issues with talsec as it is causing a crash at startup. Running the app in debug mode connected to the computer works fine, however, when building an apk and installing it a crash occurs with this error message:

Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String[] R0.a.g() (tried Java_R0_a_g and Java_R0_a_g__)
at com.aheaditec.talsec_security.security.Natives.b(Natives.java)
at com.aheaditec.talsec_security.security.Natives.d(Natives.java)
at a.a.b.c.j.d.a(d.java:2)
at a.a.b.c.j.c.b(c.java:2)
at a.a.b.c.j.c.g(c.java:2)
at a.a.b.c.j.c.$r8$lambda$48_804VhmcnRxfa6ZEcEZfh8_W8(c.java:2)
at a.a.b.c.k.a.a(a.java:1)
at a.a.b.c.j.c.d(c.java:1)
at a.a.b.c.j.c.a(c.java)
at a.a.b.c.k.g.a(g.java:29)
at o.g$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:26)
at java.lang.Thread.run(Thread.java:920)

One thing worth mentioning is that we use two different product flavors, and the issue seems to have occured after this implementation. We're also using different main files for the different flavors (lib/main_prod.dart, lib/main_dev.dart).

Any idea how to solve this issue?

Jailbreak detection bypass

I used free rasp flutter package to detect jailbroken devices and it is working fine, however I can bypass the detection using the liberty lite tool, anyone has an idea how fix this issue?

How to generate HASH_OF_YOUR_APP

The Readme file mentions HASH_OF_YOUR_APP

androidConfig: AndroidConfig(
        expectedPackageName: 'YOUR_PACKAGE_NAME',
        expectedSigningCertificateHash: 'HASH_OF_YOUR_APP',
        supportedAlternativeStores: ["com.sec.android.app.samsungapps"],
      ),

How do we generate this?

flutter sdk integration issue

Why I'm getting following issue when I integrate Free-RSAP sdk. I have fixed it by implementing the code which was in guide of android setup then integration issue gone fixed , app is runnable but not working fine.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.