feat: lots of changes
- move demo-app to samples and rename demo-android - rename yukireflection to yukireflection-core - add demo-jvm in samples - convert yukireflection-core from android to java-library - optimize code - other small changes
3
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
*.iml
|
||||
.gradle
|
||||
.maven
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
@@ -13,4 +12,4 @@
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
local.properties
|
@@ -1,21 +0,0 @@
|
||||
package com.highcapable.yukireflection.demo_app.test;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
public class Main {
|
||||
|
||||
private static String staticContent = "I am static!";
|
||||
|
||||
private final String content;
|
||||
|
||||
public Main(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public static String getStaticContent() {
|
||||
return staticContent;
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 13 KiB |
@@ -18,4 +18,23 @@
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-ignorewarnings
|
||||
|
||||
-optimizationpasses 10
|
||||
-dontusemixedcaseclassnames
|
||||
|
||||
-dontoptimize
|
||||
-verbose
|
||||
-overloadaggressively
|
||||
-allowaccessmodification
|
||||
|
||||
-adaptclassstrings
|
||||
-adaptresourcefilenames
|
||||
-adaptresourcefilecontents
|
||||
|
||||
-renamesourcefileattribute P
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
-keep class com.highcapable.yukireflection.demo_app.test.Main {*;}
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* This file is created by fankes on 2022/8/7.
|
||||
*/
|
||||
package com.highcapable.yukireflection.demo_app.test;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
public class Main {
|
||||
|
||||
private static String staticContent = "I am static!";
|
||||
|
||||
private final String content;
|
||||
|
||||
public Main(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public static String getStaticContent() {
|
||||
return staticContent;
|
||||
}
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
@@ -34,7 +34,11 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import com.highcapable.yukireflection.YukiReflection
|
||||
import com.highcapable.yukireflection.demo_app.databinding.ActivityMainBinding
|
||||
import com.highcapable.yukireflection.demo_app.test.Main
|
||||
import com.highcapable.yukireflection.factory.*
|
||||
import com.highcapable.yukireflection.factory.buildOf
|
||||
import com.highcapable.yukireflection.factory.classOf
|
||||
import com.highcapable.yukireflection.factory.current
|
||||
import com.highcapable.yukireflection.factory.field
|
||||
import com.highcapable.yukireflection.factory.method
|
||||
import com.highcapable.yukireflection.type.java.StringClass
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
@@ -43,7 +47,7 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||
setContentView(root)
|
||||
yukiReflectionVersionText.text = "YukiReflection Version:${YukiReflection.API_VERSION_NAME}(${YukiReflection.API_VERSION_CODE})"
|
||||
yukiReflectionVersionText.text = "YukiReflection Version: ${YukiReflection.API_VERSION_NAME}(${YukiReflection.API_VERSION_CODE})"
|
||||
testObjectDirectlyButton.setOnClickListener {
|
||||
tipText.text = Main("I am directly call of new object").getContent()
|
||||
}
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
1
samples/demo-jvm/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
23
samples/demo-jvm/build.gradle.kts
Normal file
@@ -0,0 +1,23 @@
|
||||
plugins {
|
||||
autowire(libs.plugins.kotlin.jvm)
|
||||
autowire(libs.plugins.kotlin.compose)
|
||||
}
|
||||
|
||||
group = property.project.samples.demo.jvm.groupName
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
compose.desktop {
|
||||
application {
|
||||
mainClass = "$group.MainKt"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.yukireflectionCore)
|
||||
implementation(compose.desktop.currentOs)
|
||||
implementation(org.jetbrains.compose.material3.material3.desktop)
|
||||
}
|
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* This file is created by fankes on 2023/9/22.
|
||||
*/
|
||||
@file:Suppress("UsePropertyAccessSyntax")
|
||||
|
||||
package com.highcapable.yukireflection.demo_jvm
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.application
|
||||
import androidx.compose.ui.window.rememberWindowState
|
||||
import com.highcapable.yukireflection.YukiReflection
|
||||
import com.highcapable.yukireflection.demo_jvm.test.Main
|
||||
import com.highcapable.yukireflection.factory.buildOf
|
||||
import com.highcapable.yukireflection.factory.classOf
|
||||
import com.highcapable.yukireflection.factory.current
|
||||
import com.highcapable.yukireflection.factory.field
|
||||
import com.highcapable.yukireflection.factory.method
|
||||
import com.highcapable.yukireflection.type.java.StringClass
|
||||
|
||||
@Composable
|
||||
fun MainLayout() {
|
||||
val currentVersion = "YukiReflection Version: ${YukiReflection.API_VERSION_NAME}(${YukiReflection.API_VERSION_CODE})"
|
||||
val operationState = remember { mutableStateOf("Waiting for your operation") }
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = "Using functions below to test",
|
||||
fontSize = 18.sp,
|
||||
modifier = Modifier.padding(bottom = 15.dp)
|
||||
)
|
||||
Text(
|
||||
text = operationState.value,
|
||||
fontSize = 18.sp,
|
||||
modifier = Modifier.padding(bottom = 35.dp)
|
||||
)
|
||||
Button(
|
||||
onClick = { operationState.value = Main("I am directly call of new object").getContent() },
|
||||
modifier = Modifier.padding(bottom = 15.dp)
|
||||
) {
|
||||
Text(text = "Create an Object and Call Directly")
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
operationState.value =
|
||||
classOf<Main>().buildOf("I am reflection call of new object") { param(StringClass) }
|
||||
?.current()
|
||||
?.method {
|
||||
name = "getContent"
|
||||
emptyParam()
|
||||
}?.string() ?: ""
|
||||
},
|
||||
modifier = Modifier.padding(bottom = 15.dp)
|
||||
) {
|
||||
Text(text = "Create an Object and Call Reflection")
|
||||
}
|
||||
Button(
|
||||
onClick = { operationState.value = Main.getStaticContent() },
|
||||
modifier = Modifier.padding(bottom = 15.dp)
|
||||
) {
|
||||
Text(text = "Get Static and Call Directly")
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
operationState.value = classOf<Main>().method {
|
||||
name = "getStaticContent"
|
||||
modifiers { isStatic }
|
||||
}.get().string()
|
||||
},
|
||||
modifier = Modifier.padding(bottom = 15.dp)
|
||||
) {
|
||||
Text(text = "Get Static and Call Reflection")
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
classOf<Main>().field {
|
||||
name = "staticContent"
|
||||
modifiers { isStatic }
|
||||
}.get().set("I am static! Modified by reflection")
|
||||
operationState.value = "Field is modified success"
|
||||
}
|
||||
) {
|
||||
Text(text = "Modified Static Field Using Reflection")
|
||||
}
|
||||
Text(
|
||||
text = currentVersion,
|
||||
fontSize = 15.sp,
|
||||
modifier = Modifier.padding(top = 35.dp).alpha(0.55f)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() = application {
|
||||
Window(
|
||||
onCloseRequest = ::exitApplication,
|
||||
title = "YukiReflection",
|
||||
resizable = false,
|
||||
state = rememberWindowState(width = 450.dp, height = 600.dp)
|
||||
) { MaterialTheme(colorScheme = MaterialTheme.colorScheme.copy(primary = Color(0xFF31A4FF.toInt()))) { MainLayout() } }
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* This file is created by fankes on 2022/8/7.
|
||||
*/
|
||||
package com.highcapable.yukireflection.demo_jvm.test;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
public class Main {
|
||||
|
||||
private static String staticContent = "I am static!";
|
||||
|
||||
private final String content;
|
||||
|
||||
public Main(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public static String getStaticContent() {
|
||||
return staticContent;
|
||||
}
|
||||
}
|
1
yukireflection-core/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
BIN
yukireflection-core/libs/android-34.jar
Normal file
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
@@ -30,6 +30,7 @@
|
||||
package com.highcapable.yukireflection
|
||||
|
||||
import com.highcapable.yukireflection.YukiReflection.Configs
|
||||
import com.highcapable.yukireflection.generated.YukiReflectionProperties
|
||||
import java.lang.reflect.Member
|
||||
|
||||
/**
|
||||
@@ -39,11 +40,11 @@ import java.lang.reflect.Member
|
||||
*/
|
||||
object YukiReflection {
|
||||
|
||||
/** 获取当前 [YukiReflection] 的版本 */
|
||||
const val API_VERSION_NAME = BuildConfig.API_VERSION_NAME
|
||||
/** 版本名称 */
|
||||
const val API_VERSION_NAME = YukiReflectionProperties.PROJECT_YUKIREFLECTION_CORE_VERSION
|
||||
|
||||
/** 获取当前 [YukiReflection] 的版本号 */
|
||||
const val API_VERSION_CODE = BuildConfig.API_VERSION_CODE
|
||||
/** 版本号 */
|
||||
const val API_VERSION_CODE = 3
|
||||
|
||||
/**
|
||||
* 配置 [YukiReflection]
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
@@ -33,7 +33,6 @@ package com.highcapable.yukireflection.finder.classes
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.core.content.pm.PackageInfoCompat
|
||||
import com.highcapable.yukireflection.annotation.YukiPrivateApi
|
||||
import com.highcapable.yukireflection.factory.hasClass
|
||||
import com.highcapable.yukireflection.factory.searchClass
|
||||
@@ -89,9 +88,9 @@ class DexClassFinder @PublishedApi internal constructor(
|
||||
* @return [SharedPreferences] or null
|
||||
*/
|
||||
private fun Context.currentSp(versionName: String? = null, versionCode: Long? = null) = runCatching {
|
||||
@Suppress("DEPRECATION")
|
||||
@Suppress("NewApi", "DEPRECATION", "KotlinRedundantDiagnosticSuppress")
|
||||
getSharedPreferences(packageManager?.getPackageInfo(packageName, PackageManager.GET_META_DATA)
|
||||
?.let { "${CACHE_FILE_NAME}_${versionName ?: it.versionName}_${versionCode ?: PackageInfoCompat.getLongVersionCode(it)}" }
|
||||
?.let { "${CACHE_FILE_NAME}_${versionName ?: it.versionName}_${versionCode ?: runCatching { it.longVersionCode }.getOrNull() ?: it.versionCode}" }
|
||||
?: "${CACHE_FILE_NAME}_unknown",
|
||||
Context.MODE_PRIVATE)
|
||||
}.onFailure { yLoggerW(msg = "Failed to read app's SharedPreferences when using DexClassFinder\n${it.toStackTrace()}") }.getOrNull()
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* YukiReflection - An efficient Reflection API for Java and Android built in Kotlin
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
21
yukireflection/proguard-rules.pro
vendored
@@ -1,21 +0,0 @@
|
||||
# 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
|
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest />
|