From f2a35350dd9d5870e6cba4b84d293d67a9535b0e Mon Sep 17 00:00:00 2001
From: Lennon <1136160757@qq.com>
Date: Thu, 5 Dec 2019 09:54:15 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9support=E4=BE=9D=E8=B5=96?=
=?UTF-8?q?=E4=B8=BAAndroidX=E4=BE=9D=E8=B5=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../replugin/gradle/host/AppConstant.groovy | 18 ++---
replugin-host-library/build.gradle | 8 +-
.../gradle/wrapper/gradle-wrapper.properties | 20 +----
.../replugin-host-lib/build.gradle | 16 ++--
.../replugin-host-lib/replugin-rules.pro | 2 +-
.../com/qihoo360/loader2/IPluginClient.aidl | 18 +----
.../com/qihoo360/loader2/IPluginHost.aidl | 35 ---------
.../com/qihoo360/replugin/IBinderGetter.aidl | 9 ---
.../packages/IPluginManagerServer.aidl | 68 +++-------------
.../java/com/qihoo360/loader2/PluginDesc.java | 2 +-
.../loader2/PluginLibraryInternalProxy.java | 2 +-
.../qihoo360/loader2/PluginProcessMain.java | 2 +-
.../qihoo360/loader2/PluginProcessPer.java | 2 +-
.../java/com/qihoo360/loader2/PmBase.java | 2 +-
.../java/com/qihoo360/loader2/PmHostSvc.java | 3 +-
.../java/com/qihoo360/replugin/RePlugin.java | 2 +-
.../replugin/base/LocalBroadcastHelper.java | 4 +-
.../activity/DynamicClassProxyActivity.java | 2 +-
.../service/server/PluginPitService.java | 2 +-
.../qihoo360/replugin/model/PluginInfo.java | 2 +-
.../replugin/model/PluginInfoList.java | 2 +-
.../packages/PluginFastInstallProvider.java | 4 +-
.../replugin/packages/PluginInfoUpdater.java | 2 +-
.../packages/PluginManagerServer.java | 2 +-
replugin-plugin-gradle/build.gradle | 18 ++---
.../gradle/compat/VariantCompat.groovy | 38 +++++++++
.../replugin/gradle/plugin/AppConstant.groovy | 30 +++----
.../LoaderActivityInjector.groovy | 6 +-
replugin-plugin-library/build.gradle | 11 ++-
.../gradle/wrapper/gradle-wrapper.properties | 20 +----
.../replugin-plugin-lib/bintray.gradle | 78 -------------------
.../replugin-plugin-lib/build.gradle | 43 ++++++++--
.../com/qihoo360/replugin/IBinderGetter.aidl | 8 +-
.../java/com/qihoo360/replugin/RePlugin.java | 10 ++-
.../loader/a/PluginAppCompatActivity.java | 4 +-
.../loader/a/PluginFragmentActivity.java | 4 +-
.../qihoo360/replugin/model/PluginInfo.java | 2 +-
.../replugin/packages/PluginRunningList.java | 16 +++-
replugin-plugin-library/rp-publish.gradle | 8 ++
39 files changed, 198 insertions(+), 327 deletions(-)
create mode 100644 replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat/VariantCompat.groovy
delete mode 100644 replugin-plugin-library/replugin-plugin-lib/bintray.gradle
create mode 100644 replugin-plugin-library/rp-publish.gradle
diff --git a/replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/AppConstant.groovy b/replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/AppConstant.groovy
index a671b1af..c03ec584 100644
--- a/replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/AppConstant.groovy
+++ b/replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/AppConstant.groovy
@@ -17,30 +17,30 @@
package com.qihoo360.replugin.gradle.host
/**
- * 程序常量定义区
+ *
* @author RePlugin Team
*/
class AppConstant {
- /** 版本号 */
- def static final VER = "${RP_VERSION}"
+ /** 汾 */
+ def static final VER = "2.3.3"
- /** 打印信息时候的前缀 */
+ /** ӡϢʱǰ */
def static final TAG = "< replugin-host-v${VER} >"
- /** 外部用户配置信息 */
+ /** ⲿûϢ */
def static final USER_CONFIG = "repluginHostConfig"
- /** 用户Task组 */
+ /** ûTask */
def static final TASKS_GROUP = "replugin-plugin"
- /** Task前缀 */
+ /** Taskǰ */
def static final TASKS_PREFIX = "rp"
- /** 用户Task:安装插件 */
+ /** ûTask:װ */
def static final TASK_SHOW_PLUGIN = TASKS_PREFIX + "ShowPlugins"
- /** 用户Task:Generate任务 */
+ /** ûTask:Generate */
def static final TASK_GENERATE = TASKS_PREFIX + "Generate"
diff --git a/replugin-host-library/build.gradle b/replugin-host-library/build.gradle
index 1777f2bc..8d07695f 100644
--- a/replugin-host-library/build.gradle
+++ b/replugin-host-library/build.gradle
@@ -20,11 +20,12 @@ buildscript {
repositories {
jcenter()
mavenCentral()
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.1'
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
+ classpath 'com.android.tools.build:gradle:3.5.2'
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
@@ -32,6 +33,7 @@ allprojects {
repositories {
jcenter()
mavenCentral()
+ google()
}
}
diff --git a/replugin-host-library/gradle/wrapper/gradle-wrapper.properties b/replugin-host-library/gradle/wrapper/gradle-wrapper.properties
index ada24495..96aff9f8 100644
--- a/replugin-host-library/gradle/wrapper/gradle-wrapper.properties
+++ b/replugin-host-library/gradle/wrapper/gradle-wrapper.properties
@@ -1,22 +1,6 @@
-#
-# Copyright (C) 2005-2017 Qihoo 360 Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed To in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-#
-
-#Fri Mar 03 10:15:50 CST 2017
+#Fri Nov 29 15:48:44 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
diff --git a/replugin-host-library/replugin-host-lib/build.gradle b/replugin-host-library/replugin-host-lib/build.gradle
index 1280694a..5c96cea0 100644
--- a/replugin-host-library/replugin-host-lib/build.gradle
+++ b/replugin-host-library/replugin-host-lib/build.gradle
@@ -20,12 +20,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 25
- buildToolsVersion '25.0.2'
+ compileSdkVersion 29
+ buildToolsVersion '29.0.2'
defaultConfig {
- minSdkVersion 9
- targetSdkVersion 25
+ minSdkVersion 15
+ targetSdkVersion 29
versionCode 2
versionName version
@@ -42,12 +42,12 @@ android {
}
dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
+ api fileTree(include: ['*.jar'], dir: 'libs')
// 以“占位符”(Provided)的方式来引用support-v4,不会编入AAR
// 但宿主需要支持Support-v4(至少应支持LocalBroadcastManager)
- provided 'com.android.support:support-v4:25.2.0'
+ api 'androidx.legacy:legacy-support-v4:1.0.0'
}
-project.ext.RP_ARTIFACT_ID = 'replugin-host-lib'
-apply from: '../../rp-publish.gradle'
+//project.ext.RP_ARTIFACT_ID = 'replugin-host-lib'
+//apply from: '../../rp-publish.gradle'
diff --git a/replugin-host-library/replugin-host-lib/replugin-rules.pro b/replugin-host-library/replugin-host-lib/replugin-rules.pro
index da65faf9..84076aba 100644
--- a/replugin-host-library/replugin-host-lib/replugin-rules.pro
+++ b/replugin-host-library/replugin-host-lib/replugin-rules.pro
@@ -45,7 +45,7 @@
public protected *;
}
# LocalBroadcastManager,插件会用
--keep public class android.support.v4.content.LocalBroadcastManager {
+-keep public class androidx.localbroadcastmanager.content.LocalBroadcastManager {
public *;
}
diff --git a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginClient.aidl b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginClient.aidl
index b18d480f..90caa04e 100644
--- a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginClient.aidl
+++ b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginClient.aidl
@@ -7,10 +7,10 @@ import com.qihoo360.replugin.component.service.server.IPluginServiceServer;
*/
interface IPluginClient {
- // 参数 plugin, process 可能有冗余,目前临时使用,后续可能优化
+
String allocActivityContainer(String plugin, int process, String target, in Intent intent);
- // 参数 plugin 用来处理多插件单进程情况
+
IBinder queryBinder(String plugin, String binder);
void releaseBinder();
@@ -23,22 +23,10 @@ interface IPluginClient {
IPluginServiceServer fetchServiceServer();
- /**
- * 插件收到广播
- *
- * @param plugin 插件名称
- * @param receiver Receiver 名称
- * @param Intent 广播的 Intent 数据
- */
+
void onReceive(String plugin, String receiver, in Intent intent);
- /**
- * dump通过插件化框架启动起来的Service信息
- */
String dumpServices();
- /**
- * dump插件化框架中存储的详细Activity坑位映射表
- */
String dumpActivities();
}
\ No newline at end of file
diff --git a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginHost.aidl b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginHost.aidl
index a975fbe3..3c1fd23d 100644
--- a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginHost.aidl
+++ b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginHost.aidl
@@ -40,20 +40,10 @@ interface IPluginHost {
void unregPluginBinder(in PluginBinderInfo info, IBinder binder);
- /**
- * 注册某插件下所有静态声明的的 receiver 到常驻进程
- */
void regReceiver(String plugin, in Map receiverFilterMap);
void unregReceiver();
- /**
- * 插件收到广播
- *
- * @param plugin 插件名称
- * @param receiver Receiver 名称
- * @param Intent 广播的 Intent 数据
- */
void onReceive(String plugin, String receiver, in Intent intent);
int sumBinders(int index);
@@ -78,42 +68,17 @@ interface IPluginHost {
IBinder queryPluginBinder(String plugin, String binder);
- /**
- * 根据 Inent 查询所有插件中的与之匹配的 Receivers
- */
List queryPluginsReceiverList(in Intent intent);
- /**
- * 获取“全新Service管理方案”在Server端的服务
- * Added by Jiongxuan Zhang
- */
IPluginServiceServer fetchServiceServer();
- /**
- * 获取 IPluginManagerServer(纯APK方案使用)的插件服务
- * Added by Jiongxuan Zhang
- */
IPluginManagerServer fetchManagerServer();
- /**
- * 根据 taskAffinity,判断应该取第几组 TaskAffinity
- * 由于 taskAffinity 是跨进程的属性,所以这里要将 taskAffinityGroup 的数据保存在常驻进程中
- * Added by hujunjie
- */
int getTaskAffinityGroupIndex(String taskAffinity);
- /**
- * 通过进程名来获取PID
- */
int getPidByProcessName(String processName);
- /**
- * 通过PID来获取进程名
- */
String getProcessNameByPid(int pid);
- /**
- * dump详细的运行时信息
- */
String dump();
}
\ No newline at end of file
diff --git a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl
index fb13f369..abc861fd 100644
--- a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl
+++ b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl
@@ -1,18 +1,9 @@
package com.qihoo360.replugin;
/**
- * Binder的获取器,可用于延迟加载IBinder的情况。
- *
- * 目前用于:
- *
- * * RePlugin.registerGlobalBinderDelayed
- *
* @author RePlugin Team
*/
interface IBinderGetter {
- /**
- * 获取IBinder对象
- */
IBinder get();
}
diff --git a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/packages/IPluginManagerServer.aidl b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/packages/IPluginManagerServer.aidl
index d1538ff6..2ec6087d 100644
--- a/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/packages/IPluginManagerServer.aidl
+++ b/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/packages/IPluginManagerServer.aidl
@@ -4,93 +4,43 @@ import com.qihoo360.replugin.model.PluginInfo;
import com.qihoo360.replugin.packages.PluginRunningList;
/**
- * 插件管理器。用来控制插件的安装、卸载、获取等。运行在常驻进程中
- *
- * 补充:涉及到插件交互、运行机制有关的管理器,在IPluginHost中
*
* @author RePlugin Team
*/
interface IPluginManagerServer {
/**
- * 安装一个插件
- *
- * 注意:若为旧插件(p-n开头),则应使用IPluginHost的pluginDownloaded方法
- *
- * @return 安装的插件的PluginInfo对象
+
*/
PluginInfo install(String path);
/**
- * 卸载一个插件
- *
- * 注意:只针对“纯APK”插件方案
- *
- * @param info 插件信息
- * @return 是否成功卸载插件?
+
*/
boolean uninstall(in PluginInfo info);
/**
- * 加载插件列表,方便之后使用
- *
- * TODO 这里只返回"新版插件",供PmBase使用。将来会合并
- *
- * @return PluginInfo的列表
+
*/
List load();
- /**
- * 更新所有插件列表
- *
- * @return PluginInfo的列表
- */
+
List updateAll();
- /**
- * 设置isUsed状态,并通知所有进程更新
- *
- * @param pluginName 插件名
- * @param used 是否已经使用
- */
+
void updateUsed(String pluginName, boolean used);
- /**
- * 获取正在运行的插件列表
- *
- * @return 正在运行的插件名列表
- */
+
PluginRunningList getRunningPlugins();
- /**
- * 插件是否正在运行?
- *
- * @param pluginName 插件名
- * @param process 指定进程名,如为Null则表示查所有
- * @return 是否在运行?
- */
+
boolean isPluginRunning(String pluginName, String process);
- /**
- * 当进程启动时,同步正在运行的插件状态到Server端
- *
- * @param list 正在运行的插件名列表
- */
+
void syncRunningPlugins(in PluginRunningList list);
- /**
- * 当进程启动时,同步正在运行的插件状态到Server端
- *
- * @param processName 进程名
- * @param pluginName 正在运行的插件名
- */
+
void addToRunningPlugins(String processName, int pid, String pluginName);
- /**
- * 获取正在运行此插件的进程名列表
- *
- * @param pluginName 要查询的插件名
- * @return 正在运行此插件的进程名列表。一定不会为Null
- */
String[] getRunningProcessesByPlugin(String pluginName);
}
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginDesc.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginDesc.java
index 76bed95b..69aee67a 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginDesc.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginDesc.java
@@ -20,10 +20,10 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
import android.util.Log;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.qihoo360.replugin.utils.Charsets;
import com.qihoo360.replugin.utils.CloseableUtils;
import com.qihoo360.mobilesafe.core.BuildConfig;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginLibraryInternalProxy.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginLibraryInternalProxy.java
index 98e6d1c8..ace69d13 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginLibraryInternalProxy.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginLibraryInternalProxy.java
@@ -780,7 +780,7 @@ private int getThemeId(Activity activity, Intent intent) {
private static int getDefaultThemeId() {
if (HostConfigHelper.ACTIVITY_PIT_USE_APPCOMPAT) {
try {
- Class clazz = ReflectUtils.getClass("android.support.v7.appcompat.R$style");
+ Class clazz = ReflectUtils.getClass("androidx.appcompat.R$style");
return (int) ReflectUtils.readStaticField(clazz, "Theme_AppCompat");
} catch (ClassNotFoundException e) {
e.printStackTrace();
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessMain.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessMain.java
index c1ade55c..b7c6a9da 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessMain.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessMain.java
@@ -20,10 +20,10 @@
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
-import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
+import androidx.annotation.NonNull;
import com.qihoo360.i.IPluginManager;
import com.qihoo360.replugin.base.IPC;
import com.qihoo360.replugin.component.process.PluginProcessHost;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessPer.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessPer.java
index c77af54f..ef20872b 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessPer.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PluginProcessPer.java
@@ -22,9 +22,9 @@
import android.content.pm.ActivityInfo;
import android.os.IBinder;
import android.os.RemoteException;
-import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.qihoo360.i.IPluginManager;
import com.qihoo360.loader2.alc.ActivityController;
import com.qihoo360.replugin.RePlugin;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmBase.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmBase.java
index bcb0b0ce..930c621d 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmBase.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmBase.java
@@ -27,9 +27,9 @@
import android.os.IBinder;
import android.os.Parcelable;
import android.os.RemoteException;
-import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.qihoo360.i.Factory;
import com.qihoo360.i.IModule;
import com.qihoo360.i.IPluginManager;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmHostSvc.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmHostSvc.java
index f3fae174..0b4a7d40 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmHostSvc.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/PmHostSvc.java
@@ -23,11 +23,12 @@
import android.content.pm.ActivityInfo;
import android.os.Binder;
import android.os.IBinder;
+import android.os.IBinder.DeathRecipient;
import android.os.Parcelable;
import android.os.RemoteException;
-import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.qihoo360.mobilesafe.api.Tasks;
import com.qihoo360.replugin.RePlugin;
import com.qihoo360.replugin.RePluginConstants;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/RePlugin.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/RePlugin.java
index 721449e7..719b861e 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/RePlugin.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/RePlugin.java
@@ -30,12 +30,12 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
-import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.qihoo360.i.Factory;
import com.qihoo360.i.Factory2;
import com.qihoo360.i.IPluginManager;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/base/LocalBroadcastHelper.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/base/LocalBroadcastHelper.java
index f1c4b721..e54d0f80 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/base/LocalBroadcastHelper.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/base/LocalBroadcastHelper.java
@@ -18,7 +18,7 @@
import android.content.Context;
import android.content.Intent;
-import android.support.v4.content.LocalBroadcastManager;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import java.util.concurrent.Callable;
@@ -26,7 +26,7 @@
* 和LocalBroadcastManager有关的帮助类
*
* @author RePlugin Team
- * @see android.support.v4.content.LocalBroadcastManager
+ * @see androidx.localbroadcastmanager.content.LocalBroadcastManager
*/
public class LocalBroadcastHelper {
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/activity/DynamicClassProxyActivity.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/activity/DynamicClassProxyActivity.java
index dde864e2..18e38f2f 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/activity/DynamicClassProxyActivity.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/activity/DynamicClassProxyActivity.java
@@ -20,9 +20,9 @@
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
-import android.support.annotation.Nullable;
import android.text.TextUtils;
+import androidx.annotation.Nullable;
import com.qihoo360.i.Factory2;
import com.qihoo360.i.IPluginManager;
import com.qihoo360.replugin.RePlugin;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/service/server/PluginPitService.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/service/server/PluginPitService.java
index 1c7002c7..3f0e9fbc 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/service/server/PluginPitService.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/service/server/PluginPitService.java
@@ -21,8 +21,8 @@
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
-import android.support.annotation.Nullable;
+import androidx.annotation.Nullable;
import com.qihoo360.i.IPluginManager;
import java.lang.ref.WeakReference;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java
index 51cb7dd8..e9e2fb9b 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java
@@ -26,9 +26,9 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
-import android.support.annotation.NonNull;
import android.text.TextUtils;
+import androidx.annotation.NonNull;
import com.qihoo360.loader2.Constant;
import com.qihoo360.loader2.PluginNativeLibsHelper;
import com.qihoo360.loader2.V5FileInfo;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfoList.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfoList.java
index a42a1c89..db8581c8 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfoList.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/model/PluginInfoList.java
@@ -17,9 +17,9 @@
package com.qihoo360.replugin.model;
import android.content.Context;
-import android.support.annotation.NonNull;
import android.text.TextUtils;
+import androidx.annotation.NonNull;
import com.qihoo360.loader2.Constant;
import com.qihoo360.replugin.helper.LogDebug;
import com.qihoo360.replugin.utils.Charsets;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginFastInstallProvider.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginFastInstallProvider.java
index 6788071f..2dc34f4f 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginFastInstallProvider.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginFastInstallProvider.java
@@ -20,10 +20,10 @@
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
import android.text.TextUtils;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import com.qihoo360.loader2.PMF;
import com.qihoo360.replugin.base.IPC;
import com.qihoo360.replugin.helper.LogDebug;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginInfoUpdater.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginInfoUpdater.java
index f68fd182..91d3ae8b 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginInfoUpdater.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginInfoUpdater.java
@@ -20,9 +20,9 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.qihoo360.loader2.MP;
import com.qihoo360.replugin.base.IPC;
import com.qihoo360.replugin.helper.LogDebug;
diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginManagerServer.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginManagerServer.java
index bef0da22..abc34be8 100644
--- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginManagerServer.java
+++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginManagerServer.java
@@ -21,9 +21,9 @@
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.RemoteException;
-import android.support.annotation.NonNull;
import android.text.TextUtils;
+import androidx.annotation.NonNull;
import com.qihoo360.loader2.CertUtils;
import com.qihoo360.loader2.MP;
import com.qihoo360.loader2.PluginNativeLibsHelper;
diff --git a/replugin-plugin-gradle/build.gradle b/replugin-plugin-gradle/build.gradle
index 114a5679..8a750fd1 100644
--- a/replugin-plugin-gradle/build.gradle
+++ b/replugin-plugin-gradle/build.gradle
@@ -46,15 +46,15 @@ String verPath = "${project.projectDir}" + classPath + ".groovy"
String verLine = new File(verPath).filterLine { it =~ /def static final VER =/ }
version = "${verLine.split("\"")[1]}" // 版本
//红色醒目打印显示版本号
-java.lang.System.err.println "version=${version}"
-
-sourceSets {
- main {
- groovy {
- srcDirs '../replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat'
- }
- }
-}
+System.err.println "version=${version}"
+
+//sourceSets {
+// main {
+// groovy {
+// srcDirs '../replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat'
+// }
+// }
+//}
dependencies {
compile 'com.android.tools.build:gradle:2.1.3'
diff --git a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat/VariantCompat.groovy b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat/VariantCompat.groovy
new file mode 100644
index 00000000..82f08560
--- /dev/null
+++ b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat/VariantCompat.groovy
@@ -0,0 +1,38 @@
+package com.qihoo360.replugin.gradle.compat
+
+import org.gradle.api.Task
+
+/**
+ * @author hyongbai
+ */
+class VariantCompat {
+ static def getAssembleTask(def variant) {
+ return compatGetTask(variant, "getAssembleProvider", "getAssemble")
+ }
+
+ static def getMergeAssetsTask(def variant) {
+ return compatGetTask(variant, "getMergeAssetsProvider", "getMergeAssets")
+ }
+
+ static def getGenerateBuildConfigTask(def variant) {
+ return compatGetTask(variant, "getGenerateBuildConfigProvider", "getGenerateBuildConfig")
+ }
+
+ static def getProcessManifestTask(def variant) {
+ return compatGetTask(variant, "getProcessManifestProvider", "getProcessManifest")
+ }
+
+ static def compatGetTask(def variant, String... candidates) {
+ candidates?.findResult {
+ variant.metaClass.respondsTo(variant, it).with {
+ if (!it.isEmpty()) return it
+ }
+ }?.find {
+ it.getParameterTypes().length == 0
+ }?.invoke(variant)?.with {
+ //TODO: check if is provider!!!
+ Task.class.isInstance(it) ? it : it?.get()
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/AppConstant.groovy b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/AppConstant.groovy
index 7e87db05..86a16078 100644
--- a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/AppConstant.groovy
+++ b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/AppConstant.groovy
@@ -22,48 +22,48 @@ package com.qihoo360.replugin.gradle.plugin
*/
class AppConstant {
- /** 版本号 */
- def static final VER = "${RP_VERSION}"
+ /** 汾 */
+ def static final VER = "2.3.3"
- /** 打印信息时候的前缀 */
+ /** ӡϢʱǰ */
def static final TAG = "< replugin-plugin-v${VER} >"
- /** 外部用户配置信息 */
+ /** ⲿûϢ */
def static final USER_CONFIG = "repluginPluginConfig"
- /** 用户Task组 */
+ /** ûTask */
def static final TASKS_GROUP = "replugin-plugin"
- /** Task前缀 */
+ /** Taskǰ */
def static final TASKS_PREFIX = "rp"
- /** 用户Task:强制停止宿主app */
+ /** ûTask:ǿֹͣapp */
def static final TASK_FORCE_STOP_HOST_APP = TASKS_PREFIX + "ForceStopHostApp"
- /** 用户Task:启动宿主app */
+ /** ûTask:app */
def static final TASK_START_HOST_APP = TASKS_PREFIX + "StartHostApp"
- /** 用户Task:重启宿主app */
+ /** ûTask:app */
def static final TASK_RESTART_HOST_APP = TASKS_PREFIX + "RestartHostApp"
- /** 用户Task:安装插件 */
+ /** ûTask:װ */
def static final TASK_INSTALL_PLUGIN = TASKS_PREFIX + "InstallPlugin"
- /** 用户Task:安装插件 */
+ /** ûTask:װ */
def static final TASK_UNINSTALL_PLUGIN = TASKS_PREFIX + "UninstallPlugin"
- /** 用户Task:运行插件 */
+ /** ûTask:в */
def static final TASK_RUN_PLUGIN = TASKS_PREFIX + "RunPlugin"
- /** 用户Task:安装并运行插件 */
+ /** ûTask:װв */
def static final TASK_INSTALL_AND_RUN_PLUGIN = TASKS_PREFIX + "InstallAndRunPlugin"
- /** 配置例子 */
+ /** */
static final String CONFIG_EXAMPLE = '''
-// 这个plugin需要放在android配置之后,因为需要读取android中的配置项
+// pluginҪandroid֮ΪҪȡandroidе
apply plugin: 'replugin-plugin-gradle\'
repluginPluginConfig {
pluginName = "demo3"
diff --git a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/loaderactivity/LoaderActivityInjector.groovy b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/loaderactivity/LoaderActivityInjector.groovy
index 059fd158..7d40f619 100644
--- a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/loaderactivity/LoaderActivityInjector.groovy
+++ b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/loaderactivity/LoaderActivityInjector.groovy
@@ -46,7 +46,9 @@ public class LoaderActivityInjector extends BaseInjector {
'android.support.v4.app.FragmentActivity' : 'com.qihoo360.replugin.loader.a.PluginFragmentActivity',
'android.support.v7.app.AppCompatActivity': 'com.qihoo360.replugin.loader.a.PluginAppCompatActivity',
'android.preference.PreferenceActivity' : 'com.qihoo360.replugin.loader.a.PluginPreferenceActivity',
- 'android.app.ExpandableListActivity' : 'com.qihoo360.replugin.loader.a.PluginExpandableListActivity'
+ 'android.app.ExpandableListActivity' : 'com.qihoo360.replugin.loader.a.PluginExpandableListActivity',
+ 'androidx.appcompat.app.AppCompatActivity': 'com.qihoo360.replugin.loader.a.PluginAppCompatActivity',
+ 'androidx.fragment.app.FragmentActivity' : 'com.qihoo360.replugin.loader.a.PluginFragmentActivity'
]
@Override
@@ -134,7 +136,7 @@ public class LoaderActivityInjector extends BaseInjector {
})
}
- ctCls.writeFile(CommonData.getClassPath(ctCls.name))
+ ctCls.writeFile(CommonData.getClassPath(ctCls.name) as String)
println " Replace ${ctCls.name}'s SuperClass ${superCls.name} to ${targetSuperCls.name}"
}
diff --git a/replugin-plugin-library/build.gradle b/replugin-plugin-library/build.gradle
index 1777f2bc..52f3a922 100644
--- a/replugin-plugin-library/build.gradle
+++ b/replugin-plugin-library/build.gradle
@@ -15,16 +15,18 @@
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
+apply from: 'rp-publish.gradle'
buildscript {
repositories {
jcenter()
mavenCentral()
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.1'
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
+ classpath 'com.android.tools.build:gradle:3.5.2'
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ classpath 'com.novoda:bintray-release:0.9.1'
}
}
@@ -32,6 +34,7 @@ allprojects {
repositories {
jcenter()
mavenCentral()
+ google()
}
}
diff --git a/replugin-plugin-library/gradle/wrapper/gradle-wrapper.properties b/replugin-plugin-library/gradle/wrapper/gradle-wrapper.properties
index 5b88596a..fd1a3d4e 100644
--- a/replugin-plugin-library/gradle/wrapper/gradle-wrapper.properties
+++ b/replugin-plugin-library/gradle/wrapper/gradle-wrapper.properties
@@ -1,22 +1,6 @@
-#
-# Copyright (C) 2005-2017 Qihoo 360 Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed To in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-#
-
-#Wed Aug 31 14:09:54 CST 2016
+#Fri Nov 29 15:39:45 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
diff --git a/replugin-plugin-library/replugin-plugin-lib/bintray.gradle b/replugin-plugin-library/replugin-plugin-lib/bintray.gradle
deleted file mode 100644
index 45719230..00000000
--- a/replugin-plugin-library/replugin-plugin-lib/bintray.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.github.dcendents.android-maven'
-apply plugin: 'com.jfrog.bintray'
-
-def siteUrl = '' // 项目的主页
-def gitUrl = '' // Git仓库的url
-
-
-install {
- repositories.mavenInstaller {
- // This generates POM.xml with proper parameters
- pom {
- artifactId = ""
-
- project {
-
- packaging 'aar'
- // Add your description here
- name 'RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework' //项目描述
- url siteUrl
- // Set your license
- licenses {
- license {
- name 'Apache License 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0'
- }
- }
- developers {
- developer {
- id 'qihoo360' //填写的一些基本信息
- name 'qihoo360'
- email 'replugin@gmail.com'
- }
- }
- scm {
- connection gitUrl
- developerConnection gitUrl
- url siteUrl
- }
- }
- }
- }
-}
-
-task sourcesJar(type: Jar) {
- from android.sourceSets.main.java.srcDirs
- classifier = 'sources'
-}
-task javadoc(type: Javadoc) {
- source = android.sourceSets.main.java.srcDirs
- classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
-}
-task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
-}
-artifacts {
- //archives javadocJar
- archives sourcesJar
-}
-
-Properties properties = new Properties()
-properties.load(project.rootProject.file('local.properties').newDataInputStream())
-bintray {
- user = ""
- key = ""
- configurations = ['archives']
- pkg {
- repo = '' // 上传到中央仓库的名称
- name = '' // 上传到jcenter 的项目名称
- userOrg = ''
- desc = 'RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework' // 项目描述
- websiteUrl = siteUrl
- vcsUrl = gitUrl
- licenses = ["Apache-2.0"]
- publish = true
- }
-
-}
\ No newline at end of file
diff --git a/replugin-plugin-library/replugin-plugin-lib/build.gradle b/replugin-plugin-library/replugin-plugin-lib/build.gradle
index 8adbbf94..856fa2f8 100644
--- a/replugin-plugin-library/replugin-plugin-lib/build.gradle
+++ b/replugin-plugin-library/replugin-plugin-lib/build.gradle
@@ -17,11 +17,11 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 25
- buildToolsVersion '25.0.2'
+ compileSdkVersion 29
+ buildToolsVersion "29.0.2"
defaultConfig {
- minSdkVersion 1
+ minSdkVersion 15
versionCode 1
versionName "1.0"
consumerProguardFiles 'replugin-library-rules.pro'
@@ -33,16 +33,43 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
-
+ sourceSets{
+ main {
+ java.srcDirs = ['src/main/java', 'src/main/aidl']
+ }
+ }
lintOptions {
abortOnError false
}
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- provided 'com.android.support:appcompat-v7:23.4.0'
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+}
+
+tasks.withType(JavaCompile) {
+ options.encoding = "UTF-8"
+}
+
+task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+}
+
+artifacts {
+ archives sourcesJar
}
+apply plugin: 'com.novoda.bintray-release'
-project.ext.RP_ARTIFACT_ID = 'replugin-plugin-lib'
-apply from: '../../rp-publish.gradle'
\ No newline at end of file
+publish {
+ artifactId = 'replugin-plugin-lib' // artifactId
+ uploadName = 'replugin-plugin-lib' // 展示名字
+ publishVersion = '1.0.0' // 版本
+ userOrg = rootProject.userOrg
+ groupId = rootProject.groupId
+ repoName = rootProject.repoName
+ desc = ''
+ website = rootProject.website
+ licences = rootProject.licences
+}
\ No newline at end of file
diff --git a/replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl b/replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl
index fb13f369..ced0c4d3 100644
--- a/replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl
+++ b/replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl
@@ -1,18 +1,12 @@
package com.qihoo360.replugin;
/**
- * Binder的获取器,可用于延迟加载IBinder的情况。
- *
- * 目前用于:
- *
* * RePlugin.registerGlobalBinderDelayed
*
* @author RePlugin Team
*/
interface IBinderGetter {
- /**
- * 获取IBinder对象
- */
+
IBinder get();
}
diff --git a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/RePlugin.java b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/RePlugin.java
index 5521f49d..45f7e6a9 100644
--- a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/RePlugin.java
+++ b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/RePlugin.java
@@ -615,7 +615,7 @@ public static int fetchResourceIdByName(String pluginName, String resTypeAndName
*
* @param pluginName 插件名
* @param layoutName Layout名字
- * @param root Optional view to be the parent of the generated hierarchy.
+ * @param root Optional view to be the parent of the generated hierarchy.
* @return 插件的View。若为Null则表示获取失败
* @throws ClassCastException 若不是想要的那个View类型,或者ClassLoader不同,则可能会出现此异常。应确保View类型正确
* @since 2.2.0 (老的host-lib版本也能使用)
@@ -1117,7 +1117,7 @@ public static boolean isHookingClass(ComponentName component) {
* 取消对某个“跳转”类的注册,恢复原状。
* 请参见 registerHookingClass 的详细说明
*
- * @param source 要替换的类的全名
+ * @param source 要替换的类的全名
* @see #registerHookingClass(String, ComponentName, Class)
* @since 2.1.6
*/
@@ -1132,7 +1132,7 @@ public static void unregisterHookingClass(String source) {
/**
* 注册一个可供其他模块调用的IBinder,供IPlugin.query使用
*
- * @param name 注册的IBinder名
+ * @param name 注册的IBinder名
* @param binder 注册的IBinder对象
*/
public static void registerPluginBinder(String name, IBinder binder) {
@@ -1141,6 +1141,7 @@ public static void registerPluginBinder(String name, IBinder binder) {
/**
* 获取宿主的Context
+ *
* @return 宿主的Context
*/
public static Context getHostContext() {
@@ -1149,6 +1150,7 @@ public static Context getHostContext() {
/**
* 获取宿主的ClassLoader
+ *
* @return 宿主的ClassLoader
*/
public static ClassLoader getHostClassLoader() {
@@ -1157,6 +1159,7 @@ public static ClassLoader getHostClassLoader() {
/**
* 获取该插件的PluginContext
+ *
* @return
*/
public static Context getPluginContext() {
@@ -1165,6 +1168,7 @@ public static Context getPluginContext() {
/**
* 判断是否运行在宿主环境中
+ *
* @return 是否运行在宿主环境
*/
public static boolean isHostInitialized() {
diff --git a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginAppCompatActivity.java b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginAppCompatActivity.java
index 604d76c5..8e1b27e4 100644
--- a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginAppCompatActivity.java
+++ b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginAppCompatActivity.java
@@ -20,9 +20,9 @@
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v7.app.AppCompatActivity;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
import com.qihoo360.replugin.RePluginInternal;
import com.qihoo360.replugin.helper.LogRelease;
diff --git a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginFragmentActivity.java b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginFragmentActivity.java
index 70400666..a08ca5be 100644
--- a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginFragmentActivity.java
+++ b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginFragmentActivity.java
@@ -20,9 +20,9 @@
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
import com.qihoo360.replugin.RePluginInternal;
import com.qihoo360.replugin.helper.LogRelease;
diff --git a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java
index 1a56b28d..669f93c7 100644
--- a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java
+++ b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/model/PluginInfo.java
@@ -20,9 +20,9 @@
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
-import android.support.annotation.NonNull;
import android.text.TextUtils;
+import androidx.annotation.NonNull;
import com.qihoo360.replugin.RePlugin;
import com.qihoo360.replugin.RePluginEnv;
import com.qihoo360.replugin.helper.JSONHelper;
diff --git a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/packages/PluginRunningList.java b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/packages/PluginRunningList.java
index f5914bb8..8fc8bd0d 100644
--- a/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/packages/PluginRunningList.java
+++ b/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/packages/PluginRunningList.java
@@ -101,13 +101,21 @@ public String toString() {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
PluginRunningList strings = (PluginRunningList) o;
- if (mPid != strings.mPid) return false;
- if (!mList.equals(strings.mList)) return false;
+ if (mPid != strings.mPid) {
+ return false;
+ }
+ if (!mList.equals(strings.mList)) {
+ return false;
+ }
return mProcessName != null ? mProcessName.equals(strings.mProcessName) : strings.mProcessName == null;
}
diff --git a/replugin-plugin-library/rp-publish.gradle b/replugin-plugin-library/rp-publish.gradle
new file mode 100644
index 00000000..76aeb4a2
--- /dev/null
+++ b/replugin-plugin-library/rp-publish.gradle
@@ -0,0 +1,8 @@
+ext{
+ userOrg = 'lennon-xia' // 用户名
+ repoName = "lennon" // 仓库名
+ groupId = 'com.lennon.utill' // groupId
+ desc = 'useful tool for android' // 描述
+ website = 'https://github.com/lennon19940306/RePlugin' // 地址 , 填写真实可访问地址
+ licences = ['Apache-2.0']// 描述 , 填写licences
+}
\ No newline at end of file