Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
minimize apk size
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Chen <jerryc05@qq.com>
  • Loading branch information
Jerry Chen committed Jul 9, 2019
1 parent 79d37b6 commit 7d324c5
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@

*.jar
/app/build
/app/release
/app/debug
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,26 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "xxhdpi"
}
buildTypes {
release {
minifyEnabled false
zipAlignEnabled true
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

-dontpreverify

#-dontobfuscate
-dontobfuscate

-assumenosideeffects class android.util.Log {
public static boolean isLoggable(...);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/jerryc05/unlockme/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package jerryc05.unlockme;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down
17 changes: 8 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -9,10 +8,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:gravity="center"
android:text="Hello World!" />
</RelativeLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/raw/keep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<resources xmlns:tools="http://schemas.android.com/tools"
tools:shrinkMode="strict" />
8 changes: 4 additions & 4 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="android:Theme.DeviceDefault.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<!-- <item name="colorPrimary">@color/colorPrimary</item>-->
<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
<!-- <item name="colorAccent">@color/colorAccent</item>-->
</style>

</resources>
Binary file added signing.jks
Binary file not shown.

0 comments on commit 7d324c5

Please sign in to comment.