mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 01:35:17 +08:00
Modify merge yukihookapi, yukihookapi-stub java-library project to android-library project
This commit is contained in:
@@ -1,24 +1,42 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
android {
|
||||
namespace 'com.highcapable.yukihookapi.stub'
|
||||
compileSdk rootProject.ext.android.compileSdk
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
||||
defaultConfig {
|
||||
minSdk rootProject.ext.android.minSdk
|
||||
targetSdk rootProject.ext.android.targetSdk
|
||||
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = 11
|
||||
jvmTarget = '11'
|
||||
freeCompilerArgs = [
|
||||
'-Xno-param-assertions',
|
||||
'-Xno-call-assertions',
|
||||
'-Xno-receiver-assertions'
|
||||
]
|
||||
}
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly fileTree(include: ['*.jar'], dir: '../yukihookapi/libs')
|
||||
implementation 'androidx.annotation:annotation:1.6.0'
|
||||
}
|
0
yukihookapi-stub/consumer-rules.pro
Normal file
0
yukihookapi-stub/consumer-rules.pro
Normal file
21
yukihookapi-stub/proguard-rules.pro
vendored
Normal file
21
yukihookapi-stub/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
2
yukihookapi-stub/src/main/AndroidManifest.xml
Normal file
2
yukihookapi-stub/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest />
|
@@ -1,25 +1,56 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceSets.main { java.srcDir("src/api/kotlin") }
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
}
|
||||
android {
|
||||
namespace 'com.highcapable.yukihookapi'
|
||||
compileSdk rootProject.ext.android.compileSdk
|
||||
|
||||
javadoc {
|
||||
options.addStringOption("charset", "UTF-8")
|
||||
if (JavaVersion.current().isJava9Compatible()) options.addBooleanOption('html5', true)
|
||||
defaultConfig {
|
||||
minSdk rootProject.ext.android.minSdk
|
||||
targetSdk rootProject.ext.android.targetSdk
|
||||
|
||||
buildConfigField('String', 'API_VERSION_NAME', "\"${rootProject.ext.maven.repository.apiVersion.name}\"")
|
||||
buildConfigField('int', 'API_VERSION_CODE', "${rootProject.ext.maven.repository.apiVersion.code}")
|
||||
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
freeCompilerArgs = [
|
||||
'-opt-in=com.highcapable.yukihookapi.annotation.YukiPrivateApi',
|
||||
'-opt-in=com.highcapable.yukihookapi.annotation.YukiGenerateApi',
|
||||
'-Xno-param-assertions',
|
||||
'-Xno-call-assertions',
|
||||
'-Xno-receiver-assertions'
|
||||
]
|
||||
}
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
sourceSets.main { kotlin.srcDir("src/api/kotlin") }
|
||||
sourceSets {
|
||||
all {
|
||||
languageSettings {
|
||||
@@ -30,25 +61,18 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = 11
|
||||
freeCompilerArgs = [
|
||||
'-opt-in=com.highcapable.yukihookapi.annotation.YukiPrivateApi',
|
||||
'-opt-in=com.highcapable.yukihookapi.annotation.YukiGenerateApi',
|
||||
'-Xno-param-assertions',
|
||||
'-Xno-call-assertions',
|
||||
'-Xno-receiver-assertions'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Used 82 API Version
|
||||
compileOnly 'de.robv.android.xposed:api:82'
|
||||
compileOnly project(':yukihookapi-stub')
|
||||
compileOnly fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'androidx.annotation:annotation:1.6.0'
|
||||
implementation 'androidx.core:core-ktx:1.10.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
}
|
||||
|
||||
tasks.register('androidSourcesJar', Jar) {
|
||||
archiveClassifier.set('sources')
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
}
|
||||
|
||||
group = rootProject.ext.maven.repository.groupId
|
||||
@@ -56,9 +80,10 @@ version = rootProject.ext.maven.repository.apiVersion.name
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
release(MavenPublication) {
|
||||
artifactId = 'api'
|
||||
from components.java
|
||||
artifact "$buildDir/outputs/aar/${project.name}-release.aar"
|
||||
artifact androidSourcesJar
|
||||
pom {
|
||||
name = rootProject.ext.maven.repository.name
|
||||
description = rootProject.ext.maven.repository.description
|
||||
@@ -97,4 +122,4 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
signing { sign(publishing.publications.mavenJava) }
|
||||
signing { sign publishing.publications }
|
0
yukihookapi/consumer-rules.pro
Normal file
0
yukihookapi/consumer-rules.pro
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21
yukihookapi/proguard-rules.pro
vendored
Normal file
21
yukihookapi/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
2
yukihookapi/src/main/AndroidManifest.xml
Normal file
2
yukihookapi/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest />
|
@@ -80,10 +80,10 @@ object YukiHookAPI {
|
||||
internal var isLoadedFromBaseContext = false
|
||||
|
||||
/** 获取当前 [YukiHookAPI] 的版本 */
|
||||
const val API_VERSION_NAME = "1.1.8"
|
||||
const val API_VERSION_NAME = BuildConfig.API_VERSION_NAME
|
||||
|
||||
/** 获取当前 [YukiHookAPI] 的版本号 */
|
||||
const val API_VERSION_CODE = 41
|
||||
const val API_VERSION_CODE = BuildConfig.API_VERSION_CODE
|
||||
|
||||
/**
|
||||
* 当前 [YukiHookAPI] 的状态
|
@@ -32,6 +32,7 @@ package com.highcapable.yukihookapi.hook.type.java
|
||||
import android.os.Build
|
||||
import com.highcapable.yukihookapi.hook.factory.classOf
|
||||
import com.highcapable.yukihookapi.hook.factory.toClass
|
||||
import com.highcapable.yukihookapi.hook.factory.toClassOrNull
|
||||
import dalvik.system.BaseDexClassLoader
|
||||
import dalvik.system.DexClassLoader
|
||||
import dalvik.system.InMemoryDexClassLoader
|
||||
@@ -47,7 +48,6 @@ import java.lang.reflect.Member
|
||||
import java.lang.reflect.Method
|
||||
import java.net.HttpCookie
|
||||
import java.net.HttpURLConnection
|
||||
import java.net.http.HttpClient
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
@@ -665,9 +665,9 @@ val HttpCookieClass get() = classOf<HttpCookie>()
|
||||
|
||||
/**
|
||||
* 获得 [HttpClient] 类型
|
||||
* @return [Class]<[HttpClient]>
|
||||
* @return [Class] or null
|
||||
*/
|
||||
val HttpClientClass get() = classOf<HttpClient>()
|
||||
val HttpClientClass get() = "java.net.http.HttpClient".toClassOrNull()
|
||||
|
||||
/**
|
||||
* 获得 [AtomicBoolean] 类型
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user