Skip to content

Commit 19f8d3d

Browse files
committed
1. 升级识兔到RN0.59版本
1 parent d096458 commit 19f8d3d

33 files changed

+2183
-1721
lines changed

android/app/BUCK

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",

android/app/build.gradle

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import com.android.build.OutputFile
7575
*/
7676

7777
project.ext.react = [
78-
entryFile: "index_old.js"
78+
entryFile: "index.js"
7979
]
8080

8181
apply from: "../../node_modules/react-native/react.gradle"
@@ -102,26 +102,28 @@ bugly {
102102

103103
android {
104104
compileSdkVersion rootProject.ext.compileSdkVersion
105-
buildToolsVersion rootProject.ext.buildToolsVersion
105+
106+
compileOptions {
107+
sourceCompatibility JavaVersion.VERSION_1_8
108+
targetCompatibility JavaVersion.VERSION_1_8
109+
}
106110

107111
defaultConfig {
108112
applicationId "com.shitu"
109113
minSdkVersion rootProject.ext.minSdkVersion
110114
targetSdkVersion rootProject.ext.targetSdkVersion
111115
versionCode 1
112116
versionName "1.0"
113-
ndk {
114-
abiFilters "armeabi-v7a", "x86"
115-
}
116117
}
117118
splits {
118119
abi {
119120
reset()
120121
enable enableSeparateBuildPerCPUArchitecture
121122
universalApk false // If true, also generate a universal APK
122-
include "armeabi-v7a", "x86"
123+
include "armeabi-v7a", "x86", "arm64-v8a", "x86-64"
123124
}
124125
}
126+
125127
signingConfigs {
126128
release {
127129
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
@@ -130,8 +132,10 @@ android {
130132
keyAlias MYAPP_RELEASE_KEY_ALIAS
131133
keyPassword MYAPP_RELEASE_KEY_PASSWORD
132134
}
133-
}
134-
}
135+
}
136+
}
137+
138+
135139
buildTypes {
136140
release {
137141
minifyEnabled enableProguardInReleaseBuilds
@@ -144,56 +148,52 @@ android {
144148
if (variant.buildType.name != "debug") {
145149
variant.getPackageApplication().outputDirectory = new File(project.rootDir.absolutePath + "/apk/release")
146150
}
151+
147152
variant.outputs.each { output ->
148153
// For each separate APK per architecture, set a unique version code as described here:
149154
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
150-
def versionCodes = ["armeabi-v7a":1, "x86":2]
155+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86-64": 4]
151156
def abi = output.getFilter(OutputFile.ABI)
152157
if (abi != null) { // null for the universal-debug, universal-release variants
153158
output.versionCodeOverride =
154159
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
155160
}
156161
}
157162
}
158-
android {
159-
sourceSets {
160-
main.jniLibs.srcDirs = ['libs']
161-
}
162-
lintOptions {
163-
abortOnError false
164-
}
165-
}
166163
walle {
167-
// 指定渠道包的输出路径
164+
// 指定渠道包的输出路径
168165
apkOutputFolder = new File("${project.rootDir}/apk/channels");
169-
// 定制渠道包的APK的文件名称
170-
// apkFileNameFormat = '${appName}-${packageName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk';
166+
// 定制渠道包的APK的文件名称
167+
// apkFileNameFormat = '${appName}-${packageName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk';
171168
apkFileNameFormat = 'ShiTu-${channel}-${buildType}-v${versionName}.apk';
172169
// 渠道配置文件
173170
channelFile = new File("${project.getProjectDir()}/channel")
174171
}
172+
175173
}
176174

177175
dependencies {
178-
compile project(':react-native-webview')
179-
compile project(':react-native-measure-text')
180-
compile project(':react-native-spring-scrollview')
181-
compile project(':rn-fetch-blob')
182-
compile project(':react-native-vector-icons')
183-
compile project(':react-native-splash-screen')
184-
compile project(':react-native-linear-gradient')
185-
compile project(':react-native-image-picker')
186-
compile project(':react-native-gesture-handler')
187-
compile project(':react-native-fast-image')
176+
implementation project(':react-native-webview')
177+
implementation project(':rn-fetch-blob')
178+
implementation project(':react-native-vector-icons')
179+
implementation project(':react-native-spring-scrollview')
180+
implementation project(':react-native-splash-screen')
181+
implementation project(':react-native-measure-text')
182+
implementation project(':react-native-linear-gradient')
183+
implementation project(':react-native-image-picker')
184+
implementation project(':react-native-gesture-handler')
185+
implementation project(':react-native-fast-image')
188186
implementation fileTree(dir: "libs", include: ["*.jar"])
189187
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
190188
implementation "com.facebook.react:react-native:+" // From node_modules
191189

192-
compile 'com.tencent.bugly:crashreport:2.8.6.0'
193-
compile 'com.tencent.bugly:nativecrashreport:3.6.0.1'
194-
compile 'com.meituan.android.walle:library:1.1.6'
195-
compile 'com.android.support:support-v4:27.1.1'
196-
compile 'com.android.support:multidex:1.0.3'
190+
implementation 'com.tencent.bugly:crashreport:2.8.6.0'
191+
implementation 'com.tencent.bugly:nativecrashreport:3.6.0.1'
192+
implementation 'com.meituan.android.walle:library:1.1.6'
193+
implementation 'com.android.support:support-v4:27.1.1'
194+
implementation 'com.android.support:multidex:1.0.3'
195+
196+
197197
}
198198

199199
// Run this once to be able to run the application with BUCK

android/app/build_defs.bzl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Helper definitions to glob .aar and .jar targets"""
2+
3+
def create_aar_targets(aarfiles):
4+
for aarfile in aarfiles:
5+
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6+
lib_deps.append(":" + name)
7+
android_prebuilt_aar(
8+
name = name,
9+
aar = aarfile,
10+
)
11+
12+
def create_jar_targets(jarfiles):
13+
for jarfile in jarfiles:
14+
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15+
lib_deps.append(":" + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
8+
</manifest>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="false">localhost</domain>
5+
<domain includeSubdomains="false">10.0.2.2</domain>
6+
<domain includeSubdomains="false">10.0.3.2</domain>
7+
</domain-config>
8+
</network-security-config>

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.shitu">
2+
package="com.shitu">
33

44
<uses-permission android:name="android.permission.INTERNET" />
5-
<uses-permission android:name="android.permission.CAMERA" />
6-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
7-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
8-
9-
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
10-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
11-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
12-
<uses-permission android:name="android.permission.READ_LOGS"/>
135

146
<application
157
android:name=".MainApplication"
168
android:label="@string/app_name"
179
android:icon="@mipmap/ic_launcher"
10+
android:roundIcon="@mipmap/ic_launcher_round"
1811
android:allowBackup="false"
19-
android:largeHeap="true"
2012
android:theme="@style/AppTheme">
2113
<activity
2214
android:name=".MainActivity"
@@ -26,7 +18,6 @@
2618
<intent-filter>
2719
<action android:name="android.intent.action.MAIN" />
2820
<category android:name="android.intent.category.LAUNCHER" />
29-
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
3021
</intent-filter>
3122
</activity>
3223
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
-1.15 KB
Binary file not shown.
-6 KB
Binary file not shown.
-10.5 KB
Binary file not shown.
112 KB
Binary file not shown.

0 commit comments

Comments
 (0)