diff --git a/android/.kotlin/errors/errors-1757572005452.log b/android/.kotlin/errors/errors-1757572005452.log deleted file mode 100644 index 1219b50..0000000 --- a/android/.kotlin/errors/errors-1757572005452.log +++ /dev/null @@ -1,4 +0,0 @@ -kotlin version: 2.0.21 -error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output: - 1. Kotlin compile daemon is ready - diff --git a/android/app/build.gradle b/android/app/build.gradle index ef41eb1..79eea55 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -92,7 +92,7 @@ android { applicationId 'mobiledarmasaba.app' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 17 + versionCode 21 versionName "2.2.0" } signingConfigs { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index acf5b70..303e9d2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,9 +1,9 @@ - - + + diff --git a/app.config.js b/app.config.js index b5e7119..34abd27 100644 --- a/app.config.js +++ b/app.config.js @@ -23,7 +23,7 @@ export default { }, android: { package: "mobiledarmasaba.app", - versionCode: 19, + versionCode: 21, adaptiveIcon: { foregroundImage: "./assets/images/logo-icon-small.png", backgroundColor: "#ffffff" @@ -54,6 +54,7 @@ export default { "expo-font", "expo-image-picker", "expo-web-browser", + "./plugins/withRemoveMediaPermissions", [ "@react-native-firebase/app", { diff --git a/plugins/withRemoveMediaPermissions.js b/plugins/withRemoveMediaPermissions.js new file mode 100644 index 0000000..283e630 --- /dev/null +++ b/plugins/withRemoveMediaPermissions.js @@ -0,0 +1,37 @@ +const { withAndroidManifest } = require('@expo/config-plugins'); + +const BLOCKED_PERMISSIONS = [ + 'android.permission.READ_MEDIA_IMAGES', + 'android.permission.READ_MEDIA_VIDEO', +]; + +const withRemoveMediaPermissions = (config) => + withAndroidManifest(config, (config) => { + const manifest = config.modResults.manifest; + + // Pastikan xmlns:tools ada di manifest root + if (!manifest.$['xmlns:tools']) { + manifest.$['xmlns:tools'] = 'http://schemas.android.com/tools'; + } + + // Hapus entry yang ada (apapun atributnya) + const existing = manifest['uses-permission'] ?? []; + manifest['uses-permission'] = existing.filter( + (perm) => !BLOCKED_PERMISSIONS.includes(perm.$?.['android:name']) + ); + + // Tambahkan entry dengan tools:node="remove" agar Gradle merger + // membuang permission ini dari SEMUA sumber (termasuk library manifests) + for (const permission of BLOCKED_PERMISSIONS) { + manifest['uses-permission'].push({ + $: { + 'android:name': permission, + 'tools:node': 'remove', + }, + }); + } + + return config; + }); + +module.exports = withRemoveMediaPermissions;