Skip to content

Commit c0d292a

Browse files
committed
assemble config
1 parent c81ee28 commit c0d292a

File tree

4 files changed

+200
-14
lines changed

4 files changed

+200
-14
lines changed

VideoOS/key.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
keystore.path=../videodev.jks
2+
keystore.password=videodev
3+
keystore.alias=videodev
4+
keystore.alias_password=videodev

VideoOS/videodev.jks

2.17 KB
Binary file not shown.

VideoOS/videoos_dev_app/build.gradle

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
apply plugin: 'com.android.application'
22

3+
def keystoreFilepath = ''
4+
def keystorePSW = ''
5+
def keystoreAlias = ''
6+
def keystoreAliasPSW = ''
7+
8+
Properties properties = new Properties()
9+
properties.load(project.rootProject.file('key.properties').newDataInputStream())
10+
keystoreFilepath = properties.getProperty("keystore.path")
11+
12+
if (keystoreFilepath) {
13+
keystorePSW = properties.getProperty("keystore.password")
14+
keystoreAlias = properties.getProperty("keystore.alias")
15+
keystoreAliasPSW = properties.getProperty("keystore.alias_password")
16+
} else {
17+
keystoreFilepath = "${System.properties['user.home']}/.android/debug.keystore"
18+
println("No release keystore found. Using default at [$keystoreFilepath]")
19+
keystorePSW = 'android'
20+
keystoreAlias = 'androiddebugkey'
21+
keystoreAliasPSW = 'android'
22+
}
23+
24+
325
configurations.all {
426
resolutionStrategy.force 'com.android.support:support-annotations:28.0.0'
527
}
@@ -10,7 +32,7 @@ android {
1032
defaultConfig {
1133
applicationId "both.video.venvy.com.appdemodev"
1234
minSdkVersion 19
13-
targetSdkVersion 21
35+
targetSdkVersion 28
1436
versionCode 1
1537
versionName "1.0.0"
1638
javaCompileOptions {
@@ -24,23 +46,28 @@ android {
2446
targetCompatibility JavaVersion.VERSION_1_7
2547
}
2648
}
49+
50+
signingConfigs {
51+
release {
52+
storeFile file(keystoreFilepath)
53+
storePassword keystorePSW
54+
keyAlias keystoreAlias
55+
keyPassword keystoreAliasPSW
56+
}
57+
}
58+
59+
2760
buildTypes {
2861
debug {
2962
minifyEnabled false
3063
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3164
}
3265
release {
33-
//是否混淆
34-
minifyEnabled true
35-
shrinkResources true
36-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
37-
}
38-
39-
preRelease {
40-
//是否混淆
4166
minifyEnabled true
67+
zipAlignEnabled true
4268
shrinkResources true
4369
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
70+
signingConfig signingConfigs.release
4471
}
4572
}
4673

@@ -80,7 +107,6 @@ dependencies {
80107
compile 'com.squareup.okhttp3:okhttp:3.4.1'
81108
compile 'com.squareup.okio:okio:1.12.0'
82109
compile 'com.just.agentweb:agentweb:4.1.2'
83-
compile 'com.alibaba:fastjson:1.1.70.android'
84110
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
85111
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.6.2'
86112
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'

VideoOS/videoos_dev_app/proguard-rules.pro

Lines changed: 160 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,166 @@
2424
# hide the original source file name.
2525
#-renamesourcefileattribute SourceFile
2626

27-
-ignorewarnings
27+
-optimizationpasses 5
28+
29+
# 混合时不使用大小写混合,混合后的类名为小写
30+
-dontusemixedcaseclassnames
31+
32+
# 指定不去忽略非公共库的类
33+
-dontskipnonpubliclibraryclasses
34+
35+
# 不做预校验,preverify是proguard的四个步骤之一,Android不需要preverify,去掉这一步能够加快混淆速度。
36+
-dontpreverify
37+
38+
# 保留Annotation不混淆
39+
-keepattributes *Annotation*,Exceptions
40+
#javascriript与webview交互
41+
-keepattributes *JavascriptInterface*
42+
43+
# 避免混淆泛型
44+
-keepattributes Signature
45+
46+
#-keepattributes InnerClasses
47+
48+
# 抛出异常时保留代码行号
49+
-keepattributes SourceFile,LineNumberTable
50+
51+
-keepattributes EnclosingMethod
52+
53+
# 指定混淆是采用的算法,后面的参数是一个过滤器
54+
# 这个过滤器是谷歌推荐的算法,一般不做更改
55+
-optimizations !code/simplification/cast,!field/*,!class/merging/*
56+
57+
# 保留我们使用的四大组件,自定义的Application等等这些类不被混淆
58+
# 因为这些子类都有可能被外部调用
59+
-keep public class * extends android.support.v7.app.AppCompatActivity
60+
-keep public class * extends android.app.Application
61+
-keep public class * extends android.app.Service
62+
-keep public class * extends android.app.Fragment
63+
-keep public class * extends android.support.v4.app.Fragment
64+
-keep public class * extends android.content.BroadcastReceiver
65+
-keep public class * extends android.content.ContentProvider
66+
-keep public class * extends android.app.backup.BackupAgentHelper
67+
-keep public class * extends android.preference.Preference
68+
-keep public class * extends android.view.View
69+
-keep public class com.android.vending.licensing.ILicensingService
70+
71+
# 保留support下的所有类及其内部类
72+
-keep class android.support.** {*;}
73+
74+
# 保留继承的
75+
-keep public class * extends android.support.v4.**
76+
-keep public class * extends android.support.v7.**
77+
-keep public class * extends android.support.annotation.**
78+
79+
# 保留枚举类不被混淆
80+
-keepclassmembers enum * {
81+
public static **[] values();
82+
public static ** valueOf(java.lang.String);
83+
}
84+
85+
# 保留我们自定义控件(继承自View)不被混淆
86+
-keep public class * extends android.view.View{
87+
*** get*();
88+
void set*(***);
89+
public <init>(android.content.Context);
90+
public <init>(android.content.Context, android.util.AttributeSet);
91+
public <init>(android.content.Context, android.util.AttributeSet, int);
92+
}
93+
94+
# 保留Parcelable序列化类不被混淆
95+
-keep class * implements android.os.Parcelable {
96+
public static final android.os.Parcelable$Creator *;
97+
}
98+
99+
# 保留Serializable序列化的类不被混淆
100+
-keepclassmembers class * implements java.io.Serializable {
101+
static final long serialVersionUID;
102+
private static final java.io.ObjectStreamField[] serialPersistentFields;
103+
!static !transient <fields>;
104+
!private <fields>;
105+
!private <methods>;
106+
private void writeObject(java.io.ObjectOutputStream);
107+
private void readObject(java.io.ObjectInputStream);
108+
java.lang.Object writeReplace();
109+
java.lang.Object readResolve();
110+
}
111+
112+
113+
# webView处理,项目中没有使用到webView忽略即可
114+
-keepclassmembers class cn.com.venvy.video.huoxbao.webview.InviteBridge {
115+
public *;
116+
}
117+
118+
-keepclassmembers class * extends android.app.Activity {
119+
public void *(android.view.View);
120+
}
121+
122+
-keep class com.bumptech.glide.**{*;}
123+
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
124+
-keep public class * implements com.bumptech.glide.module.GlideModule
125+
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
126+
**[] $VALUES;
127+
public *;
128+
}
129+
130+
-keep class com.alibaba.fastjson.** { *; }
131+
132+
133+
-keep class org.apache.http.** { *; }
134+
-dontwarn org.apache.http.**
135+
-keep class android.net.http.** { *; }
136+
-dontwarn android.net.http.**
137+
138+
### okhttp
139+
### see https://github.com/square/okhttp/blob/master/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro
140+
-dontwarn javax.annotation.**
141+
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
142+
-dontwarn org.codehaus.mojo.animal_sniffer.*
143+
-dontwarn okhttp3.internal.platform.ConscryptPlatform
144+
145+
146+
147+
-keep class com.chad.library.adapter.** {
148+
*;
149+
}
150+
-keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
151+
-keep public class * extends com.chad.library.adapter.base.BaseViewHolder
152+
-keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
153+
<init>(...);
154+
}
155+
156+
28157
#videojj
29158
-keep public class cn.com.venvy.processor.build.venvy_pub$$VenvyRoleMapUtil{ *; }
30159
-keep class cn.com.venvy.lua.** {
31160
<fields>;
32161
<methods>;
33162
}
163+
164+
165+
# videojj
166+
-keep class cn.com.venvy.** {
167+
<fields>;
168+
<methods>;
169+
}
170+
-keep class com.taobao.luaview.** {
171+
<fields>;
172+
<methods>;
173+
}
174+
-keep class org.luaj.vm2.** {
175+
<fields>;
176+
<methods>;
177+
}
34178
-keep class cn.com.videopls.** {
35-
<fields>;
36-
<methods>;
179+
*;
180+
}
181+
-dontwarn cn.com.videopls.**
182+
183+
# Mqtt
184+
-keep class org.eclipse.paho.client.mqttv3.** {
185+
<fields>;
186+
<methods>;
37187
}
38188

39189
#gsyPlayer
@@ -52,4 +202,10 @@
52202
public <init>(android.content.Context);
53203
public <init>(android.content.Context, android.util.AttributeSet);
54204
public <init>(android.content.Context, android.util.AttributeSet, int);
55-
}
205+
}
206+
207+
-keep class com.just.agentweb.** {
208+
*;
209+
}
210+
-dontwarn com.just.agentweb.**
211+
-keepclassmembers class com.just.agentweb.sample.common.AndroidInterface{ *; }

0 commit comments

Comments
 (0)