Skip to content

Commit

Permalink
Revert "Implemented Biometric Authentication in Compose Multi Platform"
Browse files Browse the repository at this point in the history
This reverts commit fa0d0a2.
  • Loading branch information
therajanmaurya committed Sep 9, 2024
1 parent b685c9f commit 38cdcb0
Show file tree
Hide file tree
Showing 119 changed files with 220 additions and 4,300 deletions.
66 changes: 0 additions & 66 deletions androidApp/build.gradle

This file was deleted.

80 changes: 0 additions & 80 deletions androidApp/src/main/java/com/mifos/passcode/MainActivity.kt

This file was deleted.

6 changes: 0 additions & 6 deletions androidApp/src/main/res/values/strings.xml

This file was deleted.

File renamed without changes.
81 changes: 81 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'com.google.dagger.hilt.android'

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
signingConfigs {
release {
storeFile file("../default_key_store.jks")
storePassword "mifos1234"
keyAlias "mifos-passcode"
keyPassword "mifos1234"
}
}
compileSdk 34
defaultConfig {
namespace "com.mifos.passcode"
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.2"
}
kotlinOptions {
jvmTarget = '17'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.6.0-alpha04'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.0-alpha01'
implementation project(':mifos-passcode')
//implementation 'com.mifos.mobile:mifos-passcode:1.0.0'
implementation "androidx.core:core-ktx:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation(project(":compose"))

implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'


// Hilt Implementation
implementation 'com.google.dagger:hilt-android:2.48.1'
ksp("com.google.dagger:hilt-compiler:2.48.1")
}
repositories {
mavenCentral()
}

configurations.implementation {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:name=".MifosApplication"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity"
<activity android:name=".PassCodeActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/com/mifos/passcode/BaseActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.mifos.passcode

import com.mifos.mobile.passcode.BasePassCodeActivity

/**
* Created by dilpreet on 19/01/18.
*/
class BaseActivity : BasePassCodeActivity() {
override val passCodeClass: Class<*>
get() =//name of the activity which extends MifosPassCodeActivity
PassCodeActivity::class.java
}
18 changes: 18 additions & 0 deletions app/src/main/java/com/mifos/passcode/MifosApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.mifos.passcode

import android.app.Application
import com.mifos.mobile.passcode.utils.ForegroundChecker.Companion.init
import dagger.hilt.android.HiltAndroidApp

/**
* Created by dilpreet on 19/01/18.
*/

@HiltAndroidApp
class MifosApplication : Application() {
override fun onCreate() {
super.onCreate()
//need to initialize this
init(this)
}
}
57 changes: 57 additions & 0 deletions app/src/main/java/com/mifos/passcode/PassCodeActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.mifos.passcode

import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import com.mifos.compose.PasscodeRepository
import com.mifos.compose.component.PasscodeScreen
import com.mifos.compose.theme.MifosPasscodeTheme
import com.mifos.compose.utility.PreferenceManager
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

/**
* Created by dilpreet on 19/01/18.
*/
@AndroidEntryPoint
class PassCodeActivity : AppCompatActivity() {

@Inject
lateinit var passcodeRepository: PasscodeRepository

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MifosPasscodeTheme {
PasscodeScreen(
onForgotButton = { onPasscodeForgot() },
onSkipButton = { onPasscodeSkip() },
onPasscodeConfirm = { onPassCodeReceive(it) },
onPasscodeRejected = { onPasscodeReject() }
)
}
}
}

private fun onPassCodeReceive(passcode: String) {
if (passcodeRepository.getSavedPasscode() == passcode) {
startActivity(Intent(this, LoginActivity::class.java))
Toast.makeText(this, "New Screen", Toast.LENGTH_SHORT).show()
finish()
}
}

private fun onPasscodeReject() {}

private fun onPasscodeForgot() {
// Add logic to redirect user to login page
Toast.makeText(this, "Forgot Passcode", Toast.LENGTH_SHORT).show()
}

private fun onPasscodeSkip() {
Toast.makeText(this, "Skip Button", Toast.LENGTH_SHORT).show()
finish()
}
}
File renamed without changes
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">mobile_passcode</string>
<string name="fingerprint_dialog_title">Login</string>
</resources>
File renamed without changes.
23 changes: 8 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.7.20'

Expand All @@ -8,27 +10,18 @@ buildscript {
}

dependencies {
classpath libs.gradle
classpath libs.gradle.bintray.plugin
classpath libs.android.maven.gradle.plugin
classpath 'com.android.tools.build:gradle:8.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
//trick: for the same plugin versions in all sub-modules
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinAndroid).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.kotlinCocoapods).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
alias(libs.plugins.dagger.hilt).apply(false)
alias(libs.plugins.devToolsKsp).apply(false)
id 'com.google.dagger.hilt.android' version '2.48.1' apply false
id "com.google.devtools.ksp" version "1.9.0-1.0.12"
}

allprojects {
repositories {
google()
Expand All @@ -40,4 +33,4 @@ allprojects {

tasks.register('clean', Delete) {
delete rootProject.buildDir
}
}
Loading

0 comments on commit 38cdcb0

Please sign in to comment.