Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.github.ooftf:autoregister:x.x.x'
}
}
Expand Down
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
compileSdkVersion 32
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.billy.android.autoregsiter.demo"
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 32
versionCode 1
versionName "1.0"
}
Expand All @@ -17,17 +17,17 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'

compile project(':app_lib')
implementation project(':app_lib')
}


Expand Down Expand Up @@ -74,4 +74,4 @@ project.ext.registerInfoList = [
autoregister {
registerInfo = registerInfoList
cacheEnabled = true
}
}
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -18,4 +19,4 @@
</activity>
</application>

</manifest>
</manifest>
10 changes: 4 additions & 6 deletions app_lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
compileSdkVersion 32
buildToolsVersion '30.0.3'


defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
targetSdkVersion 32


}
Expand All @@ -24,5 +22,5 @@ android {
}

dependencies {
compile project(':app_lib_interface')
api project(':app_lib_interface')
}
8 changes: 3 additions & 5 deletions app_lib_interface/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
compileSdkVersion 32
buildToolsVersion '30.0.3'


defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
targetSdkVersion 32


}
Expand Down
7 changes: 5 additions & 2 deletions autoregister/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ repositories {
mavenCentral()
}
publish {
version = '1.4.4'//-snapshot
version = '1.4.5'//-snapshot
}
dependencies {
implementation 'com.android.tools.build:gradle:4.0.1'
implementation 'com.android.tools.build:gradle:7.2.1'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'commons-codec:commons-codec:1.15'
implementation 'commons-io:commons-io:2.11.0'
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.api.Project

import java.lang.reflect.Type

import static com.android.builder.model.AndroidProject.FD_INTERMEDIATES
/**
* 文件操作辅助类
* @author zhangkb
Expand Down Expand Up @@ -56,7 +55,7 @@ class AutoRegisterHelper {
}

private static String getCacheFileDir(Project project) {
return project.getBuildDir().absolutePath + File.separator + FD_INTERMEDIATES + File.separator + CACHE_INFO_DIR + File.separator
return project.getBuildDir().absolutePath + File.separator + "intermediates" + File.separator + CACHE_INFO_DIR + File.separator
}

/**
Expand Down Expand Up @@ -99,4 +98,4 @@ class AutoRegisterHelper {
return isSuccess
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class CodeInsertProcessor {
private byte[] doGenerateCode(InputStream inputStream) {
ClassReader cr = new ClassReader(inputStream)
ClassWriter cw = new ClassWriter(cr, 0)
ClassVisitor cv = new MyClassVisitor(Opcodes.ASM6, cw)
ClassVisitor cv = new MyClassVisitor(Opcodes.ASM9, cw)
cr.accept(cv, ClassReader.EXPAND_FRAMES)
return cw.toByteArray()
}
Expand All @@ -122,7 +122,7 @@ class CodeInsertProcessor {
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions)
if (name == extension.initMethodName) { //注入代码到指定的方法之中
boolean _static = (access & Opcodes.ACC_STATIC) > 0
mv = new MyMethodVisitor(Opcodes.ASM6, mv, _static)
mv = new MyMethodVisitor(Opcodes.ASM9, mv, _static)
}
return mv
}
Expand Down Expand Up @@ -171,4 +171,4 @@ class CodeInsertProcessor {
super.visitMaxs(maxStack + 4, maxLocals)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class CodeScanProcessor {
boolean scanClass(InputStream inputStream, String filePath) {
ClassReader cr = new ClassReader(inputStream)
ClassWriter cw = new ClassWriter(cr, 0)
ScanClassVisitor cv = new ScanClassVisitor(Opcodes.ASM6, cw, filePath)
ScanClassVisitor cv = new ScanClassVisitor(Opcodes.ASM9, cw, filePath)
cr.accept(cv, ClassReader.EXPAND_FRAMES)
inputStream.close()

Expand Down Expand Up @@ -270,4 +270,4 @@ class CodeScanProcessor {
}
return false
}
}
}
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ buildscript {

repositories {
maven{ url rootProject.file("repo-local") }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
allowInsecureProtocol = true
}
google()
jcenter()
mavenCentral()
maven { url "$rootProject.projectDir/mavenLocal" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.billy.android:autoregister:1.4.2'
classpath 'com.github.ooftf:autoregister:1.4.5'
classpath 'com.github.ooftf:ooftf-maven:1.0.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -22,7 +26,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
Version: BCPG v1.68

iQEcBAABCgAGBQJioH3+AAoJEE+lKmWU+S2rWAAIAJGP9e+Wm3mu8q6thnIFM2W5
ynvmK5++ws2kDQaC7/isZFVuo5w6L5kQUNxwTojILsvYW3y4vX3CQ8dbqwg7JDap
tq7n4yKHDce4YNNetpNGksiiJA/p2l4W9HzxXpRcVSe8eoDEfDg0SIigQJI2hokZ
0lxvg9taRMC2ZB5q4gvLvc2RJp6s8NbHQZ+L8r91grtVCYrqZAcP4aC2xxxklEWh
3AAG5W46ABrz9wtxA2mURNNX1OUw9O4y0SfECSklza63qO1HpPDTTiCCtHB2Y/9X
nDylZF3FNUIk7yrnhdvKl4i1qdH2g8IPjDEeY1wxbZMjciWOKAjJFP1atwNL2ko=
=ZV01
-----END PGP SIGNATURE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
Version: BCPG v1.68

iQEcBAABCgAGBQJioH3+AAoJEE+lKmWU+S2rKrgIAKszSnJYp8gIhwl0lJ+ljiq7
piwTp6sCHgoR0mX5QudHO4RegZLw5WjnaMBVtr8xq3G8p5ghba5ya8Iq9qmka7ur
fP3qWuhHinghomKftQbCIB3b8FV20hGNE6E7ZxNx00gKMeiCvzYOU4Md6rMuGOtb
1Vyv0Ip2vlPQkn58bMxFsJvfvfeVk4tjwdHbUhVSGiS2W2Ujx5r28DjFania+CB2
0ubuvEqchybNNCqUWlP6daTOFX1U8VlhMJJlqJ9QIxYCO0oDE7zOK3Zgbndi1T/W
9RjgrVd03xwxeQWy/vsFd9gY7RhToCnzgOyY40ZImKg0gKh+8ug8+OJGEg7NY6M=
=/u3f
-----END PGP SIGNATURE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
Version: BCPG v1.68

iQEcBAABCgAGBQJioH39AAoJEE+lKmWU+S2rwdoIANV1nMLiTwKZawMbXC21HMCC
5t4KrpZwmQP3lBlIESH+KDIEXuDQsxrboFnLJEST18A1319aj4yBX0xIYWqIHQIc
BaSP9MG3pznrHXhKE5JkPiQGhjbMqaHma15iZgMO0RN+E4q8+LqDRCn8QYxF3g80
+9xsTEimNO3AX84osCPl7YLoBBFVBKIChhV4rgDPWy8j2GrZWXu6HpTCX26Zgvn3
1JeLMau0IL0N0mP/eIuxM+FPlptJiVRzcCUPXyWkvIyG9EwYrqVZMhVHwIcd7A9H
tbXvG227rAIfJ8/F3eWhyqAaxT3sZYoJi/ipM8oXYI59xE/zs0lXJHaYNLgPBPk=
=59uT
-----END PGP SIGNATURE-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"formatVersion": "1.1",
"component": {
"group": "com.github.ooftf",
"module": "autoregister",
"version": "1.4.5",
"attributes": {
"org.gradle.status": "release"
}
},
"createdBy": {
"gradle": {
"version": "7.4.2"
}
},
"variants": [
{
"name": "apiElements",
"attributes": {
"org.gradle.category": "library",
"org.gradle.dependency.bundling": "external",
"org.gradle.jvm.version": 11,
"org.gradle.libraryelements": "jar",
"org.gradle.usage": "java-api"
},
"files": [
{
"name": "autoregister-1.4.5.jar",
"url": "autoregister-1.4.5.jar",
"size": 85746,
"sha512": "26a35e29cf37be339380b4e44ea509972f4e1dc9b1539bbb698548487091daba7015c96a67b8dcab872d041c6d03ff0be5bb91689c772bdf9aeedd3abbde23f5",
"sha256": "d700bd3cc14ddab3cb55a573edde499439953a1fc327f0606521d70b268f929e",
"sha1": "cb959bca03f29fea3b1c31c5c66a2988be08dad0",
"md5": "ab5a473835b176804264bd26b6c3afd2"
}
]
},
{
"name": "runtimeElements",
"attributes": {
"org.gradle.category": "library",
"org.gradle.dependency.bundling": "external",
"org.gradle.jvm.version": 11,
"org.gradle.libraryelements": "jar",
"org.gradle.usage": "java-runtime"
},
"dependencies": [
{
"group": "com.android.tools.build",
"module": "gradle",
"version": {
"requires": "7.2.1"
}
},
{
"group": "com.google.code.gson",
"module": "gson",
"version": {
"requires": "2.9.0"
}
},
{
"group": "commons-codec",
"module": "commons-codec",
"version": {
"requires": "1.15"
}
},
{
"group": "commons-io",
"module": "commons-io",
"version": {
"requires": "2.11.0"
}
}
],
"files": [
{
"name": "autoregister-1.4.5.jar",
"url": "autoregister-1.4.5.jar",
"size": 85746,
"sha512": "26a35e29cf37be339380b4e44ea509972f4e1dc9b1539bbb698548487091daba7015c96a67b8dcab872d041c6d03ff0be5bb91689c772bdf9aeedd3abbde23f5",
"sha256": "d700bd3cc14ddab3cb55a573edde499439953a1fc327f0606521d70b268f929e",
"sha1": "cb959bca03f29fea3b1c31c5c66a2988be08dad0",
"md5": "ab5a473835b176804264bd26b6c3afd2"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
Version: BCPG v1.68

iQEcBAABCgAGBQJioH3+AAoJEE+lKmWU+S2rroIH/Ryl1uhFxAmd3jEtky5vcCM0
yTrpF6RZSirODCrYEy9i5DmL2gwVvEoEFePhbbxAO7OWs4JcvG5nBcYTGC3tPHH7
2kHrcyfpqGfyyiL1jOZbX+4FKMg6nfUQVjz6EG4XuOjAscoSawcOx+4FRLfI9rep
8rnKHHD75wybegmG+9HF4ySiotS1+NboZdzBou0TcP/uRNjQPGBZQCIN3i/xWAs9
pabHfOvSqp07TKyVXRccIRm/nYV7YVdfG3d2ebs4OuBK2k/cnTP97hgOHJ7pkSGU
LbeECq2iyRe0daAqFxjcLhmhd3SIboEm52DmCGW0qOVVb32G6v+ziDQoGni4rOg=
=PuUk
-----END PGP SIGNATURE-----
Loading