summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorGravatar Charles Lombardo2023-04-15 00:09:30 -0400
committerGravatar bunnei2023-06-03 00:05:52 -0700
commitd57ae50f17a6b2ed12e188cd3764c506dcc86b74 (patch)
tree650bce03cb9f261ca0a26cb21c0a31e3bd2b803f /src/android
parentandroid: Switch from a colored status bar to a custom view (diff)
downloadyuzu-d57ae50f17a6b2ed12e188cd3764c506dcc86b74.tar.gz
yuzu-d57ae50f17a6b2ed12e188cd3764c506dcc86b74.tar.xz
yuzu-d57ae50f17a6b2ed12e188cd3764c506dcc86b74.zip
android: Enable code minification
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/build.gradle.kts7
-rw-r--r--src/android/app/proguard-rules.pro23
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt2
5 files changed, 18 insertions, 22 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts
index d8ef02ac1..bf6d42042 100644
--- a/src/android/app/build.gradle.kts
+++ b/src/android/app/build.gradle.kts
@@ -78,6 +78,12 @@ android {
78 // Signed by release key, allowing for upload to Play Store. 78 // Signed by release key, allowing for upload to Play Store.
79 release { 79 release {
80 signingConfig = signingConfigs.getByName("debug") 80 signingConfig = signingConfigs.getByName("debug")
81 isMinifyEnabled = true
82 isDebuggable = false
83 proguardFiles(
84 getDefaultProguardFile("proguard-android.txt"),
85 "proguard-rules.pro"
86 )
81 } 87 }
82 88
83 // builds a release build that doesn't need signing 89 // builds a release build that doesn't need signing
@@ -86,7 +92,6 @@ android {
86 initWith(getByName("release")) 92 initWith(getByName("release"))
87 versionNameSuffix = "-debug" 93 versionNameSuffix = "-debug"
88 signingConfig = signingConfigs.getByName("debug") 94 signingConfig = signingConfigs.getByName("debug")
89 isMinifyEnabled = false
90 enableAndroidTestCoverage = false 95 enableAndroidTestCoverage = false
91 isDebuggable = true 96 isDebuggable = true
92 isJniDebuggable = true 97 isJniDebuggable = true
diff --git a/src/android/app/proguard-rules.pro b/src/android/app/proguard-rules.pro
index f1b424510..2f695757c 100644
--- a/src/android/app/proguard-rules.pro
+++ b/src/android/app/proguard-rules.pro
@@ -1,21 +1,2 @@
1# Add project specific ProGuard rules here. 1# To get usable stack traces
2# You can control the set of applied configuration files using the 2-dontobfuscate
3# proguardFiles setting in build.gradle.
4#
5# For more details, see
6# http://developer.android.com/guide/developing/tools/proguard.html
7
8# If your project uses WebView with JS, uncomment the following
9# and specify the fully qualified class name to the JavaScript interface
10# class:
11#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12# public *;
13#}
14
15# Uncomment this to preserve the line number information for
16# debugging stack traces.
17#-keepattributes SourceFile,LineNumberTable
18
19# If you keep the line number information, uncomment this to
20# hide the original source file name.
21#-renamesourcefileattribute SourceFile
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt
index 1e654777a..cd9bc9ef0 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt
@@ -11,6 +11,7 @@ import android.text.method.LinkMovementMethod
11import android.view.Surface 11import android.view.Surface
12import android.view.View 12import android.view.View
13import android.widget.TextView 13import android.widget.TextView
14import androidx.annotation.Keep
14import androidx.fragment.app.DialogFragment 15import androidx.fragment.app.DialogFragment
15import com.google.android.material.dialog.MaterialAlertDialogBuilder 16import com.google.android.material.dialog.MaterialAlertDialogBuilder
16import org.yuzu.yuzu_emu.YuzuApplication.Companion.appContext 17import org.yuzu.yuzu_emu.YuzuApplication.Companion.appContext
@@ -53,6 +54,7 @@ object NativeLibrary {
53 } 54 }
54 } 55 }
55 56
57 @Keep
56 @JvmStatic 58 @JvmStatic
57 fun openContentUri(path: String?, openmode: String?): Int { 59 fun openContentUri(path: String?, openmode: String?): Int {
58 return if (isNativePath(path!!)) { 60 return if (isNativePath(path!!)) {
@@ -60,6 +62,7 @@ object NativeLibrary {
60 } else openContentUri(appContext, path, openmode) 62 } else openContentUri(appContext, path, openmode)
61 } 63 }
62 64
65 @Keep
63 @JvmStatic 66 @JvmStatic
64 fun getSize(path: String?): Long { 67 fun getSize(path: String?): Long {
65 return if (isNativePath(path!!)) { 68 return if (isNativePath(path!!)) {
@@ -340,6 +343,7 @@ object NativeLibrary {
340 return coreErrorAlertResult 343 return coreErrorAlertResult
341 } 344 }
342 345
346 @Keep
343 @JvmStatic 347 @JvmStatic
344 fun exitEmulationActivity(resultCode: Int) { 348 fun exitEmulationActivity(resultCode: Int) {
345 val Success = 0 349 val Success = 0
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt
index e6485d039..82a6712b6 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt
@@ -10,12 +10,14 @@ import android.view.KeyEvent
10import android.view.View 10import android.view.View
11import android.view.WindowInsets 11import android.view.WindowInsets
12import android.view.inputmethod.InputMethodManager 12import android.view.inputmethod.InputMethodManager
13import androidx.annotation.Keep
13import androidx.core.view.ViewCompat 14import androidx.core.view.ViewCompat
14import org.yuzu.yuzu_emu.NativeLibrary 15import org.yuzu.yuzu_emu.NativeLibrary
15import org.yuzu.yuzu_emu.R 16import org.yuzu.yuzu_emu.R
16import org.yuzu.yuzu_emu.applets.keyboard.ui.KeyboardDialogFragment 17import org.yuzu.yuzu_emu.applets.keyboard.ui.KeyboardDialogFragment
17import java.io.Serializable 18import java.io.Serializable
18 19
20@Keep
19object SoftwareKeyboard { 21object SoftwareKeyboard {
20 lateinit var data: KeyboardData 22 lateinit var data: KeyboardData
21 val dataLock = Object() 23 val dataLock = Object()
@@ -91,6 +93,7 @@ object SoftwareKeyboard {
91 Cancel 93 Cancel
92 } 94 }
93 95
96 @Keep
94 data class KeyboardConfig( 97 data class KeyboardConfig(
95 var ok_text: String? = null, 98 var ok_text: String? = null,
96 var header_text: String? = null, 99 var header_text: String? = null,
@@ -113,5 +116,6 @@ object SoftwareKeyboard {
113 ) : Serializable 116 ) : Serializable
114 117
115 // Corresponds to Frontend::KeyboardData 118 // Corresponds to Frontend::KeyboardData
119 @Keep
116 data class KeyboardData(var result: Int, var text: String) 120 data class KeyboardData(var result: Int, var text: String)
117} 121}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt
index 9b665c7a0..3b1559c80 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt
@@ -3,10 +3,12 @@
3 3
4package org.yuzu.yuzu_emu.disk_shader_cache 4package org.yuzu.yuzu_emu.disk_shader_cache
5 5
6import androidx.annotation.Keep
6import org.yuzu.yuzu_emu.NativeLibrary 7import org.yuzu.yuzu_emu.NativeLibrary
7import org.yuzu.yuzu_emu.R 8import org.yuzu.yuzu_emu.R
8import org.yuzu.yuzu_emu.disk_shader_cache.ui.ShaderProgressDialogFragment 9import org.yuzu.yuzu_emu.disk_shader_cache.ui.ShaderProgressDialogFragment
9 10
11@Keep
10object DiskShaderCacheProgress { 12object DiskShaderCacheProgress {
11 val finishLock = Object() 13 val finishLock = Object()
12 private lateinit var fragment: ShaderProgressDialogFragment 14 private lateinit var fragment: ShaderProgressDialogFragment