Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions README.MD.other
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ScanBridge

### Android
To run the application on android device/emulator:
- open project in Android Studio and run imported android run configuration

To build the application bundle:
- run `./gradlew :androidApp:assembleDebug`
- find `.apk` file in `androidApp/build/outputs/apk/debug/androidApp-debug.apk`

### Desktop
Run the desktop application: `./gradlew :desktopApp:run`
Run the desktop **hot reload** application: `./gradlew :desktopApp:hotRun --auto`

### iOS
To run the application on iPhone device/simulator:
- Open `iosApp/iosApp.xcproject` in Xcode and run standard configuration
- Or use [Kotlin Multiplatform Mobile plugin](https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile) for Android Studio

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<p align="center" style="text-align: center;">
<a href='https://f-droid.org/packages/io.github.chrisimx.scanbridge/' target="_blank">
<img src="assets/get-it-on-fdroid.svg"
<img src="androidApp/assets/get-it-on-fdroid.svg"
align="center"
alt="Get it on F-Droid"
style="height: 50px"
height="50">
</a>

<a href='https://play.google.com/store/apps/details?id=io.github.chrisimx.scanbridge.play' target="_blank">
<img src='assets/GetItOnGooglePlay_Badge_Web_color_English.svg'
<img src='androidApp/assets/GetItOnGooglePlay_Badge_Web_color_English.svg'
align="center"
alt='Get it on Google Play'
style="height: 50px"
Expand All @@ -31,9 +31,9 @@ scanners.
It is written in Kotlin and uses Jetpack Compose.

<div style="display: flex; flex-wrap: wrap; gap: 10px;">
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/01-scannedPageScreen_1773391873581.png" alt="Discover scanners in your network" style="width: 30%; height: auto;" />
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/02-scanSettings_1773391870896.png" alt="Scan multiple pages" style="width: 30%; height: auto;" />
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/03-discoveryScreen_1773391871298.png" alt="Use your scanner to the maximum of its abilities" style="width: 30%; height: auto;" />
<img src="androidApp/fastlane/metadata/android/en-US/images/phoneScreenshots/01-scannedPageScreen_1773391873581.png" alt="Discover scanners in your network" style="width: 30%; height: auto;" />
<img src="androidApp/fastlane/metadata/android/en-US/images/phoneScreenshots/02-scanSettings_1773391870896.png" alt="Scan multiple pages" style="width: 30%; height: auto;" />
<img src="androidApp/fastlane/metadata/android/en-US/images/phoneScreenshots/03-discoveryScreen_1773391871298.png" alt="Use your scanner to the maximum of its abilities" style="width: 30%; height: auto;" />
</div>

## Features
Expand Down Expand Up @@ -104,7 +104,7 @@ If you want to chat with me or other users, you can join the Matrix room
## Contributions

Contributions are welcome, and it would be amazing if you want to help. Refer to
the [Contribution Guidelines](CONTRIBUTING.md) for more information.
the [Contribution Guidelines](androidApp/CONTRIBUTING.md) for more information.

## License

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
28 changes: 6 additions & 22 deletions app/build.gradle.kts → androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,10 @@ plugins {
id("app.cash.paraphrase") version "0.4.1"
}

fun getGitCommitHash(): String {
return try {
val command = "git rev-parse --short HEAD"
val process = ProcessBuilder()
.command(command.split(" "))
.directory(rootProject.projectDir)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start()
val wait = process.waitFor(60, TimeUnit.SECONDS)
if (!wait) {
return "unknown"
}

val result = process.inputStream.bufferedReader().readText()

result.trim()
} catch (_: Exception) {
"unknown" // Fallback
}
}
val gitHashProvider = providers.exec {
commandLine("git", "rev-parse", "--short", "HEAD")
isIgnoreExitValue = true
}.standardOutput.asText.map { it.trim() }

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
compilerOptions {
Expand Down Expand Up @@ -76,10 +60,10 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
buildConfigField("String", "GIT_COMMIT_HASH", "\"${getGitCommitHash()}\"")
buildConfigField("String", "GIT_COMMIT_HASH", "\"${gitHashProvider.get()}\"")
}
debug {
buildConfigField("String", "GIT_COMMIT_HASH", "\"${getGitCommitHash()}\"")
buildConfigField("String", "GIT_COMMIT_HASH", "\"${gitHashProvider.get()}\"")
}
}
flavorDimensions += "edition"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions androidApp/gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/536afcd1dff540251f85e5d2c80458cf/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/0b98aec810298c2c1d7fdac5dac37910/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/658299a896470fbb3103ba3a430ee227/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/248ffb1098f61659502d0c09aa348294/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/ac151d55def6b6a9a159dc4cb4642851/redirect
toolchainVendor=JETBRAINS
toolchainVersion=21
100 changes: 100 additions & 0 deletions androidApp/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
[versions]
agp = "9.1.0"
coilCompose = "3.3.0"
constraintlayoutCompose = "1.1.1"
datastore = "1.2.0"
esclkt = "2.0.6"
escl-mock-server = "1.0.1"
itextCore = "9.3.0"
kotlin = "2.3.20-Beta1"
coreKtx = "1.17.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
kotlinReflect = "2.1.20"
kotlinxSerializationJson = "1.9.0"
lifecycleRuntimeKtx = "2.9.4"
activityCompose = "1.11.0"
composeBom = "2025.10.00"
room = "2.8.4"
timber = "5.0.1"
zoomable = "0.18.0"
material3 = "1.5.0-alpha06"
materialIcons = "1.7.8"
navigationCompose = "2.9.5"
versionsPlugin = "0.53.0"
screengrab = "2.1.1"
ktor = "3.4.0"
koin = "4.2.0-RC1"
koin-plugin = "0.3.0"
protobuf-plugin = "0.9.6"
protobuf-kotlin-lite = "4.33.5"
rules = "1.7.0"

