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

Android app not compilable with AGP >= 8.0.0 #80

Closed HE-LU closed 1 year ago

HE-LU commented 1 year ago

Describe the bug The app cannot be compiled when using AGP version 8.0.0 and higher.

To Reproduce Create a new Flutter project, and update your classpath in the app gradle file to:

classpath 'com.android.tools.build:gradle:8.0.2'

and update your gradle wrapper to:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip

Expected behavior App should compile

Screenshots image

Please complete the following information:

Additional context The libs Android project should probably be updated to AGP 8.0.0, and use a namespace instead of applicationId

msikyna commented 1 year ago

Hello @HE-LU ,

thank you for reporting the issue, we will look at it!

Kind regards, Talsec team

xprikryl2 commented 1 year ago

Hi @HE-LU,

You are right. I've managed to reproduce this issue. We will release a new version with the fix soon. In the meantime, you can apply the fix yourself.

Just navigate to the freeRASP folder in your dependencies (in Android Studio, you can find it in External dependencies -> Flutter plugins -> freerasp-6.1.0).

image

In the library root folder (freerasp-6.1.0), navigate to android -> build.gradle file. In this file, add namespace 'com.aheaditec.freerasp' at the beginning of the android section like shown here:

image

It's a small change. I hope it will help you.

Best regards, Talsec Team

HE-LU commented 1 year ago

@yardexx Hey, the namespace is there now. But there is still one more issue:

Incorrect package="com.aheaditec.freerasp" found in source AndroidManifest.xml: /home/helu/.pub-cache/hosted/pub.dev/freerasp-6.2.0/android/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.aheaditec.freerasp" from the source AndroidManifest.xml: /home/helu/.pub-cache/hosted/pub.dev/freerasp-6.2.0/android/src/main/AndroidManifest.xml.

I tried it locally, and it is still required to remove package="com.aheaditec.freerasp" from the Manifest file. After that, it is working fine ;)