Skip to content

Commit be90c58

Browse files
committed
更换二维码扫描库依赖,解决原有依赖在高版本上相机无法启动的问题,添加 API 21 以上使用 Material 主题的配置。添加混淆过滤
1 parent 8317b68 commit be90c58

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

app/build.gradle

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,18 @@ android {
2424
}
2525
buildTypes {
2626
release {
27-
minifyEnabled false
27+
minifyEnabled true
2828
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2929
}
3030
}
3131
}
3232

33-
repositories {
34-
mavenCentral()
35-
36-
maven {
37-
url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
38-
}
39-
}
40-
4133
dependencies {
4234
compile fileTree(include: ['*.jar'], dir: 'libs')
4335

4436
testCompile 'junit:junit:4.12'
4537

46-
compile 'com.embarkmobile:zxing-android-minimal:2.0.0@aar'
47-
compile 'com.embarkmobile:zxing-android-integration:2.0.0@aar'
38+
compile 'com.journeyapps:zxing-android-embedded:3.5.0'
4839
compile 'com.google.zxing:core:3.0.1'
4940

5041
compile 'org.bouncycastle:bcprov-jdk15on:1.57'

app/proguard-rules.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18+
-keep class com.journeyapps.barcodescanner.** { *; }
19+
-dontwarn org.bouncycastle.**

app/src/main/java/com/vm/shadowsocks/ui/MainActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ public void onClick(DialogInterface dialogInterface, int i) {
170170

171171
private void scanForProxyUrl() {
172172
new IntentIntegrator(this)
173-
.setResultDisplayDuration(0)
174173
.setPrompt(getString(R.string.config_url_scan_hint))
175174
.initiateScan(IntentIntegrator.QR_CODE_TYPES);
176175
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 14+. This theme completely replaces
5+
AppBaseTheme from BOTH res/values/styles.xml and
6+
res/values-v11/styles.xml on API 14+ devices.
7+
-->
8+
<style name="AppBaseTheme" parent="android:Theme.Material.Light.DarkActionBar">
9+
<!-- API 14 theme customizations can go here. -->
10+
</style>
11+
12+
<style name="StyledScrollerTextAppearance" parent="@android:style/TextAppearance">
13+
<item name="android:textSize">24sp</item>
14+
<item name="android:textStyle">bold</item>
15+
<item name="android:textColor">@android:color/white</item>
16+
</style>
17+
18+
</resources>

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Base application theme, dependent on API level. This theme is replaced
55
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
66
-->
7-
<style name="AppBaseTheme" parent="android:Theme.Black">
7+
<style name="AppBaseTheme" parent="android:Theme.DeviceDefault.Light">
88
<!--
99
Theme customizations available in newer API levels can go in
1010
res/values-vXX/styles.xml, while customizations related to

0 commit comments

Comments
 (0)