Rename TrickyStoreOSS to TEESimulator (#3)
We should keep the java class name to facilitate the process of tracking back commit history.
This commit is contained in:
@@ -26,13 +26,13 @@ val gitCommitHash = "git rev-parse --verify --short HEAD".execute()
|
||||
val verName = "v2.1.0"
|
||||
|
||||
android {
|
||||
namespace = "io.github.beakthoven.TrickyStoreOSS"
|
||||
namespace = "org.matrix.TEESimulator"
|
||||
compileSdk = 36
|
||||
ndkVersion = "28.2.13676358"
|
||||
buildToolsVersion = "36.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "io.github.beakthoven.TrickyStoreOSS"
|
||||
applicationId = "org.matrix.TEESimulator"
|
||||
minSdk = 29
|
||||
targetSdk = 36
|
||||
versionCode = gitCommitCount
|
||||
@@ -135,7 +135,7 @@ afterEvaluate {
|
||||
|
||||
// apkFile.copyTo(moduleFolder.resolve("service.apk"), overwrite = true)
|
||||
|
||||
val allowedLibs = setOf("libinject.so", "libTrickyStoreOSS.so")
|
||||
val allowedLibs = setOf("libinject.so", "libTEESimulator.so")
|
||||
soDir
|
||||
.walk()
|
||||
.filter { it.isFile && it.name in allowedLibs }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2025 Dakkshesh <beakthoven@gmail.com>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(TrickyStoreOSS)
|
||||
project(TEESimulator)
|
||||
|
||||
find_package(cxx REQUIRED CONFIG)
|
||||
link_libraries(cxx::cxx)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "lsplt.hpp"
|
||||
|
||||
#define LOG_TAG "TrickyStoreOSS"
|
||||
#define LOG_TAG "TEESimulator"
|
||||
|
||||
#define SYSCALL_IS_ERR(e) (((unsigned long)e) > -4096UL)
|
||||
#define SYSCALL_ERR(e) (-(int)(e))
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
|
||||
#ifndef LOG_TAG
|
||||
# define LOG_TAG "TrickyStoreOSS"
|
||||
# define LOG_TAG "TEESimulator"
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
@@ -35,7 +35,7 @@ object AttestUtils {
|
||||
val TEEStatus: Boolean by lazy { isTEEWorking() }
|
||||
val CachedAttestData: AttestationData? by lazy { getAttestData() }
|
||||
|
||||
private val keygen_alias = "TrickyStoreOSS_attest"
|
||||
private val keygen_alias = "TEESimulator_attest"
|
||||
|
||||
private fun isTEEWorking(): Boolean {
|
||||
return try {
|
||||
|
||||
@@ -7,8 +7,8 @@ package io.github.beakthoven.TrickyStoreOSS
|
||||
|
||||
import android.system.keystore2.KeyEntryResponse
|
||||
import android.system.keystore2.KeyMetadata
|
||||
import android.util.Log
|
||||
import io.github.beakthoven.TrickyStoreOSS.CertificateUtils.putCertificateChain
|
||||
import io.github.beakthoven.TrickyStoreOSS.logging.Logger
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.StringReader
|
||||
@@ -26,8 +26,6 @@ import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
|
||||
import org.bouncycastle.util.io.pem.PemReader
|
||||
|
||||
object CertificateUtils {
|
||||
private const val TAG = "TrickyStoreOSS"
|
||||
|
||||
sealed class CertificateResult<out T> {
|
||||
data class Success<T>(val data: T) : CertificateResult<T>()
|
||||
|
||||
@@ -59,7 +57,7 @@ object CertificateUtils {
|
||||
val certFactory = CertificateFactory.getInstance("X.509")
|
||||
certFactory.generateCertificate(ByteArrayInputStream(bytes)) as? X509Certificate
|
||||
} catch (e: CertificateException) {
|
||||
Log.w(TAG, "Couldn't parse certificate in keystore", e)
|
||||
Logger.w("Couldn't parse certificate in keystore", e)
|
||||
null
|
||||
}
|
||||
}
|
||||
@@ -84,7 +82,7 @@ object CertificateUtils {
|
||||
certFactory.generateCertificates(ByteArrayInputStream(bytes))
|
||||
as Collection<X509Certificate>
|
||||
} catch (e: CertificateException) {
|
||||
Log.w(TAG, "Couldn't parse certificates in keystore", e)
|
||||
Logger.w("Couldn't parse certificates in keystore", e)
|
||||
emptyList()
|
||||
}
|
||||
} ?: emptyList()
|
||||
@@ -97,12 +95,12 @@ object CertificateUtils {
|
||||
outputStream.toByteArray()
|
||||
}
|
||||
}
|
||||
.onFailure { Log.w(TAG, "Failed to convert certificates to byte array", it) }
|
||||
.onFailure { Logger.w("Failed to convert certificates to byte array", it) }
|
||||
.getOrNull()
|
||||
|
||||
fun Collection<Certificate>.toByteArrayList(): List<ByteArray>? =
|
||||
runCatching { map { it.encoded } }
|
||||
.onFailure { Log.w(TAG, "Failed to convert certificates to byte array list", it) }
|
||||
.onFailure { Logger.w("Failed to convert certificates to byte array list", it) }
|
||||
.getOrNull()
|
||||
|
||||
fun KeyEntryResponse?.getCertificateChain(): Array<Certificate>? {
|
||||
|
||||
@@ -15,7 +15,7 @@ private const val RETRY_DELAY_MS = 1000L
|
||||
private const val SERVICE_SLEEP_MS = 1000000L
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Logger.i("Welcome to TrickyStoreOSS!")
|
||||
Logger.i("Welcome to TEESimulator!")
|
||||
|
||||
try {
|
||||
AndroidUtils.setupBootHash()
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ object Keystore2Interceptor : BaseKeystoreInterceptor() {
|
||||
|
||||
override val serviceName = "android.system.keystore2.IKeystoreService/default"
|
||||
override val processName = "keystore2"
|
||||
override val injectionCommand = "exec ./inject `pidof keystore2` libTrickyStoreOSS.so entry"
|
||||
override val injectionCommand = "exec ./inject `pidof keystore2` libTEESimulator.so entry"
|
||||
|
||||
private var teeInterceptor: SecurityLevelInterceptor? = null
|
||||
private var strongBoxInterceptor: SecurityLevelInterceptor? = null
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ object KeystoreInterceptor : BaseKeystoreInterceptor() {
|
||||
|
||||
override val serviceName = "android.security.keystore"
|
||||
override val processName = "keystore"
|
||||
override val injectionCommand = "exec ./inject `pidof keystore` libTrickyStoreOSS.so entry"
|
||||
override val injectionCommand = "exec ./inject `pidof keystore` libTEESimulator.so entry"
|
||||
|
||||
private const val DESCRIPTOR = "android.security.keystore.IKeystoreService"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ package io.github.beakthoven.TrickyStoreOSS.logging
|
||||
import android.util.Log
|
||||
|
||||
object Logger {
|
||||
const val TAG = "TrickyStoreOSS"
|
||||
const val TAG = "TTESimulator"
|
||||
|
||||
sealed class LogLevel(val priority: Int) {
|
||||
object Debug : LogLevel(Log.DEBUG)
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ ui_print ""
|
||||
|
||||
|
||||
ui_print "- Extracting $ARCH libraries"
|
||||
install_file "lib/$ABI_DIR/libTrickyStoreOSS.so" "$MODPATH"
|
||||
install_file "lib/$ABI_DIR/libTEESimulator.so" "$MODPATH"
|
||||
install_file "lib/$ABI_DIR/libinject.so" "$MODPATH"
|
||||
ui_print ""
|
||||
|
||||
@@ -87,4 +87,4 @@ fi
|
||||
if [ ! -f "$CONFIG_DIR/target.txt" ]; then
|
||||
ui_print "- Adding default target scope"
|
||||
install_file "target.txt" "$CONFIG_DIR"
|
||||
fi
|
||||
fi
|
||||
|
||||
+1
-1
@@ -12,4 +12,4 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec /system/bin/app_process -Djava.class.path="$CLASSPATH" "$MODDIR" --nice-name=TrickyStoreOSS io.github.beakthoven.TrickyStoreOSS.MainKt
|
||||
exec /system/bin/app_process -Djava.class.path="$CLASSPATH" "$MODDIR" --nice-name=TEESimulator io.github.beakthoven.TrickyStoreOSS.MainKt
|
||||
|
||||
Reference in New Issue
Block a user