Skip to content

Commit 050ff66

Browse files
committed
see 12/16 log
1 parent cce9449 commit 050ff66

File tree

97 files changed

+256
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+256
-269
lines changed

bus-gradle-plugin/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## v1.6
4+
修复 inject 时候 zip 操作不对导致混淆出错的问题
5+
36
## v1.5
47
升级 javassist 来修复 Kotlin 匿名类 NotFoundException
58

bus-gradle-plugin/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ apply {
77
plugin "java-gradle-plugin"
88
from "${rootDir.path}/gradle/pluginPublish.gradle"
99
if (bus.isDebug) {
10-
plugin 'maven'
10+
plugin "maven"
1111
from "${rootDir.path}/gradle/localMavenUpload.gradle"
1212
} else {
13-
plugin 'com.github.dcendents.android-maven'
14-
plugin 'com.jfrog.bintray'
13+
plugin "com.github.dcendents.android-maven"
14+
plugin "com.jfrog.bintray"
1515
from "${rootDir.path}/gradle/bintrayUploadJava.gradle"
1616
}
1717
}
@@ -26,6 +26,7 @@ gradlePlugin {
2626
}
2727

2828
dependencies {
29+
implementation dep.plugin[0]
2930
implementation dep.javassist
3031
implementation dep.commons_io
3132
implementation gradleApi()

bus-gradle-plugin/src/main/java/com/blankj/bus/BusInject.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class BusInject {
2525
callMethod.insertAfter(getInsertContent(bus, true));
2626
}
2727
busUtils.writeFile(decompressedJarPath)
28-
busUtils.defrost();
28+
busUtils.defrost()
2929
FileUtils.forceDelete(busJar)
30-
ZipUtils.zipFile(decompressedJar, busJar)
30+
ZipUtils.zipFiles(Arrays.asList(decompressedJar.listFiles()), busJar)
3131
FileUtils.forceDelete(decompressedJar)
3232
}
3333

bus-gradle-plugin/src/main/java/com/blankj/bus/BusTransform.groovy

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ class BusTransform extends Transform {
6868
)
6969
FileUtils.copyDirectory(dir, dest)
7070

71-
LogUtils.l("scan dir: " + dirInput.name)
71+
LogUtils.l("scan dir: $dir [$dest]")
7272

7373
busScan.scanDir(dir)
7474
}
75-
7675
input.jarInputs.each { JarInput jarInput ->// 遍历 jar 文件
7776
File jar = jarInput.file
7877
JavassistUtils.getPool().appendClassPath(jarInput.file.absolutePath)
@@ -86,21 +85,22 @@ class BusTransform extends Transform {
8685
)
8786
FileUtils.copyFile(jar, dest)
8887

89-
if (jumpScan(jarName)) {
90-
LogUtils.l("jump jar: " + jarName)
91-
return
92-
}
93-
9488
if (jarName.startsWith("com.blankj:utilcode:")
9589
|| jarName.contains("utilcode-lib")) {
9690
busScan.busJar = dest
97-
LogUtils.l("bus jar: " + jarName)
91+
LogUtils.l("bus jar: $jarName [$dest]")
9892
return
9993
}
10094

101-
LogUtils.l("scan jar: " + jarName)
95+
if (jumpScan(jarName)) {
96+
LogUtils.l("jump jar: $jarName [$dest]")
97+
return
98+
}
99+
100+
LogUtils.l("scan jar: $jarName [$dest]")
102101
busScan.scanJar(jar)
103102
}
103+
104104
}
105105

