mirror of
https://github.com/ovrport/app.git
synced 2026-10-26 19:19:56 -04:00
Release 1.2.1 (#21)
* Change patch name * Can't checkout exception * Make bitmap mutable in BitmapIconResizer * Change version checkout handling * Change modal bottomsheet height * Fix strings file formatting * Bump version
This commit is contained in:
1 parent
2287b68396
commit
c50c431a7e
9 files changed
+23
-25
No files matched your search
@@ -9,7 +9,8 @@ object BitmapIconResizer : IconResizer {
|
||||
|
||||
override fun resize(bytes: ByteArray, width: Int, height: Int): ByteArray {
|
||||
val baos = ByteArrayOutputStream()
|
||||
BitmapFactory.decodeByteArray(bytes, 0, bytes.size).apply {
|
||||
BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||
.copy(Bitmap.Config.ARGB_8888, true).apply {
|
||||
reconfigure(width, height, Bitmap.Config.ARGB_8888)
|
||||
}.compress(Bitmap.CompressFormat.PNG, 100, baos)
|
||||
return baos.toByteArray()
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
<string name="progress_cleaning">Cleaning up…</string>
|
||||
<string name="patcher_nav_item">Patcher</string>
|
||||
<string name="select_version_title">Select version</string>
|
||||
<string name="you_have_no_versions">You have no versions installed and overport release index is not available.
|
||||
Check your internet connection.
|
||||
</string>
|
||||
<string name="you_have_no_versions">You have no versions installed and overport release index is not available. Check your internet connection.</string>
|
||||
<string name="tag_experimental">experimental</string>
|
||||
<string name="tag_latest">latest</string>
|
||||
<string name="tag_custom">custom</string>
|
||||
@@ -28,7 +26,9 @@
|
||||
<string name="cant_read_apk">Selected APK file cannot be parsed.</string>
|
||||
<string name="apk_file_exported">APK file has been successfully exported.</string>
|
||||
<string name="cant_update_overport">overport libraries cannot be downloaded.</string>
|
||||
<string name="unknown_error">Unknown error has been occurred.</string>
|
||||
<string name="unknown_error">Unknown error has been occurred</string>
|
||||
<string name="cant_checkout_title">Can't checkout version</string>
|
||||
<string name="cant_checkout_message">Selected overport version is unavailable for download. Please, check your internet connection or choose another version.</string>
|
||||
<string name="update_available">Update available!</string>
|
||||
<string name="status_unknown">Unknown</string>
|
||||
<string name="status_playable">Playable</string>
|
||||
@@ -36,7 +36,7 @@
|
||||
<string name="status_not_working">Not working</string>
|
||||
<string name="status_loading">Loading…</string>
|
||||
<string name="use_at_your_risk">Not recommended, use at your own risk</string>
|
||||
<string name="patch_copy_libraries">Copy ovrport libraries</string>
|
||||
<string name="patch_copy_libraries">Copy overport libraries</string>
|
||||
<string name="patch_copy_ovrplugin_vrapi">Copy OVRPlugin if VrApi is present</string>
|
||||
<string name="patch_fix_min_android_sdk">Fix minimal Android SDK</string>
|
||||
<string name="patch_generate_config">Generate ovrport config</string>
|
||||
|
||||
@@ -11,10 +11,9 @@ import androidx.compose.ui.Modifier
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import moe.crx.overport.app.model.MainViewModel
|
||||
import moe.crx.overport.utils.CantCheckoutException
|
||||
import org.jetbrains.compose.resources.getString
|
||||
import overportapp.composeapp.generated.resources.Res
|
||||
import overportapp.composeapp.generated.resources.apk_file_exported
|
||||
import overportapp.composeapp.generated.resources.unknown_error
|
||||
import overportapp.composeapp.generated.resources.*
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
|
||||
@@ -101,6 +100,10 @@ fun PatcherScreen(
|
||||
try {
|
||||
viewModel.checkout(it, name)
|
||||
viewModel.prepare(stream)
|
||||
} catch (_: CantCheckoutException) {
|
||||
viewModel.cancel()
|
||||
errorMessage =
|
||||
getString(Res.string.cant_checkout_title) to getString(Res.string.cant_checkout_message)
|
||||
} catch (ex: Throwable) {
|
||||
viewModel.cancel()
|
||||
errorMessage = getString(Res.string.unknown_error) to ex.stackTraceToString()
|
||||
|
||||
+1
-2
@@ -35,12 +35,11 @@ fun VersionManagerSheet(viewModel: MainViewModel, onSelected: (String) -> Unit,
|
||||
}
|
||||
|
||||
ModalBottomSheet(
|
||||
modifier = Modifier.fillMaxHeight(),
|
||||
onDismissRequest = { onCancel() },
|
||||
) {
|
||||
if (available == null) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
modifier = Modifier.fillMaxWidth().height(240.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center
|
||||
) {
|
||||
|
||||
+1
-4
@@ -1,13 +1,10 @@
|
||||
#Kotlin
|
||||
kotlin.code.style=official
|
||||
kotlin.daemon.jvmargs=-Xmx2048M
|
||||
|
||||
#Gradle
|
||||
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8
|
||||
|
||||
#Android
|
||||
android.nonTransitiveRClass=true
|
||||
android.useAndroidX=true
|
||||
|
||||
#Application
|
||||
appVersion=1.2.0
|
||||
appVersion=1.2.1
|
||||
@@ -8,7 +8,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "moe.crx"
|
||||
version = "1.2.0"
|
||||
version = "1.2.1"
|
||||
|
||||
dependencies {
|
||||
implementation(libs.android.tools.build)
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.reandroid.archive.ArchiveFile
|
||||
import com.reandroid.archive.FileInputSource
|
||||
import com.reandroid.archive.io.ZipFileInput
|
||||
import moe.crx.overport.config.OverportPatchedInfo
|
||||
import moe.crx.overport.utils.CantCheckoutException
|
||||
import moe.crx.overport.utils.NameFormatter
|
||||
import moe.crx.overport.versions.VersionManager
|
||||
import org.jf.baksmali.Baksmali
|
||||
@@ -51,14 +52,8 @@ class PatcherContext(
|
||||
}
|
||||
|
||||
fun checkout() {
|
||||
var successful = VersionManager(patcherDirectory).checkout(overportVersion)
|
||||
|
||||
if (successful == null) {
|
||||
successful = VersionManager(patcherDirectory).checkout("latest")
|
||||
}
|
||||
|
||||
checkNotNull(successful)
|
||||
overportVersion = successful
|
||||
overportVersion = VersionManager(patcherDirectory).checkout(overportVersion)
|
||||
?: throw CantCheckoutException("Can't checkout an overport release. Please, check your internet connection or choose another version.")
|
||||
}
|
||||
|
||||
fun prepare(stream: InputStream) {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
package moe.crx.overport.utils
|
||||
|
||||
class CantCheckoutException(message: String) : IllegalStateException(message)
|
||||
@@ -10,7 +10,7 @@ class VersionManager(val workingDirectory: File) {
|
||||
|
||||
companion object {
|
||||
val json = Json { ignoreUnknownKeys = true }
|
||||
const val VERSION = "1.2.0"
|
||||
const val VERSION = "1.2.1"
|
||||
|
||||
private fun isVersionLower(left: String, right: String): Boolean {
|
||||
val (lY, lM, lD) = left.substringBeforeLast('-').split('.').map { it.toInt() }
|
||||
|
||||
Reference in new issue
Block a user