mirror of
https://github.com/QM4RS/FridaBox.git
synced 2026-10-10 18:02:13 +02:00
refactor: remove legacy BlackBox app shell
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.qm4rs.fridabox
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import top.niunaijun.blackbox.BlackBoxCore
|
||||
|
||||
class FridaBoxApplication : Application() {
|
||||
override fun attachBaseContext(base: Context) {
|
||||
super.attachBaseContext(base)
|
||||
appContext = base
|
||||
|
||||
runCatching { BlackBoxCore.get().closeCodeInit() }
|
||||
.onFailure { Log.e(TAG, "Native bootstrap failed", it) }
|
||||
runCatching { BlackBoxCore.get().onBeforeMainApplicationAttach(this, base) }
|
||||
.onFailure { Log.e(TAG, "Pre-attach hook failed", it) }
|
||||
|
||||
FridaBoxRuntime.attach(base)
|
||||
|
||||
runCatching { BlackBoxCore.get().onAfterMainApplicationAttach(this, base) }
|
||||
.onFailure { Log.e(TAG, "Post-attach hook failed", it) }
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
FridaBoxRuntime.create()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "FridaBox.Application"
|
||||
|
||||
@Volatile
|
||||
lateinit var appContext: Context
|
||||
private set
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user