106106
if (busScan.busJar != null) {

bus-gradle-plugin/src/main/java/com/blankj/bus/Config.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ class Config {
88
'com.android.support:',
99
'com.android.support.constraint:',
1010
'android.arch.',
11-
'com.blankj:'
11+
'com.blankj:',
12+
'org.jetbrains.kotlin:',
13+
'org.jetbrains:',
14+
'com.squareup.'
1215
]
1316

1417
public static final String FILE_SEP = System.getProperty("file.separator")

config.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ ext {
55
compileSdkVersion = 27
66
minSdkVersion = 14
77
targetSdkVersion = 27
8-
versionCode = 1_022_001
9-
versionName = '1.22.1'// E.g. 1.9.72 => 1,009,072
8+
versionCode = 1_022_002
9+
versionName = '1.22.2'// E.g. 1.9.72 => 1,009,072
1010

1111
bus = [
1212
isDebug: false,
13-
version: '1.5',
13+
version: '1.6',
1414
group : 'com.blankj'
1515
]
1616

@@ -41,7 +41,7 @@ ext {
4141
android : "com.squareup.leakcanary:leakcanary-android:$leakcanary_version",
4242
android_no_op: "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version",
4343
],
44-
free_proguard: "com.blankj:free-proguard:0.0.9",
44+
free_proguard: "com.blankj:free-proguard:0.0.7",
4545
adapt_screen : "com.blankj:adapt-screen:0.0.3",
4646

4747
gson : "com.google.code.gson:gson:2.8.2",

config_app.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ android {
2121
}
2222

2323
buildTypes {
24-
// debug {
25-
// minifyEnabled true
26-
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27-
// for (int i = 0; i < consumerProguardFiles.size(); i++) {
28-
// println consumerProguardFiles[i].getAbsolutePath() + "<111"
29-
// }
30-
//// consumerProguardFiles[0] + ",111 " + consumerProguardFiles[1].getAbsolutePath()
31-
// }
24+
debug {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27+
}
3228
release {
3329
minifyEnabled true
3430
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
@@ -52,7 +48,7 @@ private String getSuffix() {
5248
String[] splits = project.name.split("-")
5349
String suffix = ""
5450
if (splits.length == 2) {
55-
suffix = "." + splits[0]
51+
suffix = "_" + splits[0]
5652
}
5753
return suffix
5854
}
@@ -82,9 +78,11 @@ def configSigning(Project pro) {
8278
def configApkName(Project pro) {
8379
pro.android.applicationVariants.all { variant ->
8480
if (variant.buildType.name != "debug") {
85-
variant.getPackageApplication().outputDirectory = new File(project.rootDir.absolutePath + "/apk")
81+
variant.getPackageApplication().outputDirectory = new File("${rootDir.path}/apk")
8682
variant.getPackageApplication().outputScope.apkDatas.forEach { apkData ->
87-
apkData.outputFileName = "util_" + variant.versionName.replace(".", "_") + ".apk"
83+
apkData.outputFileName = "util" + suffix +
84+
"_" + variant.versionName.replace(".", "_") +
85+
".apk"
8886
}
8987
}
9088
}

config_lib.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ android {
1010
minSdkVersion rootProject.minSdkVersion
1111
versionCode rootProject.versionCode
1212
versionName rootProject.versionName
13+
consumerProguardFiles 'proguard-rules.pro'
1314
}
1415

1516
buildTypes {
1617
release {
1718
minifyEnabled false
18-
consumerProguardFiles 'proguard-rules.pro'
1919
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020
}
2121
}

launcher/app/__bus__.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"SubUtilActivity#start": "void com.blankj.subutil.pkg.feature.SubUtilActivity.start(android.content.Context)",
3-
"CoreUtilActivity#start": "void com.blankj.utilcode.pkg.feature.CoreUtilActivity.start(android.content.Context)",
4-
"showDialog": "void com.blankj.launcher.app.UtilsApp.showDialog()"
2+
"CoreUtilActivity#start": "void com.blankj.utilcode.pkg.feature.CoreUtilActivity.start(android.content.Context)"
53
}

launcher/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.blankj.launcher">
3+
package="com.blankj.launcher.app">
44

55
<application
6-
android:name=".app.UtilsApp"
6+
android:name=".UtilsApp"
77
android:allowBackup="false"
88
android:icon="@mipmap/ic_launcher"
99
android:label="@string/app_name"
1010
android:theme="@style/AppTheme">
1111

1212
<activity
13-
android:name=".pkg.MainActivity"
13+
android:name="com.blankj.launcher.pkg.MainActivity"
1414
android:screenOrientation="user"
1515
android:windowSoftInputMode="stateHidden|adjustPan">
1616
<intent-filter>

0 commit comments

Comments
 (0)