Skip to content

Commit

Permalink
Disable code shrinking for release
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Sep 23, 2023
1 parent ea0d3c8 commit d967f9c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Secrets
/android/key.properties
31 changes: 28 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
Expand Down Expand Up @@ -52,11 +58,27 @@ android {
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled false
shrinkResources false
signingConfig signingConfigs.release

/*proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
// List additional ProGuard rules for the given build type here. By default,
// Android Studio creates and includes an empty rules file for you (located
// at the root directory of each module).
"proguard-rules.pro"
)*/
}
}
}
Expand All @@ -75,3 +97,6 @@ dependencies {

//implementation "moe.shizuku:manager:$shizuku_version"
}



7 changes: 7 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-keep class org.samo_lego.canta.MainActivity {
*;
}

-keep class org.samo_lego.canta.ShizukuPackageInstallerUtils {
*;
}
5 changes: 3 additions & 2 deletions lib/kotlin_bind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ class KotlinBind {
try {
return await platform
.invokeMethod('reinstallApp', {'packageName': packageName});
} on PlatformException {}
return false;
} on PlatformException {
return false;
}
}

Future<AppInfo> getAppInfo(String packageName) async {
Expand Down

0 comments on commit d967f9c

Please sign in to comment.