-
Notifications
You must be signed in to change notification settings - Fork 180
chore: android studio agp assistant; 16kb pagesize fix #1107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,8 +17,7 @@ | |
| android:label="@string/app_name" | ||
| android:icon="@mipmap/ic_launcher" | ||
| android:roundIcon="@mipmap/ic_launcher" | ||
| android:extractNativeLibs="false" | ||
| tools:replace="android:icon, android:roundIcon, android:name, android:extractNativeLibs" | ||
| tools:replace="android:icon, android:roundIcon, android:name, android:extractNativeLibs" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainHarden manifest: drop privileged permission, restrict cleartext, and verify native libs extraction.
Suggested minimal changes: - <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
...
- android:usesCleartextTraffic="true"
+ android:usesCleartextTraffic="false"
+ android:networkSecurityConfig="@xml/network_security_config"
+ <!-- If the merger doesn't add it, keep this explicitly: -->
+ <!-- android:extractNativeLibs="false" -->🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "Listing AndroidManifest.xml files (repo):"
rg -n --hidden --no-ignore -S "AndroidManifest.xml" || true
echo
MANIFEST="app/android/app/src/main/AndroidManifest.xml"
if [ -f "$MANIFEST" ]; then
echo "Showing $MANIFEST (first 200 lines with numbers):"
nl -ba -w3 -s': ' "$MANIFEST" | sed -n '1,200p'
else
echo "$MANIFEST not found; listing any manifest files found:"
rg -n --hidden --no-ignore -S '<manifest' --glob '!**/node_modules/**' || true
fi
echo
echo "Searching repo for suspicious entries:"
rg -n --hidden --no-ignore -S "ACCESS_SURFACE_FLINGER|usesCleartextTraffic|extractNativeLibs|android:extractNativeLibs|networkSecurityConfig" || true
echo
echo "Searching for network security config xml (res/xml):"
rg -n --hidden --no-ignore -S '<network-security-config|res/xml' --glob '!**/node_modules/**' || true
echo
echo "Searching Gradle files for packaging / legacy packaging settings:"
rg -n --hidden --no-ignore -S 'useLegacyPackaging|packagingOptions|extractNativeLibs|jniLibs|jni' || true
echo
echo "Done."Length of output: 814 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
MANIFEST="app/android/app/src/main/AndroidManifest.xml"
if [ -f "$MANIFEST" ]; then
echo "=== $MANIFEST ==="
awk '{printf "%4d: %s\n", NR, $0}' "$MANIFEST" | sed -n '1,200p'
else
echo "Manifest not found: $MANIFEST"
fi
echo
echo "Searching repo for target strings:"
rg -n --hidden --no-ignore -S "ACCESS_SURFACE_FLINGER|usesCleartextTraffic|android:extractNativeLibs|extractNativeLibs|networkSecurityConfig" || true
echo
echo "Searching for network security config XML files under res/xml:"
rg -n --hidden --no-ignore -S "res/xml|network_security_config" || true
echo
echo "Searching Gradle files for packaging / JNI settings:"
rg -n --hidden --no-ignore -S "useLegacyPackaging|packagingOptions|extractNativeLibs|jniLibs|jni" || trueLength of output: 318519 Harden manifest: drop privileged permission, restrict cleartext, and verify native libs extraction.
Suggested minimal changes: - <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
...
- android:usesCleartextTraffic="true"
+ android:usesCleartextTraffic="false"
+ android:networkSecurityConfig="@xml/network_security_config"
+ <!-- If the merger doesn't add it, keep this explicitly: -->
+ <!-- android:extractNativeLibs="false" -->
🤖 Prompt for AI Agents |
||
| android:theme="@style/AppTheme" | ||
| android:supportsRtl="true" | ||
| android:usesCleartextTraffic="true" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ buildscript { | |||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| dependencies { | ||||||||||||||||||||||||||||||||||||||||||||||||
| classpath("com.android.tools.build:gradle:8.6.0") | ||||||||||||||||||||||||||||||||||||||||||||||||
| classpath('com.android.tools.build:gradle:8.11.2') | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainAGP 8.11.2 OK; remove jcenter() and the forced firebase-iid to avoid supply‑chain and compat risks.
Suggested edits: allprojects {
repositories {
google()
mavenCentral()
- jcenter()
+ // jcenter() removed (read-only; avoid supply-chain risk)
maven {
url("$rootDir/../../node_modules/react-native/android")
}
...
- configurations.all {
- resolutionStrategy {
- force 'com.google.firebase:firebase-iid:21.1.0'
- }
- }
+ // Do not force firebase-iid; rely on the Firebase BoM.
}🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "1) Searching repo for jcenter(), firebase-iid and forced resolutionStrategy..."
rg -n --hidden --no-ignore -S "jcenter\(|com.google.firebase:firebase-iid|resolutionStrategy|configurations\.all" || true
echo
echo "2) Show likely android build.gradle files if present:"
for f in app/android/build.gradle android/build.gradle android/app/build.gradle; do
if [ -f "$f" ]; then
echo "----- $f -----"
nl -ba "$f" | sed -n '1,240p'
echo
fi
done
echo "3) Show any gradle files that contain 'firebase-iid' or 'jcenter' (full context)"
rg -n --hidden --no-ignore -S "jcenter\(|com.google.firebase:firebase-iid" -g '!*node_modules/*' || true
echo
echo "4) Search for firebase BoM usage"
rg -n --hidden --no-ignore -S "firebase-bom|com.google.firebase:firebase-bom" || trueLength of output: 938 AGP 8.11.2 OK — remove jcenter() and stop forcing firebase‑iid
Suggested edits: allprojects {
repositories {
google()
mavenCentral()
- jcenter()
+ // jcenter() removed (read-only; avoid supply-chain risk)
maven {
url("$rootDir/../../node_modules/react-native/android")
}
...
- configurations.all {
- resolutionStrategy {
- force 'com.google.firebase:firebase-iid:21.1.0'
- }
- }
+ // Do not force firebase-iid; rely on the Firebase BoM.
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. upgrade gradle |
||||||||||||||||||||||||||||||||||||||||||||||||
| classpath("com.facebook.react:react-native-gradle-plugin") | ||||||||||||||||||||||||||||||||||||||||||||||||
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" | ||||||||||||||||||||||||||||||||||||||||||||||||
| classpath 'com.google.gms:google-services:4.4.0' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Don’t pickFirst libc++_shared; enforce a single known source.
pickFirst on libc++_shared.so can silently mask version skew from transitive AARs and cause hard‑to‑trace native crashes. Since you already link c++_shared via CMake (ANDROID_STL=c++_shared) and useLegacyPackaging=false, exclude all transitive copies and ship exactly one from your app.
jniLibs { useLegacyPackaging false - pickFirsts += ['**/libc++_shared.so'] + excludes += ['**/libc++_shared.so'] }Also verify the merged manifest contains android:extractNativeLibs="false" (see Manifest comment) to keep mmap loading and APK size benefits.
🏁 Script executed:
Length of output: 2976
Remove pickFirst for libc++_shared — exclude transitive copies and ship a single c++_shared
pickFirst masks version skew in transitive AARs and can cause hard‑to‑trace native crashes; you build with ANDROID_STL=c++_shared and useLegacyPackaging=false, so exclude transitive copies and ship exactly one libc++_shared from the app.
jniLibs { useLegacyPackaging false - pickFirsts += ['**/libc++_shared.so'] + excludes += ['**/libc++_shared.so'] }📝 Committable suggestion
🤖 Prompt for AI Agents