Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,22 @@ jobs:
mkdir -p frontend/src-tauri/gen/android/app/src/main/assets
cp frontend/src-tauri/tauri.conf.json frontend/src-tauri/gen/android/app/src/main/assets/tauri.conf.json

# Tauri proguard rules
# Tauri proguard rules (process $PACKAGE placeholder)
TAURI_PROGUARD="$TAURI_DIR/mobile/proguard-tauri.pro"
if [ -f "$TAURI_PROGUARD" ]; then
cp "$TAURI_PROGUARD" frontend/src-tauri/gen/android/app/proguard-tauri.pro
sed "s/\\\$PACKAGE/$PACKAGE/g" "$TAURI_PROGUARD" > frontend/src-tauri/gen/android/app/proguard-tauri.pro
else
echo "Tauri proguard file not found (skipping): $TAURI_PROGUARD"
fi

# Wry proguard rules (process {{package-unescaped}} placeholder)
WRY_PROGUARD="$WRY_DIR/src/android/kotlin/proguard-wry.pro"
if [ -f "$WRY_PROGUARD" ]; then
sed "s/{{package-unescaped}}/$PACKAGE/g" "$WRY_PROGUARD" > "$GEN_KOTLIN_DIR/proguard-wry.pro"
Comment on lines +376 to +379
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:

# First, let's verify the Gradle references to proguard-wry.pro
rg -n --glob '*.gradle*' --glob '*.kts' 'proguard-wry\.pro'

Repository: OpenSecretCloud/Maple

Length of output: 47


🏁 Script executed:

# Also check for proguardFiles configuration in Gradle
rg -n --glob '*.gradle*' --glob '*.kts' 'proguardFiles'

Repository: OpenSecretCloud/Maple

Length of output: 146


🏁 Script executed:

# Let's examine the android-build.yml file to understand GEN_KOTLIN_DIR variable
cat -n .github/workflows/android-build.yml | sed -n '350,385p'

Repository: OpenSecretCloud/Maple

Length of output: 1913


🏁 Script executed:

# Find where GEN_KOTLIN_DIR is defined in the workflow
rg -n 'GEN_KOTLIN_DIR=' .github/workflows/android-build.yml

Repository: OpenSecretCloud/Maple

Length of output: 169


🏁 Script executed:

# Examine the Gradle proguardFiles configuration
cat -n frontend/src-tauri/gen/android/app/build.gradle.kts | sed -n '50,65p'

Repository: OpenSecretCloud/Maple

Length of output: 642


🏁 Script executed:

# Also check if there's a proguard-wry.pro file anywhere in the codebase
find . -name "proguard-wry.pro" 2>/dev/null

Repository: OpenSecretCloud/Maple

Length of output: 47


🏁 Script executed:

# Check if there are other .pro files in the codebase to understand the pattern
find . -name "*.pro" -type f 2>/dev/null

Repository: OpenSecretCloud/Maple

Length of output: 120


🏁 Script executed:

# Let's also check the context around the Gradle configuration to understand the working directory
cd frontend/src-tauri/gen/android/app && pwd

Repository: OpenSecretCloud/Maple

Length of output: 118


Write proguard-wry.pro to the app root directory, consistent with proguard-tauri.pro.

Line 379 writes the file to $GEN_KOTLIN_DIR (generated sources subdirectory), which is unreliable and inconsistent with how proguard-tauri.pro is placed directly in the app root on line 371. Gradle expects ProGuard rules in the app module root for reliable R8 processing.

🔧 Proposed fix
-            sed "s/{{package-unescaped}}/$PACKAGE/g" "$WRY_PROGUARD" > "$GEN_KOTLIN_DIR/proguard-wry.pro"
+            sed "s/{{package-unescaped}}/$PACKAGE/g" "$WRY_PROGUARD" > "frontend/src-tauri/gen/android/app/proguard-wry.pro"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Wry proguard rules (process {{package-unescaped}} placeholder)
WRY_PROGUARD="$WRY_DIR/src/android/kotlin/proguard-wry.pro"
if [ -f "$WRY_PROGUARD" ]; then
sed "s/{{package-unescaped}}/$PACKAGE/g" "$WRY_PROGUARD" > "$GEN_KOTLIN_DIR/proguard-wry.pro"
# Wry proguard rules (process {{package-unescaped}} placeholder)
WRY_PROGUARD="$WRY_DIR/src/android/kotlin/proguard-wry.pro"
if [ -f "$WRY_PROGUARD" ]; then
sed "s/{{package-unescaped}}/$PACKAGE/g" "$WRY_PROGUARD" > "frontend/src-tauri/gen/android/app/proguard-wry.pro"
🤖 Prompt for AI Agents
In @.github/workflows/android-build.yml around lines 376 - 379, The generated
WRY proguard rules are being written to the generated-sources dir
($GEN_KOTLIN_DIR) which is unreliable; instead, write the processed WRY_PROGUARD
output into the app module root (the same location used for proguard-tauri.pro)
so Gradle/R8 can find it. Update the sed redirection that uses WRY_PROGUARD and
PACKAGE to output proguard-wry.pro into the app root (where proguard-tauri.pro
is placed) rather than $GEN_KOTLIN_DIR, keeping the filename proguard-wry.pro.

else
echo "Wry proguard file not found (skipping): $WRY_PROGUARD"
fi

- name: Setup Android signing
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,22 @@ jobs:
mkdir -p frontend/src-tauri/gen/android/app/src/main/assets
cp frontend/src-tauri/tauri.conf.json frontend/src-tauri/gen/android/app/src/main/assets/tauri.conf.json

# Tauri proguard rules
# Tauri proguard rules (process $PACKAGE placeholder)
TAURI_PROGUARD="$TAURI_DIR/mobile/proguard-tauri.pro"
if [ -f "$TAURI_PROGUARD" ]; then
cp "$TAURI_PROGUARD" frontend/src-tauri/gen/android/app/proguard-tauri.pro
sed "s/\\\$PACKAGE/$PACKAGE/g" "$TAURI_PROGUARD" > frontend/src-tauri/gen/android/app/proguard-tauri.pro
else
echo "Tauri proguard file not found (skipping): $TAURI_PROGUARD"
fi

# Wry proguard rules (process {{package-unescaped}} placeholder)
WRY_PROGUARD="$WRY_DIR/src/android/kotlin/proguard-wry.pro"
if [ -f "$WRY_PROGUARD" ]; then
sed "s/{{package-unescaped}}/$PACKAGE/g" "$WRY_PROGUARD" > "$GEN_KOTLIN_DIR/proguard-wry.pro"
else
echo "Wry proguard file not found (skipping): $WRY_PROGUARD"
fi

- name: Setup Android signing
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
Expand Down
Loading