feat: rust native
Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,7 @@ android {
|
||||
buildConfigField("int", "VERSION_CODE", "${rootProject.ext["appVersionCode"]}")
|
||||
buildConfigField("String", "APPLICATION_ID", "\"${rootProject.ext["applicationId"]}\"")
|
||||
buildConfigField("long", "BUILD_TIMESTAMP", "${System.currentTimeMillis()}L")
|
||||
buildConfigField("String", "BUILD_HASH", "\"${rootProject.ext["buildHash"]}\"")
|
||||
buildConfigField("String", "BUILD_HASH", "\"${rootProject.ext["buildHash"]}\".toString()")
|
||||
val gitHash = ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine("git", "rev-parse", "HEAD")
|
||||
|
||||
@@ -33,6 +33,7 @@ enum class InternalFileHandleType(
|
||||
MAPPINGS("mappings", "mappings.json"),
|
||||
MESSAGE_LOGGER("message_logger", "message_logger.db", isDatabase = true),
|
||||
PINNED_BEST_FRIEND("pinned_best_friend", "pinned_best_friend.txt"),
|
||||
NATIVE_SIG_CACHE("native_sig_cache", "native_sig_cache.txt"),
|
||||
SIF("sif", "libsif.so");
|
||||
|
||||
fun resolve(context: Context): File = if (isDatabase) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import kotlinx.coroutines.runBlocking
|
||||
import me.rhunk.snapenhance.bridge.storage.FileHandleManager
|
||||
import me.rhunk.snapenhance.common.BuildConfig
|
||||
import me.rhunk.snapenhance.common.Constants
|
||||
import me.rhunk.snapenhance.common.bridge.FileHandleScope
|
||||
import me.rhunk.snapenhance.common.bridge.InternalFileHandleType
|
||||
import me.rhunk.snapenhance.common.bridge.InternalFileWrapper
|
||||
import me.rhunk.snapenhance.common.logger.AbstractLogger
|
||||
@@ -15,7 +16,7 @@ import me.rhunk.snapenhance.mapper.ClassMapper
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
class MappingsWrapper(
|
||||
fileHandleManager: LazyBridgeValue<FileHandleManager>
|
||||
private val fileHandleManager: LazyBridgeValue<FileHandleManager>
|
||||
): InternalFileWrapper(fileHandleManager, InternalFileHandleType.MAPPINGS, defaultValue = "{}") {
|
||||
private lateinit var context: Context
|
||||
private var mappingUniqueHash: Long = 0
|
||||
@@ -68,6 +69,10 @@ class MappingsWrapper(
|
||||
|
||||
fun refresh() {
|
||||
mappingUniqueHash = getUniqueBuildId()
|
||||
|
||||
// reset native signature cache
|
||||
fileHandleManager.value.getFileHandle(FileHandleScope.INTERNAL.key, InternalFileHandleType.NATIVE_SIG_CACHE.key).delete()
|
||||
|
||||
val classMapper = ClassMapper(*mappers.values.toTypedArray())
|
||||
|
||||
runCatching {
|
||||
|
||||
Reference in New Issue
Block a user