diff --git a/app/src/main/aidl/me/rhunk/snapenhance/bridge/BridgeInterface.aidl b/app/src/main/aidl/me/rhunk/snapenhance/bridge/BridgeInterface.aidl index 3e015a6a6..f0691a0fd 100644 --- a/app/src/main/aidl/me/rhunk/snapenhance/bridge/BridgeInterface.aidl +++ b/app/src/main/aidl/me/rhunk/snapenhance/bridge/BridgeInterface.aidl @@ -105,4 +105,6 @@ interface BridgeInterface { * Enqueue a download */ void enqueueDownload(in Intent intent, DownloadCallback callback); + + String getApplicationApkPath(); } \ No newline at end of file diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeClient.kt b/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeClient.kt index 7885d926a..ae647836d 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeClient.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeClient.kt @@ -108,6 +108,9 @@ class BridgeClient( LocalePair(it.key, it.value) } + fun getApplicationApkPath() = service.getApplicationApkPath() + + fun getAutoUpdaterTime(): Long { createAndReadFile(BridgeFileType.AUTO_UPDATER_TIMESTAMP, "0".toByteArray()).run { return if (isEmpty()) { diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeService.kt b/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeService.kt index 1aa1003f8..5bc8da37e 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeService.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/bridge/BridgeService.kt @@ -101,5 +101,7 @@ class BridgeService : Service() { SharedContext.ensureInitialized(this@BridgeService) DownloadProcessor(this@BridgeService, callback).onReceive(intent) } + + override fun getApplicationApkPath(): String = applicationInfo.publicSourceDir } } diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/util/export/MessageExporter.kt b/app/src/main/kotlin/me/rhunk/snapenhance/util/export/MessageExporter.kt index d397e21a7..28ff06cf5 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/util/export/MessageExporter.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/util/export/MessageExporter.kt @@ -190,9 +190,7 @@ class MessageExporter( printLog("writing template...") runCatching { - ZipFile( - context.androidContext.packageManager.getApplicationInfoCompat(BuildConfig.APPLICATION_ID, PackageManager.GET_META_DATA).publicSourceDir - ).use { apkFile -> + ZipFile(context.bridgeClient.getApplicationApkPath()).use { apkFile -> //export rawinflate.js apkFile.getEntry("assets/web/rawinflate.js").let { entry -> output.write("