Skip to content

Commit

Permalink
Merge pull request #715 from Qihoo360/dev
Browse files Browse the repository at this point in the history
v2.3.1 dev to master
  • Loading branch information
bnotebook authored Nov 16, 2018
2 parents def6ac6 + ddc314d commit 00ffa38
Show file tree
Hide file tree
Showing 36 changed files with 1,202 additions and 1,055 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
</p>

[![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/Qihoo360/RePlugin/blob/master/LICENSE)
[![Release Version](https://img.shields.io/badge/release-2.2.4-brightgreen.svg)](https://github.com/Qihoo360/RePlugin/releases)

[![Release Version](https://img.shields.io/badge/release-2.3.1-brightgreen.svg)](https://github.com/Qihoo360/RePlugin/releases)

## 活动通知
移动技术最新活动通知:9月1号360移动技术开放日 http://t.cn/RDiNru9

## RePlugin —— A flexible, stable, easy-to-use Android Plug-in Framework

Expand Down Expand Up @@ -55,6 +56,9 @@ At present, almost **all Apps with hundreds of millions users from 360, and many
## Our Vision
Make RePlugin be used in all kinds of ordinary Apps; and provide stable, flexible, liberal plug-ins which adopt for both large and small projects.

## Latest features
Solved the Android P (Android 9.0) related adaptation issues, fully support the official version of Android P (Android 9.0).

## RePlugin Architecture

<p align="center">
Expand Down
6 changes: 5 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/Qihoo360/RePlugin/blob/master/LICENSE)

[![Release Version](https://img.shields.io/badge/release-2.2.4-brightgreen.svg)](https://github.com/Qihoo360/RePlugin/releases)
[![Release Version](https://img.shields.io/badge/release-2.3.1-brightgreen.svg)](https://github.com/Qihoo360/RePlugin/releases)



Expand Down Expand Up @@ -57,6 +57,10 @@ RePlugin是一套完整的、稳定的、适合全面使用的,占坑类插件

让插件化能**飞入寻常应用家**,做到稳定、灵活、自由,大小项目兼用。

## 最新特性

解决了Android P(Android 9.0)相关适配问题,全面支持Android P(Android 9.0)正式版。

## RePlugin 架构图

<p align="center">
Expand Down
58 changes: 58 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

export RP_BASE_DIR=$(cd "$(dirname "$0")"; pwd)

export TARGET_PROJECTS=(
replugin-host-gradle
replugin-host-library
replugin-plugin-gradle
replugin-plugin-library
)

__gradle_exec(){ if [[ -x gradlew ]];then ./gradlew ${@}; else gradle ${@}; fi; }

__rp_deploy_project(){
[[ ! -d ${1} ]] && echo ">>> INVALID ${1}!!! <<<" && return
# execute deploying
echo ">>> ${1} <<<" && __gradle_exec -p ${1} clean bintrayUpload
# revert changed files
git checkout ${1}
}

rp_deploy(){
local current=`pwd` && cd ${RP_BASE_DIR}
# saving all changes: git stash save "saving stash for deploying!!!"
# deploy
for p in ${TARGET_PROJECTS}; do __rp_deploy_project ${RP_BASE_DIR}/${p}; done
# revert local changes: git revert --hard HEAD; git stash pop
local current=`pwd`
}

rp_test(){
local projects=(
# replugin-sample/host/app
replugin-sample/host
# replugin-sample/plugin/plugin-demo1/app
replugin-sample/plugin/plugin-demo1
# replugin-sample/plugin/plugin-demo2/app
replugin-sample/plugin/plugin-demo2
# replugin-sample/plugin/plugin-demo3-kotlin/app
replugin-sample/plugin/plugin-demo3-kotlin
# replugin-sample/plugin/plugin-webview/app
replugin-sample/plugin/plugin-webview
# replugin-sample-extra/fresco/FrescoHost/app
replugin-sample-extra/fresco/FrescoHost
# replugin-sample-extra/fresco/FrescoPlugin/app
replugin-sample-extra/fresco/FrescoPlugin
)
local log=${RP_BASE_DIR}/build/rp_test.log && [[ -f $log ]] && rm -f $log
local current=`pwd`
for p in ${projects}; do
echo -e ">>> BUILDING ${p}"
p=${RP_BASE_DIR}/${p} && __gradle_exec -p ${p} clean asDebug 2>/dev/null >> ${log} && echo "SUCCEED";
ls -l ${p}/app/build/outputs/apk
done
cd ${current}
}

# grep --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,build,.gradle} -inr '2\.3\.0' .
66 changes: 3 additions & 63 deletions replugin-host-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ buildscript {
jcenter()
mavenCentral()
}

dependencies {
// classpath 'com.android.tools.build:gradle:2.1.0'
// 将项目发布到JCenter 所需要的jar 添加依赖
Expand All @@ -38,14 +39,6 @@ buildscript {
}
}

group = 'com.qihoo360.replugin' // 组名
String classPath = ".src.main.groovy.com.qihoo360.replugin.gradle.host.AppConstant".replace(".", java.io.File.separator)
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}"

dependencies {
compile 'com.android.tools.build:gradle:2.1.3'
compile 'org.json:json:20160212'
Expand All @@ -57,60 +50,7 @@ dependencies {

compile 'com.google.gradle:osdetector-gradle-plugin:1.2.1'
compile 'net.dongliu:apk-parser:2.2.0'

}



if (project.hasProperty("android")) { // Android libraries
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
} else { // Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
}

// 强制 Java/JavaDoc 等的编码为 UTF-8
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}



// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}

publishing {
publications {
mavenJava(MavenPublication) {
if (plugins.hasPlugin('war')) {
from components.web
} else {
from components.java
}

artifact sourcesJar
artifact javadocJar
}
}
}

apply from: 'bintray.gradle'


project.ext.RP_ARTIFACT_ID = 'replugin-host-gradle'
apply from: '../rp-publish.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package com.qihoo360.replugin.gradle.host
class AppConstant {

/** 版本号 */
def static final VER = "2.3.0"
def static final VER = "${RP_VERSION}"

/** 打印信息时候的前缀 */
def static final TAG = "< replugin-host-v${VER} >"
Expand Down
8 changes: 2 additions & 6 deletions replugin-host-library/replugin-host-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
*/
apply plugin: 'com.android.library'


version = "2.3.0"

group = 'com.qihoo360.replugin' // 组名

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
Expand Down Expand Up @@ -54,4 +49,5 @@ dependencies {
provided 'com.android.support:support-v4:25.2.0'
}

apply from: 'bintray.gradle'
project.ext.RP_ARTIFACT_ID = 'replugin-host-lib'
apply from: '../../rp-publish.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.qihoo360.loader2;

import android.content.Context;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.ComponentInfo;
Expand Down Expand Up @@ -382,12 +383,18 @@ final boolean loadDex(ClassLoader parent, int load) {
private void regReceivers() throws android.os.RemoteException {
String plugin = mPluginObj.mInfo.getName();

Map<String, List<IntentFilter>> map = ManifestParser.INS.getReceiverFilterMap(plugin);

if (map == null || map.size() == 0) {
return;
}

if (mPluginHost == null) {
mPluginHost = getPluginHost();
}

if (mPluginHost != null) {
mPluginHost.regReceiver(plugin, ManifestParser.INS.getReceiverFilterMap(plugin));
mPluginHost.regReceiver(plugin, map);
}
}

Expand Down
Loading

0 comments on commit 00ffa38

Please sign in to comment.