[libraries]

androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "datastore" }

androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }

koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-annotations = { module = "io.insert-koin:koin-annotations", version.ref = "koin" }
koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }
koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = "koin" }

# Android
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-android-test = { module = "io.insert-koin:koin-android-test", version.ref = "koin" }

koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin"}

koin-androix-navigation = { module = "io.insert-koin:koin-androidx-compose-navigation", version.ref = "koin"}

# Compose
koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koin" }
koin-compose-viewmodel-navigation = { module = "io.insert-koin:koin-compose-viewmodel-navigation", version.ref = "koin" }
koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin" }

ktor-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor"}
ktor-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor"}
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "constraintlayoutCompose" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleRuntimeKtx" }
androidx-material-icons-core = { module = "androidx.compose.material:material-icons-core" , version.ref = "materialIcons"}
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coilCompose" }
esclkt = { module = "io.github.chrisimx:esclkt", version.ref = "esclkt" }
itext7-core = { module = "com.itextpdf:itext-core", version.ref = "itextCore" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlinReflect" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
screengrab = { module = "tools.fastlane:screengrab", version.ref = "screengrab" }
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
zoomable = { module = "me.saket.telephoto:zoomable", version.ref = "zoomable" }
protobuf-kotlin-lite = { module = "com.google.protobuf:protobuf-kotlin-lite", version.ref = "protobuf-kotlin-lite"}
androidx-rules = { group = "androidx.test", name = "rules", version.ref = "rules" }

escl-mock-server = { module = "io.github.chrisimx:escl-mock-server", version.ref = "escl-mock-server"}

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versionsPlugin" }
koin = { id = "io.insert-koin.compiler.plugin", version.ref = "koin-plugin" }
protobuf = { id = "com.google.protobuf", version.ref = "protobuf-plugin" }
room = { id = "androidx.room", version.ref = "room"}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
// TODO: import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
Expand All @@ -28,7 +28,7 @@ import io.github.chrisimx.scanbridge.theme.ScanBridgeTheme
import timber.log.Timber

class CrashActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
// TODO: @OptIn(ExperimentalMaterial3ExpressiveApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.animation.core.snap
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
// TODO: import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.ExtendedFloatingActionButton
import androidx.compose.material3.FabPosition
import androidx.compose.material3.Icon
Expand Down Expand Up @@ -69,7 +69,7 @@ suspend fun finishCrop(cropRect: Rect, file: String): File? = withContext(Dispat
return@withContext croppedFile
}

@OptIn(ExperimentalMaterial3ExpressiveApi::class, ExperimentalTelephotoApi::class)
// TODO: @OptIn(ExperimentalMaterial3ExpressiveApi::class, ExperimentalTelephotoApi::class)
@Composable
fun CropScreen(scanId: Uuid, returnRoute: BaseRoute, navController: NavController) {
val context = LocalContext.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Favorite
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
// TODO: import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
Expand Down Expand Up @@ -59,7 +59,7 @@ import kotlinx.coroutines.withContext
import kotlinx.serialization.json.Json
import timber.log.Timber

@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
// TODO: @OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun ScanBridgeApp() {
ScanBridgeTheme {
Expand Down
Loading
Loading