That fuck shit the fascists are using
1package org.selfAuthentication
2
3import android.content.Context
4import com.tm.androidcopysdk.network.TMEnsureIPManager
5
6import com.tm.authenticatorsdk.selfAuthenticator.AuthenticationAppType
7import com.tm.authenticatorsdk.selfAuthenticator.IAuthenticationStatus
8import com.tm.authenticatorsdk.selfAuthenticator.IEnsureIpDataArrived
9import com.tm.authenticatorsdk.selfAuthenticator.SelfAuthenticator
10import com.tm.logger.Log
11import com.tm.utils.ApplicationInterface
12import kotlinx.coroutines.CoroutineScope
13import kotlinx.coroutines.Dispatchers
14import kotlinx.coroutines.launch
15import org.tm.archive.BaseActivity
16import org.tm.archive.BuildConfig
17import org.tm.archive.TeleMessageSignalApplication
18import org.tm.archive.dependencies.ApplicationDependencies
19
20//In order to change the environment base url call to this method:
21//ApiUtil.Companion.selectServerEnvironment(Context)
22//The default environment is charlieProduction = https://rest.telemessage.com
23
24object SelfAuthenticatorManager : IEnsureIpDataArrived {
25
26 init {
27 Log.d("SelfAuthenticatorManager","class SelfAuthenticatorManager started")
28 }
29
30 lateinit var selfAuthenticator: SelfAuthenticator
31
32
33 fun initAuthenticator(phoneNumber: String) {
34 selfAuthenticator = SelfAuthenticator
35 Log.d("SelfAuthenticatorManager", "initAuthenticator - The phone number is: $phoneNumber")
36 selfAuthenticator.initSelfAuthenticator(
37 AuthenticationAppType.SIGNAL,
38 phoneNumber,
39 BuildConfig.VERSION_NAME,
40 this
41 )
42 }
43
44 fun removeLinkedDevices(baseActivity: BaseActivity) {
45 DevicesDisconnector(baseActivity)
46 }
47
48 fun startAuthentication(applicationInterface: ApplicationInterface, aIAuthenticationStatus: IAuthenticationStatus) {
49 selfAuthenticator.startSelfAuthentication(applicationInterface, aIAuthenticationStatus)
50 }
51
52 fun startAuthenticationProcess(context: Context,
53 phone: String?, applicationInterface: ApplicationInterface, aIAuthenticationStatus: IAuthenticationStatus) {
54 Log.d("SelfAuthenticatorManager","startAuthenticationProcess")
55// createAndShowAuthProgressDialog(context, true)
56 CoroutineScope(Dispatchers.IO).launch {
57 initAuthenticator(phone!!)
58 selfAuthenticator.startSelfAuthentication(applicationInterface, aIAuthenticationStatus)
59 }
60 }
61
62 override fun onEnsureIpDataArrived(firstName: String, lastName: String, email: String) {
63 TMEnsureIPManager.saveUserNameData(ApplicationDependencies.getApplication(), firstName, lastName, email)
64 }
65
66
67 /*fun isEndAuthenticationDialog() {
68 if (!mProgressDialogVisibility && mSuspendDialogVisibility) {
69 endAuthDialog()
70 mProgressDialogVisibility = true
71 mSuspendDialogVisibility = false
72 }
73 }
74
75 fun setProgressDialogVisibility(isShown : Boolean){
76 mProgressDialogVisibility = isShown
77 isEndAuthenticationDialog()
78 }
79 fun setSuspendDialogVisibility(isShown : Boolean){
80 mSuspendDialogVisibility = isShown
81 isEndAuthenticationDialog()
82 }*/
83
84
85}