diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..9234cdc --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 36b866d..1ec9389 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -9,7 +9,7 @@ android { defaultConfig { applicationId = "dev.amizing25.robinsr" - minSdk = 24 + minSdk = 30 targetSdk = 35 versionCode = 1 versionName = "1.0" @@ -59,6 +59,8 @@ tasks.register("buildRust") { "cargo", "ndk", "-t", "arm64-v8a", "-t", "armeabi-v7a", + "-t", "x86", + "-t", "x86_64", "-o", "../jniLibs", "build", "--release" ) diff --git a/app/src/main/java/dev/amizing25/robinsr/MainActivity.kt b/app/src/main/java/dev/amizing25/robinsr/MainActivity.kt index 535c3f2..ee9e25b 100644 --- a/app/src/main/java/dev/amizing25/robinsr/MainActivity.kt +++ b/app/src/main/java/dev/amizing25/robinsr/MainActivity.kt @@ -153,22 +153,20 @@ class MainActivity : AppCompatActivity() { /// Notification channel /// private fun createNotificationChannel() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val channel = NotificationChannel( - RustService.CHANNEL_ID, - "Service Channel", - NotificationManager.IMPORTANCE_LOW - ).apply { - description = "Background service notifications" - lockscreenVisibility = Notification.VISIBILITY_PUBLIC - setSound(null, null) - enableLights(false) - enableVibration(false) - } - - val manager = getSystemService(NotificationManager::class.java) - manager.createNotificationChannel(channel) + val channel = NotificationChannel( + RustService.CHANNEL_ID, + "Service Channel", + NotificationManager.IMPORTANCE_LOW + ).apply { + description = "Background service notifications" + lockscreenVisibility = Notification.VISIBILITY_PUBLIC + setSound(null, null) + enableLights(false) + enableVibration(false) } + + val manager = getSystemService(NotificationManager::class.java) + manager.createNotificationChannel(channel) } /// Permission stuff /// @@ -294,13 +292,17 @@ class MainActivity : AppCompatActivity() { } fun writeJsonIfNotExist(context: Context, dst: File, src: Int) { - if (!dst.exists()) { - context.resources.openRawResource(src).use { input -> - dst.outputStream().use { output -> - input.copyTo(output) - LogRepository.addLog("wrote $dst into media directory") + try { + if (!dst.exists()) { + context.resources.openRawResource(src).use { input -> + dst.outputStream().use { output -> + input.copyTo(output) + LogRepository.addLog("wrote $dst into media directory") + } } } + } catch(e: Exception) { + LogRepository.addLog(e.toString()) } } } \ No newline at end of file diff --git a/app/src/main/jniLibs/x86/librobinsr.so b/app/src/main/jniLibs/x86/librobinsr.so new file mode 100644 index 0000000..1aff933 Binary files /dev/null and b/app/src/main/jniLibs/x86/librobinsr.so differ diff --git a/app/src/main/jniLibs/x86_64/librobinsr.so b/app/src/main/jniLibs/x86_64/librobinsr.so new file mode 100644 index 0000000..0d3f1dc Binary files /dev/null and b/app/src/main/jniLibs/x86_64/librobinsr.so differ