Skip to content

fix: RSABridgeCall problem solved for iOS and supported android 16kb#92

Open
gizemgizg wants to merge 1 commit intojerson:masterfrom
gizemgizg:feature/android-16kb
Open

fix: RSABridgeCall problem solved for iOS and supported android 16kb#92
gizemgizg wants to merge 1 commit intojerson:masterfrom
gizemgizg:feature/android-16kb

Conversation

@gizemgizg
Copy link

@gizemgizg gizemgizg commented Feb 3, 2026

Summary by CodeRabbit

  • Chores
    • Updated Android build toolchain and dependencies to latest versions for improved compatibility and security.
    • Upgraded Kotlin and Gradle versions to enhance build performance and stability.
    • Increased JVM memory allocation for faster build processing.
    • Updated Android SDK compilation target to latest standard.
    • Enhanced iOS and Linux platform support with updated native integration layers.

…aries, web assembly, and example project dependencies.
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The pull request modernizes build toolchains and Android SDK versions across the project, upgrades Gradle and Kotlin dependencies in example apps, exposes two new RSA cryptography functions (RSAEncodeText, RSADecodeText) as public APIs across multiple platform-specific JNI headers, introduces LLDB debugging support for iOS Flutter projects, and adds WASM JavaScript polyfills and interop functions.

Changes

