feat: increase min api level & add x86 support

This commit is contained in:
amizing25
2025-03-09 10:23:28 +07:00
parent b7024bb598
commit 37a6d97730
5 changed files with 33 additions and 21 deletions

8
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="My_Application.app" target="21" />
</bytecodeTargetLevel>
</component>
</project>

View File

@@ -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<Exec>("buildRust") {
"cargo", "ndk",
"-t", "arm64-v8a",
"-t", "armeabi-v7a",
"-t", "x86",
"-t", "x86_64",
"-o", "../jniLibs",
"build", "--release"
)

View File

@@ -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())
}
}
}

Binary file not shown.

Binary file not shown.