make build-aab.sh fix warning about xiso

This commit is contained in:
izzy2lost
2026-03-16 16:12:55 -04:00
parent 54390685c4
commit 4866875524
5 changed files with 82 additions and 27 deletions
+2 -2
View File
@@ -30,8 +30,8 @@ android {
minSdk = 26
targetSdk = 36
versionCode = 20
versionName = "1.1.9"
versionCode = 21
versionName = "1.2.0"
ndk {
abiFilters += listOf("arm64-v8a")
@@ -3,7 +3,6 @@ package com.izzy2lost.x1box
import android.content.Intent
import android.content.res.Configuration
import android.graphics.Bitmap
import android.graphics.Typeface
import android.net.Uri
import android.os.Bundle
import android.os.ParcelFileDescriptor
@@ -11,8 +10,6 @@ import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -609,11 +606,13 @@ class GameLibraryActivity : AppCompatActivity() {
for (game in games) {
val item = inflater.inflate(R.layout.item_game_entry, gamesListContainer, false)
val nameText = item.findViewById<TextView>(R.id.game_name_text)
val convertWarningText = item.findViewById<TextView>(R.id.game_convert_warning_text)
val sizeText = item.findViewById<TextView>(R.id.game_size_text)
val pathText = item.findViewById<TextView>(R.id.game_path_text)
val coverImage = item.findViewById<ImageView>(R.id.game_list_cover_image)
nameText.text = game.title
bindConvertibleWarning(convertWarningText, game)
sizeText.text = buildGameSizeText(game)
pathText.text = game.relativePath
@@ -654,9 +653,11 @@ class GameLibraryActivity : AppCompatActivity() {
row!!.addView(item, itemLp)
val nameText = item.findViewById<TextView>(R.id.game_cover_name_text)
val convertWarningText = item.findViewById<TextView>(R.id.game_cover_convert_warning_text)
val coverImage = item.findViewById<ImageView>(R.id.game_cover_image)
nameText.text = game.title
bindConvertibleWarning(convertWarningText, game)
item.setOnClickListener { launchGame(game) }
item.setOnLongClickListener { showGameContextMenu(game); true }
bindCoverArt(coverImage, game)
@@ -1199,29 +1200,16 @@ class GameLibraryActivity : AppCompatActivity() {
}
}
private fun buildGameSizeText(game: GameEntry): CharSequence {
val sizeLabel = getString(R.string.library_game_size, formatSize(game.sizeBytes))
if (game.discImageFormat != DiscImageFormat.REGULAR_ISO) {
return sizeLabel
private fun bindConvertibleWarning(view: TextView, game: GameEntry) {
view.visibility = if (game.discImageFormat == DiscImageFormat.REGULAR_ISO) {
View.VISIBLE
} else {
View.GONE
}
}
return SpannableStringBuilder(sizeLabel).apply {
append(" ")
val badgeStart = length
append(getString(R.string.library_regular_iso_badge))
setSpan(
ForegroundColorSpan(getColor(R.color.xemu_warning)),
badgeStart,
length,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
setSpan(
StyleSpan(Typeface.BOLD),
badgeStart,
length,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
private fun buildGameSizeText(game: GameEntry): CharSequence {
return getString(R.string.library_game_size, formatSize(game.sizeBytes))
}
private fun isConvertibleIso(game: GameEntry): Boolean {
@@ -42,8 +42,25 @@
android:maxLines="2"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.TitleSmall"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/game_cover_art_card" />
<TextView
android:id="@+id/game_cover_convert_warning_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="center_horizontal"
android:maxLines="1"
android:text="@string/library_regular_iso_badge"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.LabelSmall"
android:textColor="@color/xemu_warning"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/game_cover_name_text" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -53,6 +53,18 @@
android:maxLines="2"
android:textAppearance="@style/TextAppearance.Material3.TitleSmall" />
<TextView
android:id="@+id/game_convert_warning_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:maxLines="1"
android:text="@string/library_regular_iso_badge"
android:textAppearance="@style/TextAppearance.Material3.LabelSmall"
android:textColor="@color/xemu_warning"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/game_size_text"
android:layout_width="match_parent"
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -euo pipefail
project_source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
android_dir="${project_source_dir}/android"
key_props="${android_dir}/key.properties"
release_aab="${android_dir}/app/build/outputs/bundle/release/app-release.aab"
if [[ ! -f "${key_props}" ]]; then
printf 'Creating "%s" with placeholders...\n' "${key_props}"
cat >"${key_props}" <<'EOF'
storeFile=/path/to/your-release-key.jks
storePassword=REPLACE_ME
keyAlias=REPLACE_ME
keyPassword=REPLACE_ME
EOF
printf '\nEdit %s with your real values, then rerun this script.\n' "${key_props}"
exit 1
fi
if grep -Fq 'REPLACE_ME' "${key_props}"; then
printf '\nPlease replace the placeholders in %s before building.\n' "${key_props}"
exit 1
fi
if grep -Fq '/path/to/your-release-key.jks' "${key_props}" || \
grep -Fq 'C:/path/to/your-release-key.jks' "${key_props}"; then
printf '\nPlease replace the storeFile placeholder in %s before building.\n' "${key_props}"
exit 1
fi
cd "${android_dir}"
bash ./gradlew bundleRelease
printf '\nBuild complete.\n'
printf 'Release AAB:\n'
printf ' %s\n' "${release_aab}"