mirror of
https://github.com/T8RIN/ImageToolbox.git
synced 2026-03-13 08:21:40 +08:00
Added remove pages PDF tool
This commit is contained in:
@@ -26,6 +26,7 @@ import com.t8rin.imagetoolbox.app.presentation.components.functions.initQrScanne
|
||||
import com.t8rin.imagetoolbox.app.presentation.components.functions.injectBaseComponent
|
||||
import com.t8rin.imagetoolbox.app.presentation.components.functions.registerSecurityProviders
|
||||
import com.t8rin.imagetoolbox.app.presentation.components.functions.setupFlags
|
||||
import com.t8rin.imagetoolbox.app.presentation.components.utils.isMain
|
||||
import com.t8rin.imagetoolbox.core.crash.presentation.components.applyGlobalExceptionHandler
|
||||
import com.t8rin.imagetoolbox.core.domain.saving.KeepAliveService
|
||||
import com.t8rin.imagetoolbox.core.ui.utils.ComposeApplication
|
||||
@@ -54,19 +55,21 @@ class ImageToolboxApplication : ComposeApplication() {
|
||||
override fun runSetup() {
|
||||
if (isSetupCompleted) return
|
||||
|
||||
setupFlags()
|
||||
initAppContext()
|
||||
initOpenCV()
|
||||
initAI()
|
||||
initColorNames()
|
||||
initQrScanner()
|
||||
attachLogWriter()
|
||||
applyGlobalExceptionHandler()
|
||||
registerSecurityProviders()
|
||||
initPdfBox()
|
||||
injectBaseComponent()
|
||||
if (isMain()) {
|
||||
setupFlags()
|
||||
initAppContext()
|
||||
initOpenCV()
|
||||
initAI()
|
||||
initColorNames()
|
||||
initQrScanner()
|
||||
attachLogWriter()
|
||||
applyGlobalExceptionHandler()
|
||||
registerSecurityProviders()
|
||||
initPdfBox()
|
||||
injectBaseComponent()
|
||||
|
||||
isSetupCompleted = true
|
||||
isSetupCompleted = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ImageToolbox is an image editor for android
|
||||
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
|
||||
* Copyright (c) 2026 T8RIN (Malik Mukhametzyanov)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,6 @@
|
||||
package com.t8rin.imagetoolbox.app.presentation.components.functions
|
||||
|
||||
import android.app.Application
|
||||
import com.t8rin.imagetoolbox.app.presentation.components.utils.isMain
|
||||
import com.t8rin.imagetoolbox.core.resources.R
|
||||
import com.t8rin.imagetoolbox.core.ui.utils.helper.DeviceInfo
|
||||
import com.t8rin.logger.Logger
|
||||
@@ -26,18 +25,16 @@ import com.t8rin.logger.attachLogWriter
|
||||
|
||||
|
||||
internal fun Application.attachLogWriter() {
|
||||
if (isMain()) {
|
||||
Logger.attachLogWriter(
|
||||
context = this@attachLogWriter,
|
||||
fileProvider = getString(R.string.file_provider),
|
||||
logsFilename = "image_toolbox_logs.txt",
|
||||
startupLog = Logger.Log(
|
||||
tag = "Device Info",
|
||||
message = "--${DeviceInfo.get()}--",
|
||||
level = Logger.Level.Info
|
||||
),
|
||||
isSyncCreate = false,
|
||||
maxFileSize = null
|
||||
)
|
||||
}
|
||||
Logger.attachLogWriter(
|
||||
context = this@attachLogWriter,
|
||||
fileProvider = getString(R.string.file_provider),
|
||||
logsFilename = "image_toolbox_logs.txt",
|
||||
startupLog = Logger.Log(
|
||||
tag = "Device Info",
|
||||
message = "--${DeviceInfo.get()}--",
|
||||
level = Logger.Level.Info
|
||||
),
|
||||
isSyncCreate = false,
|
||||
maxFileSize = null
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ImageToolbox is an image editor for android
|
||||
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
|
||||
* Copyright (c) 2026 T8RIN (Malik Mukhametzyanov)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,11 +25,11 @@ import android.os.Build.VERSION.SDK_INT
|
||||
import com.t8rin.logger.makeLog
|
||||
|
||||
internal fun Application.isMain(): Boolean =
|
||||
getProcessName().makeLog("Current Process") == packageName
|
||||
getProcessName().makeLog("Current Process") == packageName.makeLog("Current packageName")
|
||||
|
||||
|
||||
@SuppressLint("PrivateApi")
|
||||
private fun Application.getProcessName(): String? {
|
||||
internal fun Application.getProcessName(): String? {
|
||||
if (SDK_INT >= 28) {
|
||||
return Application.getProcessName()
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ squircle-shape = "5.1.1"
|
||||
mlkitDocumentScanner = "16.0.0"
|
||||
moshi = "1.15.2"
|
||||
bouncycastle = "1.83"
|
||||
pdfviewer = "1.0.0-alpha12"
|
||||
pdfviewer = "1.0.0-alpha13"
|
||||
fragmentCompose = "1.8.9"
|
||||
|
||||
firebaseCrashlyticsGradle = "3.0.6"
|
||||
|
||||
Reference in New Issue
Block a user