From 713c54ef8365d36afd84585dcabed2fbb751223d Mon Sep 17 00:00:00 2001 From: Olivier Lemasle Date: Tue, 10 Sep 2024 13:01:29 +0200 Subject: [PATCH] chore(barcode): remove unused Android dependencies (#1749) * chore(barcode): remove unused Android dependencies Plugin barcode-scanner has two unused Android dependencies: - com.google.zxing:core - com.journeyapps:zxing-android-embedded However, these dependency's AndroidManifest.xml were merged, and contained required parameters (to get camera's permissions). See the merged manifests: - https://github.com/zxing/zxing/blob/zxing-3.3.0/android/AndroidManifest.xml - https://github.com/journeyapps/zxing-android-embedded/blob/v4.3.0/zxing-android-embedded/AndroidManifest.xml This commit removes the unused dependencies (and unused Java imports) and updates the Android manifest. * chore: remove comments --------- Co-authored-by: Lucas Nogueira --- .changes/barcode-dependencies.md | 5 +++++ plugins/barcode-scanner/android/build.gradle.kts | 4 ---- .../barcode-scanner/android/src/main/AndroidManifest.xml | 8 +++----- .../android/src/main/java/BarcodeScannerPlugin.kt | 2 -- plugins/nfc/android/src/main/AndroidManifest.xml | 5 ----- 5 files changed, 8 insertions(+), 16 deletions(-) create mode 100644 .changes/barcode-dependencies.md diff --git a/.changes/barcode-dependencies.md b/.changes/barcode-dependencies.md new file mode 100644 index 000000000..7beab24f9 --- /dev/null +++ b/.changes/barcode-dependencies.md @@ -0,0 +1,5 @@ +--- +"barcode-scanner": patch +--- + +Remove unused Android dependencies. \ No newline at end of file diff --git a/plugins/barcode-scanner/android/build.gradle.kts b/plugins/barcode-scanner/android/build.gradle.kts index 64e7e865f..f3ecd6c71 100644 --- a/plugins/barcode-scanner/android/build.gradle.kts +++ b/plugins/barcode-scanner/android/build.gradle.kts @@ -47,9 +47,5 @@ dependencies { testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - implementation("com.journeyapps:zxing-android-embedded:4.3.0") { - isTransitive = false - } - implementation("com.google.zxing:core:3.3.0") implementation(project(":tauri-android")) } diff --git a/plugins/barcode-scanner/android/src/main/AndroidManifest.xml b/plugins/barcode-scanner/android/src/main/AndroidManifest.xml index b4050b4f6..750a724b8 100644 --- a/plugins/barcode-scanner/android/src/main/AndroidManifest.xml +++ b/plugins/barcode-scanner/android/src/main/AndroidManifest.xml @@ -2,10 +2,8 @@ xmlns:tools="http://schemas.android.com/tools" android:hardwareAccelerated="true"> - - - - - + + + diff --git a/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt b/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt index 4728bad0e..ef2eeb347 100644 --- a/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt +++ b/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt @@ -42,7 +42,6 @@ import app.tauri.annotation.Permission import app.tauri.annotation.PermissionCallback import app.tauri.annotation.TauriPlugin import app.tauri.plugin.Invoke -import app.tauri.plugin.JSArray import app.tauri.plugin.JSObject import app.tauri.plugin.Plugin import com.google.common.util.concurrent.ListenableFuture @@ -50,7 +49,6 @@ import com.google.mlkit.vision.barcode.BarcodeScannerOptions import com.google.mlkit.vision.barcode.BarcodeScanning import com.google.mlkit.vision.barcode.common.Barcode import com.google.mlkit.vision.common.InputImage -import org.json.JSONException import java.util.Collections import java.util.concurrent.ExecutionException diff --git a/plugins/nfc/android/src/main/AndroidManifest.xml b/plugins/nfc/android/src/main/AndroidManifest.xml index a2c208e2b..7603a356a 100644 --- a/plugins/nfc/android/src/main/AndroidManifest.xml +++ b/plugins/nfc/android/src/main/AndroidManifest.xml @@ -1,9 +1,4 @@ - - - - -