Cohort / File(s) Summary
Android/Example Gradle Build Configuration
android/build.gradle, example/android/build.gradle, example/android/gradle.properties, example/android/gradle/wrapper/gradle-wrapper.properties
Updated Android Gradle plugin from 7.1.0 to 8.3.2, Kotlin from 1.7.10 to 1.9.0, compileSdkVersion to 34, Gradle wrapper to 8.5, and increased daemon JVM heap size from 1536M to 4096M.
Native RSA Bridge Headers
android/src/main/jniLibs/{arm64-v8a,armeabi-v7a,x86,x86_64}/librsa_bridge.h, ios/librsa_bridge.h, linux/shared/{aarch64,x86_64}/librsa_bridge.h, windows/shared/librsa_bridge.h
Added two new C function declarations to each platform: RSAEncodeText() returning BytesReturn\* and RSADecodeText() returning char\*, expanding the public cryptography API surface across all native platforms.
Example Android Project Setup
example/android/app/build.gradle, example/android/app/src/main/kotlin/com/example/example/MainActivity.kt, example/android/settings.gradle, example/build_log.txt
Added boilerplate MainActivity extending FlutterActivity, fixed compileSdkVersion to 34, removed app\_plugin\_loader.gradle import, and included full build log documenting compilation errors.
iOS/Flutter Development Support
example/ios/Flutter/ephemeral/flutter_lldb_helper.py, example/ios/Flutter/ephemeral/flutter_lldbinit
Introduced LLDB integration scripts for iOS debugging: helper module with memory write callback and debugger initialization that imports the helper script relative to command file.
Web/WASM Interoperability
lib/web/assets/wasm_exec.js
Added globalThis.path.resolve() polyfill for path segment joining and Go/WASM interop functions (callExport, testCallExport) to facilitate test export delegation within the import object layer.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hops of joy across the platforms wide,
New RSA bridges open with cryptographic pride,
Gradle versions jump and SDK levels rise,
LLDB helpers dance beneath iOS skies,
WASM paths now resolve with a leap and bound!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title partially describes changes in the changeset—it mentions iOS fixes and Android 16kb support—but misses the broader scope of platform updates including Gradle/SDK versions, JNI bridge additions, and example app changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@android/build.gradle`:
- Line 11: AGP 8.3.2 requires Gradle 8.4+ so update the gradle wrapper: edit
android/gradle/wrapper/gradle-wrapper.properties to replace the distributionUrl
pointing to gradle-7.3 with gradle-8.4-all.zip (or newer) to match the classpath
'com.android.tools.build:gradle:8.3.2' entry; ensure the wrapper version is
committed and regenerated if necessary, and verify CI uses JDK 17 and has
Android SDK 34 available for the build environment.

In `@example/android/app/build.gradle`:
- Line 27: The build file currently hard-codes compileSdkVersion 34 which fails
Google Play's requirement; update the value to at least 35 by replacing the
literal "compileSdkVersion 34" with "compileSdkVersion 35" (or higher), or
switch to using Flutter's managed value by replacing it with "compileSdk =
flutter.compileSdkVersion"; locate the occurrence of compileSdkVersion in the
Gradle config and make the change so the project targets compileSdk 35+.

In `@example/android/settings.gradle`:
- Line 20: Update example/android/settings.gradle to require a minimum Flutter
SDK of 3.16.0 (3.19.0 recommended) for the new pluginManagement flow and correct
the plugins block to declare id "dev.flutter.flutter-plugin-loader" (replace any
use of "dev.flutter.flutter-gradle-plugin" here); ensure
"dev.flutter.flutter-gradle-plugin" remains only in app/build.gradle and that
pluginManagement usage follows the Flutter 3.16+ requirements.

In `@example/build_log.txt`:
- Around line 27-29: The file example/build_log.txt contains raw build output
with local paths/PII; remove the sensitive content by deleting this file from
the commit (or fully redact all machine-specific paths/timestamps) and ensure
build logs are not committed in future by adding a rule to .gitignore (or the
repo's ignore config) to exclude build_log.txt or the logs directory; update the
PR to remove the file from history if necessary (or replace it with a sanitized
example) and mention the change in the commit message so reviewers know the PII
was removed.
🧹 Nitpick comments (4)
example/ios/Flutter/ephemeral/flutter_lldb_helper.py (2)

15-20: Avoid enlarging the buffer when page_len < 8.

bytearray slice assignment can resize the buffer, so data[0:8] = ... will expand the buffer when page_len is smaller than 8, and WriteMemory will write more bytes than intended. Please cap the marker to page_len so the buffer length stays consistent.

🛠️ Suggested fix
-    data = bytearray(page_len)
-    data[0:8] = b'IHELPED!'
+    data = bytearray(page_len)
+    marker = b'IHELPED!'
+    if page_len:
+        n = min(len(marker), page_len)
+        data[:n] = marker[:n]

7-7: Silence unused-argument warnings if linting is enforced.

bp_loc, extra_args, and intern_dict are unused; if Ruff is gating builds, consider prefixing with _ (or add a noqa in the generator) to prevent noisy warnings.

🧹 Suggested fix
-def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
+def handle_new_rx_page(frame: lldb.SBFrame, _bp_loc, _extra_args, _intern_dict):
lib/web/assets/wasm_exec.js (1)

76-82: Path.resolve polyfill is too minimal; may break callers expecting Node semantics.
path.resolve normally handles absolute segments, ./.., and normalization. A simple join can yield incorrect paths and subtle bugs if any caller relies on those semantics. Consider a lightweight normalization or a tiny polyfill to match Node’s behavior.

♻️ Proposed minimal normalization
 	if (!globalThis.path) {
 		globalThis.path = {
 			resolve(...pathSegments) {
-				return pathSegments.join("/");
+				let absolute = false;
+				const parts = [];
+				for (let seg of pathSegments) {
+					if (!seg) continue;
+					if (seg.startsWith("/")) {
+						absolute = true;
+						parts.length = 0;
+						seg = seg.replace(/^\/+/, "");
+					}
+					for (const p of seg.split("/")) {
+						if (!p || p === ".") continue;
+						if (p === "..") {
+							if (parts.length) parts.pop();
+							else if (!absolute) parts.push("..");
+						} else {
+							parts.push(p);
+						}
+					}
+				}
+				return (absolute ? "/" : "") + parts.join("/");
 			}
 		}
 	}
example/android/gradle.properties (1)

1-1: Check CI memory headroom for the larger Gradle heap.

Line 1 raises the max heap to 4GB; ensure CI/dev machines have enough RAM or consider documenting a lower value for constrained environments.


dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath 'com.android.tools.build:gradle:8.3.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Android Gradle Plugin 8.3.2 minimum JDK version requirement

💡 Result:

Android Gradle Plugin 8.3.2 requires JDK 17 (minimum) to run the build (and it’s also the default JDK for the 8.3 line). This requirement was introduced with AGP 8.x and applies to 8.3.2 as a patch release in that series. [1], [2]

Sources:
[1] Android Gradle Plugin 8.3.0 release notes (Compatibility table: JDK 17 min/default) (developer.android.com)
[2] Android Gradle Plugin 8.0.0 release notes (JDK 17 required to run AGP 8.0) (developer.android.com)

Citations:


🌐 Web query:

Android Gradle Plugin 8.3.2 minimum Gradle version

💡 Result:

Android Gradle Plugin 8.3.2 requires Gradle 8.4 (minimum). [1], [2]


🏁 Script executed:

# Check for gradle.properties and other build configuration files
find . -name "gradle.properties" -o -name "gradle-wrapper.properties" | head -20

Repository: jerson/flutter-rsa

Length of output: 235


🏁 Script executed:

# Look at the android/build.gradle file context around lines 11 and 29
head -35 android/build.gradle | cat -n

Repository: jerson/flutter-rsa

Length of output: 973


🏁 Script executed:

# Check the gradle wrapper properties to see current Gradle version
cat -n android/gradle/wrapper/gradle-wrapper.properties

Repository: jerson/flutter-rsa

Length of output: 296


🏁 Script executed:

# Also check if there's any documentation about build requirements
find . -name "README*" -o -name "CONTRIBUTING*" -o -name ".github/workflows/*.yml" | head -10

Repository: jerson/flutter-rsa

Length of output: 161


🏁 Script executed:

# Check README for build requirements
head -50 README.md

Repository: jerson/flutter-rsa

Length of output: 2048


🏁 Script executed:

# Check if there are CI workflow files
ls -la .github/workflows/ 2>/dev/null || echo "No workflows directory found"

Repository: jerson/flutter-rsa

Length of output: 753


🏁 Script executed:

# Check the Android test workflow to see what toolchain versions are specified
cat -n .github/workflows/tests_android.yml

Repository: jerson/flutter-rsa

Length of output: 2071


Update gradle-wrapper to Gradle 8.4+ to meet AGP 8.3.2 requirements.

AGP 8.3.2 requires Gradle 8.4 (minimum) and JDK 17. The gradle-wrapper.properties currently specifies Gradle 7.3, which is incompatible and will fail the build. Update android/gradle/wrapper/gradle-wrapper.properties to use gradle-8.4-all.zip (or newer). JDK 17 is already configured in CI, but verify that Android SDK 34 is available in build environments.

🤖 Prompt for AI Agents
In `@android/build.gradle` at line 11, AGP 8.3.2 requires Gradle 8.4+ so update
the gradle wrapper: edit android/gradle/wrapper/gradle-wrapper.properties to
replace the distributionUrl pointing to gradle-7.3 with gradle-8.4-all.zip (or
newer) to match the classpath 'com.android.tools.build:gradle:8.3.2' entry;
ensure the wrapper version is committed and regenerated if necessary, and verify
CI uses JDK 17 and has Android SDK 34 available for the build environment.

android {
namespace "com.example.example"
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 34
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Flutter Android compileSdkVersion recommendations 2025 2026

💡 Result:

Practical recommendations (Flutter + Android) for 2025–2026

  1. For most Flutter apps: keep Flutter’s defaults

    • In android/app/build.gradle(.kts) use:
      • compileSdk = flutter.compileSdkVersion
      • targetSdk = flutter.targetSdkVersion
    • This is commonly recommended because Flutter pins a tested Android toolchain/version set. (stackoverflow.com)
  2. If you publish to Google Play: align with Play’s target API deadlines

    • From Aug 31, 2025, Google Play requires new apps and app updates to target Android 15 (API 35) (with some device-type exceptions). (developer.android.com)
    • Therefore, by that date you should ensure:
      • targetSdkVersion >= 35
      • compileSdkVersion >= targetSdkVersion (so compileSdk >= 35 in practice)
  3. Only raise compileSdk above Flutter’s default if you must—and then update the Android toolchain too

    • When moving to newer SDKs (e.g., API 35+), you may need a newer Android Gradle Plugin (AGP) version; otherwise you can get warnings like “AGP was tested up to compileSdk = 34”. (stackoverflow.com)
    • Translation: if you choose compileSdk 35/36 in 2025–2026, be prepared to also update Flutter, AGP, Gradle, and sometimes plugins.
  4. Reality check: Flutter versions can “cap” what you actually ship

    • There have been cases reported where a specific Flutter release effectively forced SDK levels despite overrides, so the safest path to a higher target/compile SDK is often upgrading Flutter (not just editing Gradle numbers). (github.com)

Rule of thumb for 2025–2026:

  • Default: compileSdk = flutter.compileSdkVersion (least risk). (stackoverflow.com)
  • Publishing to Play after Aug 31, 2025: ensure targetSdk = 35 and thus compileSdk >= 35 (usually by upgrading Flutter/toolchain to versions that support it cleanly). (developer.android.com)

Citations:


🏁 Script executed:

# Check for Flutter version specifications in the repository
find . -type f \( -name "pubspec.yaml" -o -name ".flutter-version" -o -name "pubspec.lock" \) | head -20

Repository: jerson/flutter-rsa

Length of output: 122


🏁 Script executed:

# Check the build.gradle file and surrounding context for more details
head -40 example/android/app/build.gradle

Repository: jerson/flutter-rsa

Length of output: 1055


Update compileSdkVersion to 35 or higher; hard-coded 34 does not meet Google Play requirements as of August 2025.

As of February 2026, Google Play requires targetSdkVersion >= 35, which means compileSdkVersion >= 35 is mandatory for Play Store submissions. Hard-coded compileSdkVersion 34 will cause compliance failures. Either update to compileSdkVersion 35 (or higher) or use compileSdk = flutter.compileSdkVersion to let Flutter manage the SDK version, ensuring automatic alignment with Flutter's tested toolchain.

🤖 Prompt for AI Agents
In `@example/android/app/build.gradle` at line 27, The build file currently
hard-codes compileSdkVersion 34 which fails Google Play's requirement; update
the value to at least 35 by replacing the literal "compileSdkVersion 34" with
"compileSdkVersion 35" (or higher), or switch to using Flutter's managed value
by replacing it with "compileSdk = flutter.compileSdkVersion"; locate the
occurrence of compileSdkVersion in the Gradle config and make the change so the
project targets compileSdk 35+.

include ":app"

apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "settings.gradle" -type f | head -20

Repository: jerson/flutter-rsa

Length of output: 121


🏁 Script executed:

cd example/android 2>/dev/null && pwd && ls -la settings.gradle 2>/dev/null && cat -n settings.gradle

Repository: jerson/flutter-rsa

Length of output: 894


🌐 Web query:

Flutter app_plugin_loader.gradle deprecation minimum Flutter version pluginManagement dev.flutter.flutter-gradle-plugin

💡 Result:

app_plugin_loader.gradle is deprecated because older Flutter Android templates applied Flutter’s Gradle plugins via the legacy imperative apply from: script method. Flutter added support for the modern Plugin DSL (pluginManagement {} + plugins {}) in Flutter stable 3.16.0 (and it’s recommended starting 3.19.0). [1]

Minimum Flutter version

  • Minimum (stable) to use pluginManagement + dev.flutter.flutter-gradle-plugin: Flutter 3.16.0 [1]

What to change (migration summary)

1) android/settings.gradle (use pluginManagement, include Flutter’s Gradle build, and apply the loader plugin):

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
    id "com.android.application" version "{agpVersion}" apply false
    id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
}

include ":app"

Notes:

  • Gradle requires nothing before pluginManagement {} and plugins {}. [1]
  • dev.flutter.flutter-plugin-loader is applied in settings.gradle and should not be apply false. [1]

2) android/app/build.gradle (apply the project Flutter plugin in the plugins {} block):

plugins {
    id "com.android.application"
    id "dev.flutter.flutter-gradle-plugin"
    id "org.jetbrains.kotlin.android"
}

This replaces the old apply from: .../flutter.gradle and avoids the deprecated app_plugin_loader.gradle path. Also note the IDs are different:

  • dev.flutter.flutter-plugin-loader (settings)
  • dev.flutter.flutter-gradle-plugin (app) [1]

If you tell me your current Flutter version (flutter --version) and paste your android/settings.gradle + the first ~20 lines of android/app/build.gradle, I can point out the exact diff for your project layout.

Source: Flutter breaking change doc on migrating off imperative Gradle apply to the Plugin DSL. [1]


🏁 Script executed:

cat -n example/android/app/build.gradle | head -30

Repository: jerson/flutter-rsa

Length of output: 1037


🏁 Script executed:

cat -n android/settings.gradle

Repository: jerson/flutter-rsa

Length of output: 98


Ensure minimum Flutter SDK 3.16.0+ supports the new pluginManagement flow; also fix settings.gradle plugin ID.

The migration from legacy app_plugin_loader.gradle to pluginManagement with dev.flutter.flutter-gradle-plugin requires Flutter 3.16.0 minimum (3.19.0 recommended). Additionally, example/android/settings.gradle should declare id "dev.flutter.flutter-plugin-loader" in the plugins block, not dev.flutter.flutter-gradle-plugin. The latter should only appear in app/build.gradle.

🤖 Prompt for AI Agents
In `@example/android/settings.gradle` at line 20, Update
example/android/settings.gradle to require a minimum Flutter SDK of 3.16.0
(3.19.0 recommended) for the new pluginManagement flow and correct the plugins
block to declare id "dev.flutter.flutter-plugin-loader" (replace any use of
"dev.flutter.flutter-gradle-plugin" here); ensure
"dev.flutter.flutter-gradle-plugin" remains only in app/build.gradle and that
pluginManagement usage follows the Flutter 3.16+ requirements.

Comment on lines +27 to +29
[ ] executing: [/Users/gizemmalcok/Developer/flutter/] git -c log.showSignature=false log HEAD -n 1 --pretty=format:%ad --date=iso
[ +20 ms] Exit code 0 from: git -c log.showSignature=false log HEAD -n 1 --pretty=format:%ad --date=iso
[ ] 2025-12-11 11:50:07 -0500
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove the raw build log from the repo (contains local paths/PII).

This log embeds user/machine-specific paths and environment details. Please delete or fully redact it and keep such logs out of version control (e.g., add to .gitignore or attach to an issue instead).

🤖 Prompt for AI Agents
In `@example/build_log.txt` around lines 27 - 29, The file example/build_log.txt
contains raw build output with local paths/PII; remove the sensitive content by
deleting this file from the commit (or fully redact all machine-specific
paths/timestamps) and ensure build logs are not committed in future by adding a
rule to .gitignore (or the repo's ignore config) to exclude build_log.txt or the
logs directory; update the PR to remove the file from history if necessary (or
replace it with a sanitized example) and mention the change in the commit
message so reviewers know the PII was removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant