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

Commit

Permalink
* [Android] Rename Android package name from 'com.taobao.weex' to 'or…
Browse files Browse the repository at this point in the history
…g.apache.weex'
  • Loading branch information
YorkShen committed Sep 23, 2019
1 parent ec1ec23 commit 19fc503
Show file tree
Hide file tree
Showing 412 changed files with 2,238 additions and 2,291 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ext {
fastjsonLibVersion="1.1.70.android"
//Default value for disableCov is false
disableCov = project.hasProperty("disableCov") && disableCov.equals("true")
useApachePackageName = project.hasProperty('apachePackageName') ? project.property('apachePackageName').toBoolean() : true
useApachePackageName = project.hasProperty('apachePackageName') ? project.property('apachePackageName').toBoolean() : false
implementFromWeex = true
}

Expand Down
1 change: 1 addition & 0 deletions android/sdk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ assets/weex-rax-api.js
/libs/armeabi

/src/legacyRelease/
proguard-rules-legacy.pro
6 changes: 3 additions & 3 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), useApachePackageName ? 'proguard-rules.pro' : 'proguard-rules-legacy.pro'
buildConfigField "boolean", "ENABLE_TRACE", "false"
consumerProguardFiles 'proguard-rules.pro'
consumerProguardFiles useApachePackageName ? 'proguard-rules.pro' : 'proguard-rules-legacy.pro'
}

debug {
Expand Down Expand Up @@ -265,4 +265,4 @@ task weex_core_license(type: com.hierynomus.gradle.license.tasks.LicenseFormat)
'Source/include/JavaScriptCore/**/*.cpp'])
}

preBuild.dependsOn copyAndRenameCppSourceFile, copyAndRenamePackage, copyManifest, copyASanLib, checkNdkVersion, licenseFormat
preBuild.dependsOn copyAndRenameCppSourceFile, copyAndRenamePackage, copyManifest, copyProguard, copyASanLib, checkNdkVersion, licenseFormat
42 changes: 29 additions & 13 deletions android/sdk/buildSrc/packageName.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ task copyAndRenamePackage(type: Copy) {
doFirst {
delete new File('src/legacyRelease/java')
}
from new File('src/main/java/com/taobao/weex')
into new File('src/legacyRelease/java/org/apache/weex')
from new File('src/main/java/org/apache/weex')
into new File('src/legacyRelease/java/com/taobao/weex')
filter { String line ->
line.replaceAll(/^(package com\.taobao)(\.weex.*)$/, { _, packageName, suffix ->
"package org.apache${suffix}"
}).replaceAll(/^(import com\.taobao)(\.weex.*)$/, { _, packageName, suffix ->
"import org.apache${suffix}"
}).replaceAll(/^(import static com\.taobao)(\.weex.*)$/, { _, packageName, suffix ->
"import static org.apache${suffix}"
line.replaceAll(/^(package org\.apache)(\.weex.*)$/, { _, packageName, suffix ->
"package com.taobao${suffix}"
}).replaceAll(/^(import org\.apache)(\.weex.*)$/, { _, packageName, suffix ->
"import com.taobao${suffix}"
}).replaceAll(/^(import static org\.apache)(\.weex.*)$/, { _, packageName, suffix ->
"import static com.taobao${suffix}"
})
}
}
Expand All @@ -25,8 +25,24 @@ task copyManifest(type: Copy){
from new File('src/main/AndroidManifest.xml')
into new File('src/legacyRelease')
filter { String line ->
line.replaceAll(/(com\.taobao)(\.weex.*)/, { _, packageName, suffix ->
"org.apache${suffix}"
line.replaceAll(/(org\.apache)(\.weex.*)/, { _, packageName, suffix ->
"com.taobao${suffix}"
})
}
}
}

task copyProguard(type: Copy){
if(!project.useApachePackageName){
doFirst {
delete new File('proguard-rules-legacy.pro')
}
from new File('proguard-rules.pro')
into new File('.')
rename 'proguard-rules.pro', 'proguard-rules-legacy.pro'
filter { String line ->
line.replaceAll(/(org\.apache)(\.weex.*)/, { _, packageName, suffix ->
"com.taobao${suffix}"
})
}
}
Expand All @@ -49,9 +65,9 @@ task copyAndRenameCppSourceFile(type: Copy, dependsOn: copyOtherCppFile){
into new File('src/legacyRelease/cpp')
include '**/*.cpp', '**/*.cc', '**/*.c', '**/*.h', '**/*.hpp'
filter { String line ->
line.replaceAll('(.*".*)(com/taobao/weex)(.*".*)', { _, prefix, packageName, suffix ->
logger.info("Content substation in .cpp/.h files happpened, \n Input: ${line}, \n Output: ${prefix}org/apache/weex${suffix}")
"${prefix}org/apache/weex${suffix}"
line.replaceAll('(.*".*)(org/apache/weex)(.*".*)', { _, prefix, packageName, suffix ->
logger.info("Content substation in .cpp/.h files happpened, \n Input: ${line}, \n Output: ${prefix}com/taobao/weex${suffix}")
"${prefix}com/taobao/weex${suffix}"
})
}
}
Expand Down
10 changes: 5 additions & 5 deletions android/sdk/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keep class com.taobao.weex.bridge.** { *; }
-keep class com.taobao.weex.layout.** { *; }
-keep class com.taobao.weex.WXSDKEngine { *; }
-keep class com.taobao.weex.base.SystemMessageHandler { *; }
-dontwarn com.taobao.weex.bridge.**
-keep class org.apache.weex.bridge.** { *; }
-keep class org.apache.weex.layout.** { *; }
-keep class org.apache.weex.WXSDKEngine { *; }
-keep class org.apache.weex.base.SystemMessageHandler { *; }
-dontwarn org.apache.weex.bridge.**
2 changes: 1 addition & 1 deletion android/sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ specific language governing permissions and limitations
under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.taobao.weex">
package="org.apache.weex">
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.view.View;

import com.taobao.weex.ui.component.WXComponent;
import org.apache.weex.ui.component.WXComponent;

/**
* Created by sospartan on 14/06/2017.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

/**
* Listener class for activity lifecycle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.view.View;
import org.apache.weex.common.WXRenderStrategy;

public interface IWXRenderListener {

/**
* If {@link com.taobao.weex.common.WXRenderStrategy#APPEND_ASYNC} is applied, this method
* If {@link WXRenderStrategy#APPEND_ASYNC} is applied, this method
* will be invoked when the rendering of first view is finish.
* If {@link com.taobao.weex.common.WXRenderStrategy#APPEND_ONCE} is applied, this method will
* If {@link WXRenderStrategy#APPEND_ONCE} is applied, this method will
* be invoked when the rendering of the view tree is finished.
*/
void onViewCreated(WXSDKInstance instance, View view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

public interface IWXStatisticsListener {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.support.annotation.NonNull;
import com.taobao.weex.adapter.ClassLoaderAdapter;
import com.taobao.weex.adapter.IDrawableLoader;
import com.taobao.weex.adapter.IWXHttpAdapter;
import com.taobao.weex.adapter.IWXImgLoaderAdapter;
import com.taobao.weex.adapter.IWXJSExceptionAdapter;
import com.taobao.weex.adapter.IWXJsFileLoaderAdapter;
import com.taobao.weex.adapter.IWXJscProcessManager;
import com.taobao.weex.adapter.IWXSoLoaderAdapter;
import com.taobao.weex.adapter.IWXUserTrackAdapter;
import com.taobao.weex.adapter.URIAdapter;
import com.taobao.weex.appfram.storage.IWXStorageAdapter;
import com.taobao.weex.appfram.websocket.IWebSocketAdapterFactory;
import com.taobao.weex.performance.IApmGenerator;
import org.apache.weex.adapter.ClassLoaderAdapter;
import org.apache.weex.adapter.IDrawableLoader;
import org.apache.weex.adapter.IWXHttpAdapter;
import org.apache.weex.adapter.IWXImgLoaderAdapter;
import org.apache.weex.adapter.IWXJSExceptionAdapter;
import org.apache.weex.adapter.IWXJsFileLoaderAdapter;
import org.apache.weex.adapter.IWXJscProcessManager;
import org.apache.weex.adapter.IWXSoLoaderAdapter;
import org.apache.weex.adapter.IWXUserTrackAdapter;
import org.apache.weex.adapter.URIAdapter;
import org.apache.weex.appfram.storage.IWXStorageAdapter;
import org.apache.weex.appfram.websocket.IWebSocketAdapterFactory;
import org.apache.weex.performance.IApmGenerator;
import java.util.LinkedList;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.annotation.TargetApi;
import android.content.Context;
Expand All @@ -25,7 +25,7 @@
import android.view.View;


import com.taobao.weex.render.WXAbstractRenderContainer;
import org.apache.weex.render.WXAbstractRenderContainer;

/**
* Created by sospartan on 08/10/2016.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.text.TextUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import static android.content.Context.MODE_PRIVATE;

Expand All @@ -31,15 +31,16 @@
import android.os.Environment;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import com.taobao.weex.common.WXConfig;
import com.taobao.weex.utils.FontDO;
import com.taobao.weex.utils.LogLevel;
import com.taobao.weex.utils.TypefaceUtil;
import com.taobao.weex.utils.WXFileUtils;
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXSoInstallMgrSdk;
import com.taobao.weex.utils.WXUtils;
import com.taobao.weex.utils.WXViewUtils;
import com.taobao.weex.R;
import org.apache.weex.common.WXConfig;
import org.apache.weex.utils.FontDO;
import org.apache.weex.utils.LogLevel;
import org.apache.weex.utils.TypefaceUtil;
import org.apache.weex.utils.WXFileUtils;
import org.apache.weex.utils.WXLogUtils;
import org.apache.weex.utils.WXSoInstallMgrSdk;
import org.apache.weex.utils.WXUtils;
import org.apache.weex.utils.WXViewUtils;
import dalvik.system.PathClassLoader;
import java.io.BufferedReader;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.common.WXModule;
import org.apache.weex.annotation.JSMethod;
import org.apache.weex.common.WXModule;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.taobao.weex.utils.WXLogUtils;
import org.apache.weex.utils.WXLogUtils;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@
* specific language governing permissions and limitations
* under the License.
*/
package com.taobao.weex;
package org.apache.weex;

import android.net.Uri;
import android.text.TextUtils;

import com.taobao.weex.adapter.IWXHttpAdapter;
import com.taobao.weex.adapter.IWXUserTrackAdapter;
import com.taobao.weex.common.WXErrorCode;
import com.taobao.weex.common.WXPerformance;
import com.taobao.weex.common.WXRenderStrategy;
import com.taobao.weex.common.WXResponse;
import com.taobao.weex.performance.WXInstanceApm;
import com.taobao.weex.tracing.WXTracing;
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.tools.LogDetail;
import org.apache.weex.adapter.IWXUserTrackAdapter;
import org.apache.weex.common.WXErrorCode;
import org.apache.weex.common.WXPerformance;
import org.apache.weex.common.WXRenderStrategy;
import org.apache.weex.common.WXResponse;
import org.apache.weex.performance.WXInstanceApm;
import org.apache.weex.tracing.WXTracing;
import org.apache.weex.utils.WXLogUtils;
import org.apache.weex.utils.tools.LogDetail;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.weex.adapter.IWXHttpAdapter.OnHttpListener;

/**
* load bundle js listener
*/
public class WXHttpListener implements IWXHttpAdapter.OnHttpListener {
public class WXHttpListener implements OnHttpListener {

private String pageName;
private Map<String, Object> options;
Expand Down
Loading

0 comments on commit 19fc503

Please sign in to comment.