Unverified Commit fbc70c01 authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub
Browse files

build: use proguard and remove internet permission in android (#578)

* build: use proguard to reduce package size

* remove intenet permission

* only use intenet permission in debug to connect react server

* update bundle

* format

* Revert "update bundle"

This reverts commit 299cf394.
parent f89586c0
Pipeline #90918 failed with stages
in 3 minutes and 44 seconds
......@@ -166,8 +166,8 @@ android {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
// signingConfig signingConfigs.debug
// minifyEnabled enableProguardInReleaseBuilds
// proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
splits {
......
......@@ -11,7 +11,7 @@
# Disabling obfuscation is useful if you collect stack traces from production crashes
# (unless you are using a system that supports de-obfuscate the stack traces).
-dontobfuscate
# -dontobfuscate
# React Native
......@@ -20,13 +20,16 @@
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep,allowobfuscation @interface com.facebook.jni.annotations.DoNotStrip
# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keep @com.facebook.jni.annotations.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
@com.facebook.jni.annotations.DoNotStrip *;
}
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
......@@ -42,10 +45,7 @@
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
-dontwarn com.facebook.react.**
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
# okhttp
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.INTERNET" />
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.parity.signer">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA" />
......
......@@ -21,5 +21,6 @@ MYAPP_RELEASE_STORE_FILE=apk.keystore
MYAPP_RELEASE_KEY_ALIAS=testing
MYAPP_RELEASE_STORE_PASSWORD=testing
MYAPP_RELEASE_KEY_PASSWORD=testing
android.enableR8=false
android.useAndroidX=true
android.enableJetifier=true
\ No newline at end of file
android.enableJetifier=true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment