Skip to content

Commit 713c54e

Browse files
chore(barcode): remove unused Android dependencies (tauri-apps#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 <[email protected]>
1 parent a9b2a9a commit 713c54e

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

.changes/barcode-dependencies.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"barcode-scanner": patch
3+
---
4+
5+
Remove unused Android dependencies.

plugins/barcode-scanner/android/build.gradle.kts

-4
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,5 @@ dependencies {
4747
testImplementation("junit:junit:4.13.2")
4848
androidTestImplementation("androidx.test.ext:junit:1.1.5")
4949
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
50-
implementation("com.journeyapps:zxing-android-embedded:4.3.0") {
51-
isTransitive = false
52-
}
53-
implementation("com.google.zxing:core:3.3.0")
5450
implementation(project(":tauri-android"))
5551
}

plugins/barcode-scanner/android/src/main/AndroidManifest.xml

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
xmlns:tools="http://schemas.android.com/tools"
33
android:hardwareAccelerated="true">
44

5-
<!-- Paste the following line into the AndroidManifest.xml of your project -->
6-
<!-- See also: https://capacitorjs.com/docs/plugins/android#manifest -->
7-
<!-- <uses-feature android:name="android.hardware.camera" android:required="false" /> -->
8-
9-
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
5+
<uses-permission android:name="android.permission.CAMERA"/>
106
<uses-permission android:name="android.permission.VIBRATE" />
7+
8+
<uses-feature android:name="android.hardware.camera.any"/>
119
</manifest>

plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt

-2
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@ import app.tauri.annotation.Permission
4242
import app.tauri.annotation.PermissionCallback
4343
import app.tauri.annotation.TauriPlugin
4444
import app.tauri.plugin.Invoke
45-
import app.tauri.plugin.JSArray
4645
import app.tauri.plugin.JSObject
4746
import app.tauri.plugin.Plugin
4847
import com.google.common.util.concurrent.ListenableFuture
4948
import com.google.mlkit.vision.barcode.BarcodeScannerOptions
5049
import com.google.mlkit.vision.barcode.BarcodeScanning
5150
import com.google.mlkit.vision.barcode.common.Barcode
5251
import com.google.mlkit.vision.common.InputImage
53-
import org.json.JSONException
5452
import java.util.Collections
5553
import java.util.concurrent.ExecutionException
5654

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33
<uses-permission android:name="android.permission.NFC" />
4-
<!-- TODO: if the app doesn't rely on nfc the uses-feature line could be removed. The app store uses this prop to decide whether or not to show the app. -->
5-
<!-- TODO: Move that info somewhere else since users usually can't see this file. -->
6-
<!-- Paste the following line into the AndroidManifest.xml of your project -->
7-
<!-- See also: https://capacitorjs.com/docs/plugins/android#manifest -->
8-
<!-- <uses-feature android:name="android.hardware.nfc" android:required="true" /> -->
94
</manifest>

0 commit comments

Comments
 (0)