Skip to content

Commit

Permalink
fix(cli & core): use unescaped package id in proguard file
Browse files Browse the repository at this point in the history
closes #11310
  • Loading branch information
amrbashir committed Oct 11, 2024
1 parent 04fd3a7 commit da5f8bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changes/android-proguard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"tauri": "patch:bug"
"tauri-cli": "patch:bug"
"@tauri-apps/cli": "patch:bug"
---

Fix android invalid proguard file when using an `identifier` that contains a component that is a reserved kotlin keyword, like `in`, `class`, etc
1 change: 1 addition & 0 deletions crates/tauri-cli/src/mobile/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ pub fn get_config(
"WRY_ANDROID_PACKAGE",
app.android_identifier_escape_kotlin_keyword(),
);
set_var("WRY_ANDROID_PACKAGE_NO_ESCAPE", app.identifier());
set_var("WRY_ANDROID_LIBRARY", app.lib_name());
set_var("TAURI_ANDROID_PROJECT_PATH", config.project_dir());

Expand Down
4 changes: 2 additions & 2 deletions crates/tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ fn main() {
if let Some(project_dir) = env::var_os("TAURI_ANDROID_PROJECT_PATH").map(PathBuf::from) {
let tauri_proguard = include_str!("./mobile/proguard-tauri.pro").replace(
"$PACKAGE",
&env::var("WRY_ANDROID_PACKAGE")
.expect("missing `WRY_ANDROID_PACKAGE` environment variable"),
&env::var("WRY_ANDROID_PACKAGE_NO_ESCAPE")
.expect("missing `WRY_ANDROID_PACKAGE_NO_ESCAPE` environment variable"),
);
std::fs::write(
project_dir.join("app").join("proguard-tauri.pro"),
Expand Down

0 comments on commit da5f8bd

Please sign in to comment.