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

Commit

Permalink
Fix start load failed first time
Browse files Browse the repository at this point in the history
  • Loading branch information
东煜 committed Jun 18, 2019
1 parent e6c6008 commit 04b096c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
4 changes: 0 additions & 4 deletions android/playground/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion project.compileSdkVersion
// buildToolsVersion project.buildToolsVersion
// packagingOptions {
// pickFirst '**/libc++_shared.so'
// }
defaultConfig {
applicationId "com.alibaba.weex"
minSdkVersion project.minSdkVersion
Expand Down
18 changes: 9 additions & 9 deletions android/playground/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ under the License.
android:name=".update.UpdateService"
android:exported="false" />

<!--<provider-->
<!--android:name="android.support.v4.content.FileProvider"-->
<!--android:authorities="com.alibaba.weex.fileprovider"-->
<!--android:grantUriPermissions="true"-->
<!--android:exported="false">-->
<!--<meta-data-->
<!--android:name="android.support.FILE_PROVIDER_PATHS"-->
<!--android:resource="@xml/filepaths" />-->
<!--</provider>-->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.alibaba.weex.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>

</application>

Expand Down
20 changes: 8 additions & 12 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ android {
// buildToolsVersion project.buildToolsVersion
resourcePrefix "weex"
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'lib/armeabi-v7a/libc++_shared.so'
exclude 'lib/arm64-v8a/libc++_shared.so'
exclude 'lib/x86/libc++_shared.so'
}
copy {
from '../../pre-build'
into new File(projectDir,"assets")
Expand Down Expand Up @@ -298,7 +293,7 @@ task checkNdkVersion() {

preBuild.dependsOn checkNdkVersion

def siteUrl = 'http://weex.incubator.apache.org'
def siteUrl = 'https://weex.incubator.apache.org'
def gitUrl = 'https://github.com/apache/incubator-weex.git'
group = "com.taobao.android"
install {
Expand All @@ -309,12 +304,12 @@ install {
packaging 'aar'
name 'weex_sdk'
url siteUrl
// licenses {
// license {
// name 'The Apache Software License, Version 2.0'
// url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
// }
// }
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'weex alibaba'
Expand Down Expand Up @@ -355,6 +350,7 @@ bintray {
version {
//The version to be published
name = project.version
vcsTag = project.version
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public class WXEnvironment {

public static final String CORE_SO_NAME = "weexcore";
public static final String CORE_JSS_SO_NAME = "weexjss";
public static final String CORE_JSB_SO_NAME = "weexjsb";
public static final String CORE_JST_SO_NAME = "weexjst";
public static final String CORE_JSC_SO_NAME = "JavaScriptCore";
/**
* this marked jsb.so's version, Change this if we want to update jsb.so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;

import com.taobao.weex.IWXStatisticsListener;
import com.taobao.weex.WXEnvironment;
import com.taobao.weex.adapter.IWXSoLoaderAdapter;
Expand Down Expand Up @@ -217,9 +219,11 @@ public static void copyStartUpSo() {
// if android api < 16 copy libweexjst.so else copy libweexjsb.so
boolean pieSupport = true;
File newfile;
String startSoName = WXEnvironment.CORE_JSB_SO_NAME;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
pieSupport = false;
newfile = new File(cacheFile + STARTUPSOANDROID15);
startSoName = WXEnvironment.CORE_JST_SO_NAME;
} else {
newfile = new File(cacheFile + STARTUPSO);
}
Expand Down Expand Up @@ -261,6 +265,18 @@ public static void copyStartUpSo() {
}

File oldfile = new File(soName);


if(!oldfile.exists()) {
try {
String weexjsb = ((PathClassLoader) (WXSoInstallMgrSdk.class.getClassLoader())).findLibrary(startSoName);
oldfile = new File(weexjsb);
} catch (Throwable throwable) {
// do nothing
}

}

if (oldfile.exists()) {
WXFileUtils.copyFile(oldfile, newfile);
} else {
Expand Down

0 comments on commit 04b096c

Please sign in to comment.