commit 8ba61561213199653eb14ac4b46d52d0daaa17e0 Author: manaknightdev <107868506+manaknightdev@users.noreply.github.com> Date: Tue Mar 14 00:23:53 2023 +0530 Project Setup diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/.gradle/7.4/checksums/checksums.lock b/.gradle/7.4/checksums/checksums.lock new file mode 100644 index 0000000..e68b240 Binary files /dev/null and b/.gradle/7.4/checksums/checksums.lock differ diff --git a/.gradle/7.4/checksums/md5-checksums.bin b/.gradle/7.4/checksums/md5-checksums.bin new file mode 100644 index 0000000..4ae172c Binary files /dev/null and b/.gradle/7.4/checksums/md5-checksums.bin differ diff --git a/.gradle/7.4/checksums/sha1-checksums.bin b/.gradle/7.4/checksums/sha1-checksums.bin new file mode 100644 index 0000000..02ec7d7 Binary files /dev/null and b/.gradle/7.4/checksums/sha1-checksums.bin differ diff --git a/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock b/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..a3fd3e3 Binary files /dev/null and b/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/7.4/dependencies-accessors/gc.properties b/.gradle/7.4/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/7.4/executionHistory/executionHistory.bin b/.gradle/7.4/executionHistory/executionHistory.bin new file mode 100644 index 0000000..b726536 Binary files /dev/null and b/.gradle/7.4/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.4/executionHistory/executionHistory.lock b/.gradle/7.4/executionHistory/executionHistory.lock new file mode 100644 index 0000000..b2353ac Binary files /dev/null and b/.gradle/7.4/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.4/fileChanges/last-build.bin b/.gradle/7.4/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/7.4/fileChanges/last-build.bin differ diff --git a/.gradle/7.4/fileHashes/fileHashes.bin b/.gradle/7.4/fileHashes/fileHashes.bin new file mode 100644 index 0000000..9705044 Binary files /dev/null and b/.gradle/7.4/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.4/fileHashes/fileHashes.lock b/.gradle/7.4/fileHashes/fileHashes.lock new file mode 100644 index 0000000..6ec93de Binary files /dev/null and b/.gradle/7.4/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.4/fileHashes/resourceHashesCache.bin b/.gradle/7.4/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..8ec1ff7 Binary files /dev/null and b/.gradle/7.4/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/7.4/gc.properties b/.gradle/7.4/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..1e27c82 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..9c66617 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Fri Mar 10 21:58:28 IST 2023 +gradle.version=7.4 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..15a3933 Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..cacc81d Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..7be88df --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +DealHuntGo \ No newline at end of file diff --git a/.idea/Android.iml b/.idea/Android.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/Android.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a0de2a1 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..54d5acd --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/navEditor.xml b/.idea/navEditor.xml new file mode 100644 index 0000000..6bdfefe --- /dev/null +++ b/.idea/navEditor.xml @@ -0,0 +1,556 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.DS_Store b/app/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/app/.DS_Store differ diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..cc6d8b6 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'kotlin-kapt' + id 'kotlin-parcelize' + id 'androidx.navigation.safeargs.kotlin' +} + +android { + namespace 'com.demotest.app' + compileSdk 33 + + defaultConfig { + applicationId "com.demotest.app" + minSdk 23 + targetSdk 33 + versionCode 62 + versionName "3.1.4" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + buildConfigField "String", "BASE_URL", "\"https://google.com/\"" + } + + android.applicationVariants.all { variant -> + variant.outputs.all { + outputFileName = "${variant.applicationId}-${variant.versionName}.apk" + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + viewBinding true + } +} + +dependencies { + implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'com.google.android.material:material:1.7.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1' + implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3' + implementation 'androidx.navigation:navigation-ui-ktx:2.5.3' + implementation 'androidx.annotation:annotation:1.5.0' + + //Firebase + //Splash screen + implementation "androidx.core:core-splashscreen:1.0.0" + + // Koin + def koin_android_version= "3.3.0" + implementation "io.insert-koin:koin-android:$koin_android_version" + + // Retrofit + implementation 'com.squareup.retrofit2:retrofit:2.9.0' + implementation 'com.squareup.retrofit2:converter-gson:2.9.0' + // Requests interceptor + implementation "com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2" + //Image processing + implementation 'com.github.bumptech.glide:glide:4.14.2' + kapt 'com.github.bumptech.glide:compiler:4.14.2' + + //Permissions + implementation 'com.karumi:dexter:6.2.3' + + //Loader + implementation "com.github.sakshampruthi:custom-loading-screen:1.16" + implementation 'com.github.simonebortolin:FlowLayoutManager:1.8.0' + + implementation 'com.madgag.spongycastle:core:1.54.0.0' + implementation 'com.madgag.spongycastle:prov:1.54.0.0' + implementation 'com.madgag.spongycastle:pkix:1.54.0.0' + implementation 'com.madgag.spongycastle:pg:1.54.0.0' + + implementation 'com.airbnb.android:lottie:6.0.0' + implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22' + implementation("com.tbuonomo:dotsindicator:4.3") + +} \ No newline at end of file diff --git a/app/debug/com.manaknight.dealhuntgo-1.0.apk b/app/debug/com.manaknight.dealhuntgo-1.0.apk new file mode 100644 index 0000000..3974333 Binary files /dev/null and b/app/debug/com.manaknight.dealhuntgo-1.0.apk differ diff --git a/app/debug/output-metadata.json b/app/debug/output-metadata.json new file mode 100644 index 0000000..109889e --- /dev/null +++ b/app/debug/output-metadata.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.demotest.app", + "variantName": "debug", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "com.demotest.app.app-1.0.apk" + } + ], + "elementType": "File" +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/release/app-release.aab b/app/release/app-release.aab new file mode 100644 index 0000000..894a1d7 Binary files /dev/null and b/app/release/app-release.aab differ diff --git a/app/src/debug/.DS_Store b/app/src/debug/.DS_Store new file mode 100644 index 0000000..4a14808 Binary files /dev/null and b/app/src/debug/.DS_Store differ diff --git a/app/src/debug/ic_launcher-playstore.png b/app/src/debug/ic_launcher-playstore.png new file mode 100644 index 0000000..51aa211 Binary files /dev/null and b/app/src/debug/ic_launcher-playstore.png differ diff --git a/app/src/debug/res/values/ic_launcher_background.xml b/app/src/debug/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..c5d5899 --- /dev/null +++ b/app/src/debug/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/app/src/main/.DS_Store b/app/src/main/.DS_Store new file mode 100644 index 0000000..1870410 Binary files /dev/null and b/app/src/main/.DS_Store differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..aa9a738 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + /> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/demotest/.DS_Store b/app/src/main/java/com/demotest/.DS_Store new file mode 100644 index 0000000..4488c72 Binary files /dev/null and b/app/src/main/java/com/demotest/.DS_Store differ diff --git a/app/src/main/java/com/demotest/app/.DS_Store b/app/src/main/java/com/demotest/app/.DS_Store new file mode 100644 index 0000000..e783601 Binary files /dev/null and b/app/src/main/java/com/demotest/app/.DS_Store differ diff --git a/app/src/main/java/com/demotest/app/App.kt b/app/src/main/java/com/demotest/app/App.kt new file mode 100644 index 0000000..9492674 --- /dev/null +++ b/app/src/main/java/com/demotest/app/App.kt @@ -0,0 +1,33 @@ +package com.demotest.app + +import android.app.Application +import com.demotest.app.data.local.prefModule +import com.demotest.app.data.remote.remoteDataSourceModule +import com.google.android.material.color.DynamicColors +import com.demotest.app.di.repoModules +import com.demotest.app.di.viewModules +import com.demotest.app.network.networkModule +import org.koin.android.ext.koin.androidContext +import org.koin.core.context.startKoin + +class App : Application() { + + override fun onCreate() { + super.onCreate() + + DynamicColors.applyToActivitiesIfAvailable(this) + + startKoin { + androidContext(this@App) + modules(koinModules) + } + } +} + +val koinModules = listOf( + prefModule, + networkModule, + remoteDataSourceModule, + viewModules, + repoModules +) \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/MainActivity.kt b/app/src/main/java/com/demotest/app/MainActivity.kt new file mode 100644 index 0000000..50745a3 --- /dev/null +++ b/app/src/main/java/com/demotest/app/MainActivity.kt @@ -0,0 +1,26 @@ +package com.demotest.app + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.navigation.NavController +import androidx.navigation.findNavController +import androidx.navigation.ui.setupWithNavController +import com.demotest.app.R +import com.demotest.app.databinding.ActivityMainBinding + +class MainActivity : AppCompatActivity() { + + private lateinit var binding: ActivityMainBinding + private lateinit var navController: NavController + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) + + //navController = findNavController(R.id.nav_host_fragment_activity_main) +// binding.navView.setupWithNavController(navController) + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/data/local/AppPreferences.kt b/app/src/main/java/com/demotest/app/data/local/AppPreferences.kt new file mode 100644 index 0000000..6b7746b --- /dev/null +++ b/app/src/main/java/com/demotest/app/data/local/AppPreferences.kt @@ -0,0 +1,13 @@ +package com.demotest.app.data.local + +import android.content.Context +import android.content.SharedPreferences +import org.koin.android.ext.koin.androidContext +import org.koin.dsl.module + +val prefModule = module { + single { AppPreferences(androidContext()) } +} + +class AppPreferences(context: Context) { +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/data/local/MyPrefsBackupAgent.kt b/app/src/main/java/com/demotest/app/data/local/MyPrefsBackupAgent.kt new file mode 100644 index 0000000..9152cf2 --- /dev/null +++ b/app/src/main/java/com/demotest/app/data/local/MyPrefsBackupAgent.kt @@ -0,0 +1,46 @@ +package com.demotest.app.data.local + +import android.app.backup.BackupAgentHelper +import android.app.backup.BackupDataInput +import android.app.backup.BackupDataOutput +import android.app.backup.SharedPreferencesBackupHelper +import android.content.Context +import android.os.ParcelFileDescriptor +import android.util.Log +import android.widget.Toast + +class MyPrefsBackupAgent(private val context: Context): BackupAgentHelper() { + + override fun onCreate() { + val helper = SharedPreferencesBackupHelper(context, "prefs") + addHelper("prefsBackup", helper) + Log.d("shamal","onCreate") + Toast.makeText(this, "onCreate", Toast.LENGTH_SHORT).show() + } + + override fun onBackup( + oldState: ParcelFileDescriptor?, + data: BackupDataOutput?, + newState: ParcelFileDescriptor? + ) { + super.onBackup(oldState, data, newState) + Toast.makeText(this, "onBackup", Toast.LENGTH_SHORT).show() + Log.d("shamal","onBackup") + } + + override fun onRestore( + data: BackupDataInput?, + appVersionCode: Int, + newState: ParcelFileDescriptor? + ) { + super.onRestore(data, appVersionCode, newState) + Toast.makeText(this, "onRestore", Toast.LENGTH_SHORT).show() + Log.d("shamal","onRestore") + } + + override fun onRestoreFinished() { + super.onRestoreFinished() + Toast.makeText(this, "onRestoreFinished", Toast.LENGTH_SHORT).show() + Log.d("shamal","onRestoreFinished") + } +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/data/remote/RemoteDataSource.kt b/app/src/main/java/com/demotest/app/data/remote/RemoteDataSource.kt new file mode 100644 index 0000000..6a90354 --- /dev/null +++ b/app/src/main/java/com/demotest/app/data/remote/RemoteDataSource.kt @@ -0,0 +1,21 @@ +package com.demotest.app.data.remote + +import com.demotest.app.model.ExchangeTestRequest +import com.demotest.app.network.ApiService +import com.demotest.app.network.BaseDataSource +import org.koin.dsl.module + + +val remoteDataSourceModule = module { + factory { RemoteDataSource(get()) } +} + +class RemoteDataSource( + private val apiService: ApiService +) : BaseDataSource() { + + suspend fun testConnection(request: ExchangeTestRequest) = getResult { + apiService.testConnection(request) + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/di/ViewModules.kt b/app/src/main/java/com/demotest/app/di/ViewModules.kt new file mode 100644 index 0000000..b35f965 --- /dev/null +++ b/app/src/main/java/com/demotest/app/di/ViewModules.kt @@ -0,0 +1,16 @@ +package com.demotest.app.di + +import com.demotest.app.app.viewmodels.UserViewModel +import com.demotest.app.repositories.APIRepository +import org.koin.androidx.viewmodel.dsl.viewModel +import org.koin.core.module.Module +import org.koin.dsl.module + + +val viewModules: Module = module { + viewModel { UserViewModel(get()) } +} + +val repoModules: Module = module { + single { APIRepository(get()) } +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/extensions/Constants.kt b/app/src/main/java/com/demotest/app/extensions/Constants.kt new file mode 100644 index 0000000..b0dc07a --- /dev/null +++ b/app/src/main/java/com/demotest/app/extensions/Constants.kt @@ -0,0 +1,18 @@ +package com.demotest.app.extensions + +import android.graphics.Bitmap +import androidx.lifecycle.MutableLiveData + +object Constants { + const val PLATFORM = "ANDROID" + const val PARTIAL_PEEK_ID = "one_partial_peek" + const val CONTENT_TYPE = "application/json" + const val APP_UPDATE_REQUEST_CODE = 1230 + var isAuthorized: MutableLiveData = MutableLiveData() + var refreshNotifications: MutableLiveData = MutableLiveData() + var hasNewNotification: MutableLiveData = MutableLiveData() + var hasNewDeal: MutableLiveData = MutableLiveData() + var refreshCapturedDeals: MutableLiveData = MutableLiveData() + var userImageLiveData: MutableLiveData = MutableLiveData() + var faqUrl: String = "" +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/extensions/View.kt b/app/src/main/java/com/demotest/app/extensions/View.kt new file mode 100644 index 0000000..7694eb4 --- /dev/null +++ b/app/src/main/java/com/demotest/app/extensions/View.kt @@ -0,0 +1,63 @@ +package com.demotest.app.extensions + +import android.view.View +import androidx.fragment.app.Fragment +import androidx.lifecycle.DefaultLifecycleObserver +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.Observer +import androidx.viewbinding.ViewBinding +import kotlin.properties.ReadOnlyProperty +import kotlin.reflect.KProperty + +class FragmentDelegate( + val fragment: Fragment, + val viewBindingFactory: (View) -> T +) : ReadOnlyProperty { + private var binding: T? = null + + init { + fragment.lifecycle.addObserver(object : DefaultLifecycleObserver { + val viewLifecycleOwnerLiveDataObserver = + Observer { + val viewLifecycleOwner = it ?: return@Observer + + viewLifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver { + override fun onDestroy(owner: LifecycleOwner) { + binding = null + } + }) + } + + override fun onCreate(owner: LifecycleOwner) { + fragment.viewLifecycleOwnerLiveData.observeForever( + viewLifecycleOwnerLiveDataObserver + ) + } + + override fun onDestroy(owner: LifecycleOwner) { + fragment.viewLifecycleOwnerLiveData.removeObserver( + viewLifecycleOwnerLiveDataObserver + ) + } + }) + } + + override fun getValue(thisRef: Fragment, property: KProperty<*>): T { + val binding = binding + if (binding != null) { + return binding + } + + val lifecycle = fragment.viewLifecycleOwner.lifecycle + if (!lifecycle.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) { + throw IllegalStateException("Should not attempt to get bindings when Fragment views are destroyed.") + } + + return viewBindingFactory(thisRef.requireView()).also { this.binding = it } + } +} + +fun Fragment.viewBinding(viewBindingFactory: (View) -> T) = + FragmentDelegate(this, viewBindingFactory) + diff --git a/app/src/main/java/com/demotest/app/model/ErrorResponse.kt b/app/src/main/java/com/demotest/app/model/ErrorResponse.kt new file mode 100644 index 0000000..4a21c5d --- /dev/null +++ b/app/src/main/java/com/demotest/app/model/ErrorResponse.kt @@ -0,0 +1,7 @@ +package com.demotest.app.model + +data class ErrorResponse( + val code: String, + val message: String, + val success: Boolean +) \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/model/ExchangeRequest.kt b/app/src/main/java/com/demotest/app/model/ExchangeRequest.kt new file mode 100644 index 0000000..b31481b --- /dev/null +++ b/app/src/main/java/com/demotest/app/model/ExchangeRequest.kt @@ -0,0 +1,7 @@ +package com.demotest.app.model + +data class ExchangeRequest( + val device_id: String, + val public_key: String, +) + diff --git a/app/src/main/java/com/demotest/app/model/ExchangeResponse.kt b/app/src/main/java/com/demotest/app/model/ExchangeResponse.kt new file mode 100644 index 0000000..1973fab --- /dev/null +++ b/app/src/main/java/com/demotest/app/model/ExchangeResponse.kt @@ -0,0 +1,12 @@ +package com.demotest.app.model + +data class ExchangeResponse( + val code: String, + val message: String, + val success: Boolean, + val `data`: Data, +) { + data class Data( + val public_key: String, + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/model/ExchangeTestRequest.kt b/app/src/main/java/com/demotest/app/model/ExchangeTestRequest.kt new file mode 100644 index 0000000..fca3ccb --- /dev/null +++ b/app/src/main/java/com/demotest/app/model/ExchangeTestRequest.kt @@ -0,0 +1,8 @@ +package com.demotest.app.model + +data class ExchangeTestRequest( + val device_id: String, + val encrypted_text: String, + val plain_text: String +) + diff --git a/app/src/main/java/com/demotest/app/model/ExchangeTestResponse.kt b/app/src/main/java/com/demotest/app/model/ExchangeTestResponse.kt new file mode 100644 index 0000000..2e38a44 --- /dev/null +++ b/app/src/main/java/com/demotest/app/model/ExchangeTestResponse.kt @@ -0,0 +1,7 @@ +package com.demotest.app.model + +data class ExchangeTestResponse( + val code: String, + val message: String, + val success: Boolean, +) \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/network/ApiService.kt b/app/src/main/java/com/demotest/app/network/ApiService.kt new file mode 100644 index 0000000..cf0c391 --- /dev/null +++ b/app/src/main/java/com/demotest/app/network/ApiService.kt @@ -0,0 +1,12 @@ +package com.demotest.app.network + +import com.demotest.app.model.ExchangeTestRequest +import com.demotest.app.model.ExchangeTestResponse +import retrofit2.Response +import retrofit2.http.* + +interface ApiService { + + @POST("API Name") + suspend fun testConnection(@Body request: ExchangeTestRequest): Response +} diff --git a/app/src/main/java/com/demotest/app/network/BaseDataSource.kt b/app/src/main/java/com/demotest/app/network/BaseDataSource.kt new file mode 100644 index 0000000..4bb160c --- /dev/null +++ b/app/src/main/java/com/demotest/app/network/BaseDataSource.kt @@ -0,0 +1,31 @@ +package com.demotest.app.network + +import android.util.Log.e +import com.demotest.app.app.network.Resource +import com.demotest.app.model.ErrorResponse +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken +import org.koin.core.logger.KOIN_TAG +import retrofit2.Response + +abstract class BaseDataSource { + protected suspend fun getResult(call: suspend () -> Response): Resource { + try { + val response = call() + val body = response.body() + if (response.isSuccessful) { + if (body != null) return Resource.success(body) + } else { + val gson = Gson() + val type = object : TypeToken() {}.type + val errorResponse: ErrorResponse? = + gson.fromJson(response.errorBody()!!.charStream(), type) + return Resource.error(errorResponse?.message, body, response.code()) + } + } catch (e: Exception) { + e(KOIN_TAG, e.message, e) + return Resource.error(e.message ?: e.toString(), null, 429) + } + return Resource.error(null, null, 429) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/network/Resource.kt b/app/src/main/java/com/demotest/app/network/Resource.kt new file mode 100644 index 0000000..30620e8 --- /dev/null +++ b/app/src/main/java/com/demotest/app/network/Resource.kt @@ -0,0 +1,29 @@ +package com.demotest.app.app.network + +data class Resource( + val status: Status, val data: T?, val message: String?, + val code: Int? +) { + + companion object { + + fun success(data: T?): Resource { + return Resource(Status.SUCCESS, data, null, null) + } + + fun error(msg: String?, data: T?, code: Int?): Resource { + return Resource(Status.ERROR, data, msg, code) + } + + fun loading(data: T?): Resource { + return Resource(Status.LOADING, data, null, null) + } + + } +} + +enum class Status { + SUCCESS, + ERROR, + LOADING +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/network/RetrofitApiClient.kt b/app/src/main/java/com/demotest/app/network/RetrofitApiClient.kt new file mode 100644 index 0000000..8ae35b4 --- /dev/null +++ b/app/src/main/java/com/demotest/app/network/RetrofitApiClient.kt @@ -0,0 +1,48 @@ +package com.demotest.app.network + +import com.demotest.app.BuildConfig +import com.demotest.app.data.local.AppPreferences +import com.demotest.app.extensions.Constants +import com.demotest.app.network.ApiService +import okhttp3.Interceptor +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.logging.HttpLoggingInterceptor +import org.koin.dsl.module +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory +import java.util.concurrent.TimeUnit + +val networkModule = module { + single { provideRetrofit(get()) } + factory { provideApi(get()) } +} + +fun provideRetrofit(pref: AppPreferences): Retrofit { + val interceptor = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY) + + val okHttpClient = OkHttpClient().newBuilder() + .callTimeout(1, TimeUnit.MINUTES) + .writeTimeout(1, TimeUnit.MINUTES) + .readTimeout(1, TimeUnit.MINUTES) + .addInterceptor(interceptor) + .addInterceptor(Interceptor { chain -> + val request: Request = + chain.request().newBuilder() + .addHeader("Content-Type", Constants.CONTENT_TYPE) + .addHeader("Authorization", "") + .build() + val response = chain.proceed(request) + if (response.code == 401) Constants.isAuthorized.postValue(false) + response + }).build() + + return Retrofit.Builder().baseUrl(BuildConfig.BASE_URL) + .client(okHttpClient) + .addConverterFactory(GsonConverterFactory.create()) + .build() + + +} + +fun provideApi(retrofit: Retrofit): ApiService = retrofit.create(ApiService::class.java) diff --git a/app/src/main/java/com/demotest/app/repositories/APIRepository.kt b/app/src/main/java/com/demotest/app/repositories/APIRepository.kt new file mode 100644 index 0000000..62f9cf0 --- /dev/null +++ b/app/src/main/java/com/demotest/app/repositories/APIRepository.kt @@ -0,0 +1,24 @@ +package com.demotest.app.repositories + +import androidx.lifecycle.LiveData +import androidx.lifecycle.liveData +import com.demotest.app.app.network.Resource +import com.demotest.app.data.remote.RemoteDataSource + +import com.demotest.app.model.ExchangeTestRequest +import com.demotest.app.model.ExchangeTestResponse +import kotlinx.coroutines.Dispatchers + +class APIRepository( + private val remoteDataSource: RemoteDataSource, +) { + + + fun testConnection(request: ExchangeTestRequest): LiveData> = + liveData(Dispatchers.IO) { + emit(Resource.loading(null)) + val response = remoteDataSource.testConnection(request) + emit(response) + } + +} diff --git a/app/src/main/java/com/demotest/app/ui/AppStartFragment.kt b/app/src/main/java/com/demotest/app/ui/AppStartFragment.kt new file mode 100644 index 0000000..cf5a321 --- /dev/null +++ b/app/src/main/java/com/demotest/app/ui/AppStartFragment.kt @@ -0,0 +1,20 @@ +package com.demotest.app.ui + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import com.demotest.app.R +import com.demotest.app.databinding.FragmentAppStartBinding +import com.demotest.app.extensions.viewBinding + +class AppStartFragment : Fragment(R.layout.fragment_app_start) { + + private val binding by viewBinding(FragmentAppStartBinding::bind) +// private val pref by inject() + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/ui/HomeFragment.kt b/app/src/main/java/com/demotest/app/ui/HomeFragment.kt new file mode 100644 index 0000000..069bd63 --- /dev/null +++ b/app/src/main/java/com/demotest/app/ui/HomeFragment.kt @@ -0,0 +1,20 @@ +package com.demotest.app.ui + + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import com.demotest.app.R +import com.demotest.app.databinding.FragmentHomeBinding +import com.demotest.app.extensions.viewBinding + +class HomeFragment : Fragment(R.layout.fragment_home){ + + private val binding by viewBinding(FragmentHomeBinding::bind) + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/demotest/app/viewmodels/UserViewModel.kt b/app/src/main/java/com/demotest/app/viewmodels/UserViewModel.kt new file mode 100644 index 0000000..2e51766 --- /dev/null +++ b/app/src/main/java/com/demotest/app/viewmodels/UserViewModel.kt @@ -0,0 +1,11 @@ +package com.demotest.app.app.viewmodels + +import androidx.lifecycle.ViewModel +import com.demotest.app.repositories.APIRepository + +class UserViewModel( + private val repository: APIRepository +) : ViewModel() { + + +} diff --git a/app/src/main/res/.DS_Store b/app/src/main/res/.DS_Store new file mode 100644 index 0000000..12e01e3 Binary files /dev/null and b/app/src/main/res/.DS_Store differ diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..a1710a3 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_app_start.xml b/app/src/main/res/layout/fragment_app_start.xml new file mode 100644 index 0000000..7b7237c --- /dev/null +++ b/app/src/main/res/layout/fragment_app_start.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..b0e756a --- /dev/null +++ b/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/.DS_Store b/app/src/main/res/mipmap-xxxhdpi/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/.DS_Store differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml new file mode 100644 index 0000000..7d8af6b --- /dev/null +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -0,0 +1,24 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..b8e771d --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,63 @@ + + + + + + + + + diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..5aa4e14 --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..942f868 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,110 @@ + + #0075b2 + #3538CD + #FFFFFF + #CDE5FF + #001D32 + #30374F + #FFFFFF + #D4E4F6 + #0D1D2A + #3C57B7 + #FFFFFF + #DCE1FF + #001551 + #BA1A1A + #FFDAD6 + #FFFFFF + #410002 + #F9F9FB + #1A1C1E + #FCFCFF + #1A1C1E + #DEE3EB + #42474E + #DDDFEA + #F0F0F4 + #2F3033 + #93CCFF + #000000 + #006398 + #C2C7CE + #000000 + #155EEF + #003351 + #004B74 + #CDE5FF + #B8C8DA + #23323F + #394857 + #D4E4F6 + #B7C4FF + #002681 + #203E9E + #DCE1FF + #FFB4AB + #93000A + #690005 + #FFDAD6 + #1A1C1E + #E2E2E5 + #1A1C1E + #E2E2E5 + #42474E + #C2C7CE + #DDDFEA + #1A1C1E + #E2E2E5 + #006398 + #000000 + #93CCFF + #42474E + #000000 + #000000 + #FFFFFF + #4284FF + #0062AE + #a8aab7 + #dddddd + #000A9B + #f5f5f5 + #1F2470 + #D0D5DD + #0612C1 + #050841 + #FBBC05 + #F8A629 + #F9F9FB + #232437 + #505050 + #e3e3e3 + #F0F0F5 + #040404 + #0F0F0F + #B4B4B4 + #030B84 + #A7AADE + #9F1AB1 + #D6BBFB + + #008F00 + #6F1877 + #BA24D5 + #821890 + #F8F9FC + #5D6B98 + #B9C0D4 + #FBE8FF + #071733 + #667085 + #4A5578 + #EFF1F5 + #DCDFEA + #111322 + #404968 + #DCDFEA + #475467 + #D92D20 + #344054 + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..3de1a39 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + My Application + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..b8e771d --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,63 @@ + + + + + + + + + diff --git a/app/src/main/res/xml/.DS_Store b/app/src/main/res/xml/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/app/src/main/res/xml/.DS_Store differ diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..ddd3338 --- /dev/null +++ b/build.gradle @@ -0,0 +1,20 @@ +buildscript { + ext { + kotlin_version = '1.8.10' + } + dependencies { + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3" + classpath 'com.android.tools.build:gradle:3.4.0' + classpath 'com.google.gms:google-services:4.3.15' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } + repositories { + mavenCentral() + } +} +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '7.3.1' apply false + id 'com.android.library' version '7.3.1' apply false + id 'org.jetbrains.kotlin.android' version '1.7.20' apply false +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..c22da57 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,24 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true +android.enableJetifier=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ea6d587 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Dec 20 23:08:52 PKT 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/local.properties b/local.properties new file mode 100644 index 0000000..6a53c89 --- /dev/null +++ b/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Mon Dec 05 23:50:29 IST 2022 +sdk.dir=/Users/kapilkumar/Library/Android/sdk diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..0a568c2 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url 'https://jitpack.io' } + } +} +rootProject.name = "DealHuntGo" +include ':app'