Skip to content

Commit

Permalink
Merge pull request #3 from QuantumPhysique/proguard2
Browse files Browse the repository at this point in the history
0.4.1 - add proguard
  • Loading branch information
braniii authored Oct 30, 2023
2 parents ede6525 + 412c5df commit a58c6b6
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 78 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]


## [0.4.1] - 2023-10-30
### Other changes:
- Upgrade dependencies
- Setup Proguard optimization


## [0.4.0] - 2023-10-25
### API changes warning ⚠️:
- App id changed to `de.quantumphysique.trale`, upgrading is not possible!
Expand Down Expand Up @@ -91,7 +98,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- initial release


[Unreleased]: https://github.com/quantumphysique/trale/compare/v0.4.0...main
[Unreleased]: https://github.com/quantumphysique/trale/compare/v0.4.1...main
[0.4.1]: https://github.com/quantumphysique/trale/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/quantumphysique/trale/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/quantumphysique/trale/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/quantumphysique/trale/compare/v0.2.2...v0.3.0
Expand Down
17 changes: 17 additions & 0 deletions app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,25 @@ android {
buildTypes {
release {
signingConfig signingConfigs.release

// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type. Make sure to use a build
// variant with `debuggable false`.
minifyEnabled true

// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources true

// Includes the default ProGuard rules files that are packaged with
// the Android Gradle plugin. To learn more, go to the section about
// R8 configuration files.
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
namespace 'de.quantumphysique.trale'
}

flutter {
Expand Down
53 changes: 53 additions & 0 deletions app/android/app/proguard-android-optimize.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Flutter
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }

# Retrofit
-keepattributes Signature
-keepattributes Exceptions

# Other
-keepattributes *Annotation*
-keepattributes SourceFile, LineNumberTable

# Logging
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
public static *** i(...);
public static *** w(...);
public static *** e(...);
public static *** wtf(...);
}

-assumenosideeffects class io.flutter.Log {
public static *** d(...);
public static *** v(...);
public static *** w(...);
public static *** e(...);
}

-assumenosideeffects class java.util.logging.Level {
public static *** w(...);
public static *** d(...);
public static *** v(...);
}

-assumenosideeffects class java.util.logging.Logger {
public static *** w(...);
public static *** d(...);
public static *** v(...);
}

# Removes third parties logging
-assumenosideeffects class org.slf4j.Logger {
public *** trace(...);
public *** debug(...);
public *** info(...);
public *** warn(...);
public *** error(...);
}
2 changes: 1 addition & 1 deletion app/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gitlab.mobilemovement.trale.app">
package="de.quantumphysique.trale">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 2 additions & 1 deletion app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gitlab.mobilemovement.trale.app">
package="de.quantumphysique.trale">
<application
android:label="trale"
android:usesCleartextTraffic="false"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gitlab.mobilemovement.trale.app
package de.quantumphysique.trale

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion app/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gitlab.mobilemovement.trale.app">
package="de.quantumphysique.trale">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Loading

0 comments on commit a58c6b6

Please sign in to comment.