Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ open class HandleProxyFactory(private val context: Context) {
updateCacheTimestamp(vmKey)
return cachedClass
}
val weakClass = weakClassMap[vmKey]
if (weakClass != null) {
classMap[vmKey] = weakClass
val staticCachedClass = staticCacheMap[vmKey]
if (staticCachedClass != null) {
classMap[vmKey] = staticCachedClass
updateCacheTimestamp(vmKey)
return weakClass
return staticCachedClass
}
if (!isValidCache(vmKey)) {
throw BytesException(bytes, "VM key $vmKey not found in cache")
Expand All @@ -101,7 +101,7 @@ open class HandleProxyFactory(private val context: Context) {
val loader = DexClassLoader(getTheApkFile(vmKey).absolutePath, getOptDir(vmKey).absolutePath, null, context.classLoader)
val clazz = loader.loadClass(CLASS_NAME)
classMap[vmKey] = clazz
weakClassMap[vmKey] = clazz
staticCacheMap[vmKey] = clazz
return clazz
}
}
Expand All @@ -111,7 +111,7 @@ open class HandleProxyFactory(private val context: Context) {
const val CACHE_FOLDER_NAME = "cache_dg"
val CLASS_LOCK = Object()
@GuardedBy("CLASS_LOCK")
val weakClassMap = WeakHashMap<String, Class<*>>()
val staticCacheMap = hashMapOf<String, Class<*>>()
val PROD_CERT_HASH = byteArrayOf(61, 122, 18, 35, 1, -102, -93, -99, -98, -96, -29, 67, 106, -73, -64, -119, 107, -5, 79, -74, 121, -12, -34, 95, -25, -62, 63, 50, 108, -113, -103, 74)
}
}