Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 04b096c

Browse files
author
东煜
committed
Fix start load failed first time
1 parent e6c6008 commit 04b096c

File tree

5 files changed

+35
-25
lines changed

5 files changed

+35
-25
lines changed

android/playground/app/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ apply plugin: 'com.android.application'
66

77
android {
88
compileSdkVersion project.compileSdkVersion
9-
// buildToolsVersion project.buildToolsVersion
10-
// packagingOptions {
11-
// pickFirst '**/libc++_shared.so'
12-
// }
139
defaultConfig {
1410
applicationId "com.alibaba.weex"
1511
minSdkVersion project.minSdkVersion

android/playground/app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ under the License.
128128
android:name=".update.UpdateService"
129129
android:exported="false" />
130130

131-
<!--<provider-->
132-
<!--android:name="android.support.v4.content.FileProvider"-->
133-
<!--android:authorities="com.alibaba.weex.fileprovider"-->
134-
<!--android:grantUriPermissions="true"-->
135-
<!--android:exported="false">-->
136-
<!--<meta-data-->
137-
<!--android:name="android.support.FILE_PROVIDER_PATHS"-->
138-
<!--android:resource="@xml/filepaths" />-->
139-
<!--</provider>-->
131+
<provider
132+
android:name="android.support.v4.content.FileProvider"
133+
android:authorities="com.alibaba.weex.fileprovider"
134+
android:grantUriPermissions="true"
135+
android:exported="false">
136+
<meta-data
137+
android:name="android.support.FILE_PROVIDER_PATHS"
138+
android:resource="@xml/filepaths" />
139+
</provider>
140140

141141
</application>
142142

android/sdk/build.gradle

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ android {
9090
// buildToolsVersion project.buildToolsVersion
9191
resourcePrefix "weex"
9292
useLibrary 'org.apache.http.legacy'
93-
packagingOptions {
94-
exclude 'lib/armeabi-v7a/libc++_shared.so'
95-
exclude 'lib/arm64-v8a/libc++_shared.so'
96-
exclude 'lib/x86/libc++_shared.so'
97-
}
9893
copy {
9994
from '../../pre-build'
10095
into new File(projectDir,"assets")
@@ -298,7 +293,7 @@ task checkNdkVersion() {
298293

299294
preBuild.dependsOn checkNdkVersion
300295

301-
def siteUrl = 'http://weex.incubator.apache.org'
296+
def siteUrl = 'https://weex.incubator.apache.org'
302297
def gitUrl = 'https://github.com/apache/incubator-weex.git'
303298
group = "com.taobao.android"
304299
install {
@@ -309,12 +304,12 @@ install {
309304
packaging 'aar'
310305
name 'weex_sdk'
311306
url siteUrl
312-
// licenses {
313-
// license {
314-
// name 'The Apache Software License, Version 2.0'
315-
// url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
316-
// }
317-
// }
307+
licenses {
308+
license {
309+
name 'The Apache Software License, Version 2.0'
310+
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
311+
}
312+
}
318313
developers {
319314
developer {
320315
id 'weex alibaba'
@@ -355,6 +350,7 @@ bintray {
355350
version {
356351
//The version to be published
357352
name = project.version
353+
vcsTag = project.version
358354
}
359355
}
360356
}

android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public class WXEnvironment {
127127

128128
public static final String CORE_SO_NAME = "weexcore";
129129
public static final String CORE_JSS_SO_NAME = "weexjss";
130+
public static final String CORE_JSB_SO_NAME = "weexjsb";
131+
public static final String CORE_JST_SO_NAME = "weexjst";
130132
public static final String CORE_JSC_SO_NAME = "JavaScriptCore";
131133
/**
132134
* this marked jsb.so's version, Change this if we want to update jsb.so

android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import android.content.pm.ApplicationInfo;
2323
import android.os.Build;
2424
import android.text.TextUtils;
25+
import android.util.Log;
26+
2527
import com.taobao.weex.IWXStatisticsListener;
2628
import com.taobao.weex.WXEnvironment;
2729
import com.taobao.weex.adapter.IWXSoLoaderAdapter;
@@ -217,9 +219,11 @@ public static void copyStartUpSo() {
217219
// if android api < 16 copy libweexjst.so else copy libweexjsb.so
218220
boolean pieSupport = true;
219221
File newfile;
222+
String startSoName = WXEnvironment.CORE_JSB_SO_NAME;
220223
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
221224
pieSupport = false;
222225
newfile = new File(cacheFile + STARTUPSOANDROID15);
226+
startSoName = WXEnvironment.CORE_JST_SO_NAME;
223227
} else {
224228
newfile = new File(cacheFile + STARTUPSO);
225229
}
@@ -261,6 +265,18 @@ public static void copyStartUpSo() {
261265
}
262266

263267
File oldfile = new File(soName);
268+
269+
270+
if(!oldfile.exists()) {
271+
try {
272+
String weexjsb = ((PathClassLoader) (WXSoInstallMgrSdk.class.getClassLoader())).findLibrary(startSoName);
273+
oldfile = new File(weexjsb);
274+
} catch (Throwable throwable) {
275+
// do nothing
276+
}
277+
278+
}
279+
264280
if (oldfile.exists()) {
265281
WXFileUtils.copyFile(oldfile, newfile);
266282
} else {

0 commit comments

Comments
 (0)