fix: RSABridgeCall problem solved for iOS and supported android 16kb#92
fix: RSABridgeCall problem solved for iOS and supported android 16kb#92gizemgizg wants to merge 1 commit intojerson:masterfrom
Conversation
…aries, web assembly, and example project dependencies.
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 whenpage_len < 8.
bytearrayslice assignment can resize the buffer, sodata[0:8] = ...will expand the buffer whenpage_lenis smaller than 8, andWriteMemorywill write more bytes than intended. Please cap the marker topage_lenso 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, andintern_dictare 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.resolvenormally 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' |
There was a problem hiding this comment.
🧩 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:
- 1: https://developer.android.com/build/releases/agp-8-3-0-release-notes?utm_source=openai
- 2: https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes?utm_source=openai
🌐 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 -20Repository: 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 -nRepository: 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.propertiesRepository: 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 -10Repository: jerson/flutter-rsa
Length of output: 161
🏁 Script executed:
# Check README for build requirements
head -50 README.mdRepository: 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.ymlRepository: 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 |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Flutter Android compileSdkVersion recommendations 2025 2026
💡 Result:
Practical recommendations (Flutter + Android) for 2025–2026
-
For most Flutter apps: keep Flutter’s defaults
- In
android/app/build.gradle(.kts)use:compileSdk = flutter.compileSdkVersiontargetSdk = flutter.targetSdkVersion
- This is commonly recommended because Flutter pins a tested Android toolchain/version set. (stackoverflow.com)
- In
-
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 >= 35compileSdkVersion >= targetSdkVersion(so compileSdk >= 35 in practice)
-
Only raise
compileSdkabove 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.
-
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:
- 1: https://stackoverflow.com/questions/78778617/android-resource-linking-failed-with-android-35-sdk-during-flutter-release-build?utm_source=openai
- 2: https://developer.android.com/google/play/requirements/target-sdk?utm_source=openai
- 3: https://stackoverflow.com/questions/78778617/android-resource-linking-failed-with-android-35-sdk-during-flutter-release-build?utm_source=openai
- 4: Flutter 3.35.2 forces SDK 34 despite explicit overrides flutter/flutter#174516
- 5: https://stackoverflow.com/questions/78778617/android-resource-linking-failed-with-android-35-sdk-during-flutter-release-build?utm_source=openai
- 6: https://developer.android.com/google/play/requirements/target-sdk?utm_source=openai
🏁 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 -20Repository: 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.gradleRepository: 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" | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -name "settings.gradle" -type f | head -20Repository: 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.gradleRepository: 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 {}andplugins {}. [1] dev.flutter.flutter-plugin-loaderis applied insettings.gradleand should not beapply 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 -30Repository: jerson/flutter-rsa
Length of output: 1037
🏁 Script executed:
cat -n android/settings.gradleRepository: 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.
| [ ] 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 |
There was a problem hiding this comment.
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.
Summary by CodeRabbit