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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*]
insert_final_newline = true
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Enforce Unix line endings for all text files
* text=auto eol=lf

# Explicitly binary
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.webp binary
*.keystore binary
*.jks binary
98 changes: 67 additions & 31 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
plugins {
id("io.sentry.android.gradle") version "3.0.1"
id("io.sentry.android.gradle") version "4.0.0"
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
}

sentry {
includeProguardMapping = true
autoUploadProguardMapping = true
def gitVersionName = { ->
try {
def proc = ['git', 'describe', '--tags', '--always', '--dirty'].execute(null, rootDir)
proc.waitFor()
proc.exitValue() == 0 ? proc.text.trim() : "v1.10"
} catch (Exception ex) {
"v1.10"
}
}

def gitVersionCode = { ->
try {
def proc = ['git', 'rev-list', '--count', 'HEAD'].execute(null, rootDir)
proc.waitFor()
proc.exitValue() == 0 ? proc.text.trim().toInteger() : 1
} catch (Exception ex) {
1
}
}

android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
namespace "com.example.barcodescanner"
compileSdk 35

defaultConfig {
applicationId "com.example.barcodescanner"
minSdkVersion 21
targetSdkVersion 31
versionCode 12
versionName "1.10"
minSdk 21
targetSdk 35
versionCode gitVersionCode()
versionName gitVersionName()

multiDexEnabled true
vectorDrawables.useSupportLibrary true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true

javaCompileOptions {
annotationProcessorOptions {
Expand All @@ -35,19 +49,37 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = '17'
}

buildFeatures {
viewBinding true
buildConfig true
}

signingConfigs {
release {
storeFile file('../keystore.jks')
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias System.getenv("KEY_ALIAS")
keyPassword System.getenv("KEY_PASSWORD")
}
}

buildTypes {
debug {
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

Expand All @@ -67,32 +99,33 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

// Android
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation 'androidx.multidex:multidex:2.0.1'

// Room
final roomVersion = "2.4.2"
kapt "androidx.room:room-compiler:$roomVersion"
final roomVersion = "2.6.1"
implementation "androidx.room:room-runtime:$roomVersion"
implementation "androidx.room:room-rxjava2:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"

// Paging
final pagingVersion = "1.0.1"
implementation "android.arch.paging:runtime:$pagingVersion"
implementation "android.arch.paging:rxjava2:$pagingVersion"
final pagingVersion = "2.1.2"
implementation "androidx.paging:paging-runtime:$pagingVersion"
implementation "androidx.paging:paging-rxjava2:$pagingVersion"

// Barcode Scanner
implementation 'com.budiyev.android:code-scanner:2.1.0'
implementation 'com.github.yuriy-budiyev:code-scanner:v2.1.0'

// Barcode Image Generator
//noinspection GradleDependency
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'

// VCard Parser
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.0'
Expand All @@ -103,16 +136,19 @@ dependencies {
// OTP
implementation "dev.turingcomplete:kotlin-onetimepassword:2.0.1"

// ZXing Core
implementation 'com.google.zxing:core:3.5.3'

// Rx
implementation "io.reactivex.rxjava2:rxkotlin:2.3.0"
implementation "com.jakewharton.rxbinding2:rxbinding-appcompat-v7-kotlin:2.2.0"

// Image Crop Library
implementation 'com.isseiaoki:simplecropview:1.1.8'
implementation 'com.vanniktech:android-image-cropper:4.5.0'

// Date time picker
implementation 'com.github.florent37:singledateandtimepicker:2.2.6'
implementation 'com.github.florent37:SingleDateAndTimePicker:v2.2.7'

// Sentry
implementation 'io.sentry:sentry-android:5.7.1'
implementation 'io.sentry:sentry-android:7.0.0'
}
2 changes: 1 addition & 1 deletion app/src/aptoide/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
/>
</shortcut>

</shortcuts>
</shortcuts>
2 changes: 1 addition & 1 deletion app/src/googlePlay/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
/>
</shortcut>

</shortcuts>
</shortcuts>
5 changes: 2 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.barcodescanner"
>

<!--Normal permissions-->
Expand Down Expand Up @@ -33,7 +32,7 @@

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.barcodescanner.fileprovider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
>
Expand Down Expand Up @@ -203,4 +202,4 @@

</application>

</manifest>
</manifest>
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/barcodescanner/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class App : MultiDexApplication() {
Logger.log(error)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ val Fragment.settings
get() = Settings.getInstance(requireContext())

val Fragment.permissionsHelper
get() = PermissionsHelper
get() = PermissionsHelper
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ fun AppCompatActivity.showError(error: Throwable?) {
error
)
errorDialog.show(supportFragmentManager, "")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ fun BarcodeFormat.toColorId(): Int {
BarcodeFormat.DATA_MATRIX, BarcodeFormat.AZTEC, BarcodeFormat.PDF_417, BarcodeFormat.MAXICODE -> R.color.orange
else -> R.color.green
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ fun BarcodeSchema.toStringId(): Int? {
BarcodeSchema.OTHER -> R.string.barcode_schema_other
else -> null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package com.example.barcodescanner.extension

fun Boolean?.orFalse(): Boolean {
return this ?: false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import org.apache.commons.codec.binary.Base32

fun ByteArray.encodeBase32(): String {
return Base32().encodeAsString(this)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ val Context.currentLocale: Locale?
resources.configuration.locales.get(0)
} else {
resources.configuration.locale
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ fun DateFormat.formatOrNull(time: Long?): String? {
} catch (ex: Exception) {
null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package com.example.barcodescanner.extension

fun Double?.orZero(): Double {
return this ?: 0.0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package com.example.barcodescanner.extension

fun Int?.orZero(): Int {
return this ?: 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package com.example.barcodescanner.extension

fun Long?.orZero(): Long {
return this ?: 0L
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.example.barcodescanner.extension

fun <T> unsafeLazy(initializer: () -> T): Lazy<T> = lazy(LazyThreadSafetyMode.NONE, initializer)
fun <T> unsafeLazy(initializer: () -> T): Lazy<T> = lazy(LazyThreadSafetyMode.NONE, initializer)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import com.google.zxing.Result

fun Result.equalTo(barcode: Barcode?): Boolean {
return barcodeFormat == barcode?.format && text == barcode?.text
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ fun String.toAddressType(): Int? {
"OTHER" -> ContactsContract.CommonDataKinds.StructuredPostal.TYPE_OTHER
else -> null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ fun StringBuilder.appendIfNotNullOrBlank(prefix: String = "", value: String?, su
append(suffix)
}
return this
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ fun Uri.Builder.appendQueryParameterIfNotNullOrBlank(key: String, value: String?
appendQueryParameter(key, value)
}
return this
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ fun Vibrator.vibrateOnce(pattern: LongArray) {
} else {
vibrate(pattern, -1)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ fun View.requestApplyInsetsWhenAttached() {
override fun onViewDetachedFromWindow(v: View) = Unit
})
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ abstract class BaseActivity : AppCompatActivity() {
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
rotationHelper.lockCurrentOrientationIfNeeded(this)
}
}
}
Loading