diff --git a/app/src/main/java/org/intune/IntuneAuthManager.kt b/app/src/main/java/org/intune/IntuneAuthManager.kt index d5a61b80..cb63223e 100644 --- a/app/src/main/java/org/intune/IntuneAuthManager.kt +++ b/app/src/main/java/org/intune/IntuneAuthManager.kt @@ -4,7 +4,7 @@ import android.app.Activity import android.app.AlertDialog import com.tm.authenticatorsdk.mamsdk.MDMAuthenticator import com.tm.authenticatorsdk.selfAuthenticator.IAuthenticationStatus -import com.tm.logger.Log +import org.signal.core.util.logging.Log import org.tm.archive.R import kotlin.system.exitProcess diff --git a/app/src/main/java/org/selfAuthentication/SelfAuthenticatorManager.kt b/app/src/main/java/org/selfAuthentication/SelfAuthenticatorManager.kt index 40cf6794..f9d0fcd7 100644 --- a/app/src/main/java/org/selfAuthentication/SelfAuthenticatorManager.kt +++ b/app/src/main/java/org/selfAuthentication/SelfAuthenticatorManager.kt @@ -64,7 +64,7 @@ object SelfAuthenticatorManager { mAuthenticationProgressAlertDialogBuilder!!.setCancelable(isCanCancel) mAuthenticationProgressAlertDialog = mAuthenticationProgressAlertDialogBuilder!!.create() if (!mAuthenticationProgressAlertDialog!!.isShowing) { - Log.d("SelfAuthenticatorManager","startAuthenticationProcess -> mAuthenticationProgressAlertDialog show") + Log.d("SelfAuthenticatorManager","createAndShowAuthProgressDialog -> mAuthenticationProgressAlertDialog show") mAuthenticationProgressAlertDialog!!.show() } } diff --git a/app/src/main/java/org/tm/archive/components/settings/app/AppSettingsFragment.kt b/app/src/main/java/org/tm/archive/components/settings/app/AppSettingsFragment.kt index c6fca7c6..eb8de4d5 100644 --- a/app/src/main/java/org/tm/archive/components/settings/app/AppSettingsFragment.kt +++ b/app/src/main/java/org/tm/archive/components/settings/app/AppSettingsFragment.kt @@ -17,6 +17,7 @@ import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import org.selfAuthentication.ProgressDialog +import org.signal.core.util.logging.Log import org.tm.archive.R import org.tm.archive.badges.BadgeImageView import org.tm.archive.components.AvatarImageView @@ -324,12 +325,12 @@ class AppSettingsFragment : DSLSettingsFragment( override fun sendLogSucceed() { mProgressDialog.hide() - com.tm.logger.Log.d("sendLog", "sendLogSucceed") + Log.d("sendLog", "sendLogSucceed") } override fun sendLogFailure() { mProgressDialog.hide() - com.tm.logger.Log.d("sendLog", "sendLogFailure") + Log.d("sendLog", "sendLogFailure") } diff --git a/app/src/main/java/org/tm/archive/conversationlist/ConversationListFragment.java b/app/src/main/java/org/tm/archive/conversationlist/ConversationListFragment.java index 236dce1d..5d5a4477 100644 --- a/app/src/main/java/org/tm/archive/conversationlist/ConversationListFragment.java +++ b/app/src/main/java/org/tm/archive/conversationlist/ConversationListFragment.java @@ -279,6 +279,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); + Log.d("ConversationListFragment", "onCreate"); setHasOptionsMenu(true); startupStopwatch = new Stopwatch("startup"); @@ -465,10 +466,10 @@ public class ConversationListFragment extends MainFragment implements ActionMode if (CommonUtils.isActivatedUser(requireContext())) { WorkerIntentService.startJobIntentService(requireContext(), true);/*TM_SA*/ } else { - com.tm.logger.Log.d("ConversationListFragment", "BuildConfig.APPLICATION_ID: " + BuildConfig.APPLICATION_ID); + Log.d("ConversationListFragment", "BuildConfig.APPLICATION_ID: " + BuildConfig.APPLICATION_ID); int authStatus = PrefManager.getIntPref(requireContext(), IntuneAuthManager.MDM_Auth_Status_String, IntuneAuthManager.MdmAuthStatus.START_SELF_AUTH.ordinal()); - com.tm.logger.Log.d("ConversationListFragment", + Log.d("ConversationListFragment", "onCreate -> authStatus = " + authStatus + ". (0-signed, 1 -should intune auth, 2-self auth)"); if(MDMAuthenticator.INSTANCE.isMDM(requireContext()) && authStatus == IntuneAuthManager.MdmAuthStatus.START_INTUNE_AUTH.ordinal()) { //if intune managed device, start MDM auth startIntuneAuth(); @@ -480,7 +481,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode } private void startIntuneAuth() { - com.tm.logger.Log.d("ConversationListFragment", "startIntuneAuth"); + Log.d("ConversationListFragment", "startIntuneAuth"); startMdm(); } @@ -518,7 +519,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode @Override public void onResume() { super.onResume(); - + Log.d("ConversationListFragment", "onResume"); initializeSearchListener(); updateReminders(); //**TM_SA**//Start. probably should delete from on create @@ -594,7 +595,6 @@ public class ConversationListFragment extends MainFragment implements ActionMode requireCallback().getSearchAction().setOnClickListener(null); fab.stopPulse(); cameraFab.stopPulse(); - EventBus.getDefault().unregister(this); } @Override @@ -603,6 +603,14 @@ public class ConversationListFragment extends MainFragment implements ActionMode ApplicationDependencies.getAppForegroundObserver().removeListener(appForegroundObserver); } + @Override public void onDestroy() { + super.onDestroy(); + Log.d("ConversationListFragment", "onDestroy"); + if (EventBus.getDefault().isRegistered(this)) { + EventBus.getDefault().unregister(this); + } + } + @Override public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { menu.clear(); @@ -1908,13 +1916,14 @@ public class ConversationListFragment extends MainFragment implements ActionMode if (event == null) { return; } - com.tm.logger.Log.d("ConversationListFragment", "UpdateEvent -> onEvent: " + event.type); + Log.d("ConversationListFragment", "UpdateEvent -> onEvent: " + event.type); if (event.type == UpdateEvent.EVENTS_TYPE.authProcess) { CommonUtils.setActivatedUser(requireContext(), false); - SelfAuthenticatorManager.INSTANCE. + startSelfAuth(); + /*SelfAuthenticatorManager.INSTANCE. startAuthenticationProcess(requireContext(), ArchiveUtil.getPhoneNumberInTestMode(requireContext()), - this); + this);*/ } if (event.type == UpdateEvent.EVENTS_TYPE.suspension) { CommonUtils.setActivatedUser(requireContext(),false); @@ -1927,8 +1936,8 @@ public class ConversationListFragment extends MainFragment implements ActionMode SelfAuthenticatorManager.INSTANCE.hideDialogAndShowSuspendDialog( SelfAuthenticatorManager.SuspendUIAction.SHOULD_HIDE_PROGRESS_DIALOG); WorkerIntentService.startJobIntentService(requireContext()); -// com.tm.logger.Log.d("ConversationListFragment", "SelfAuthenticator -> initOfficialSignalFirebaseAccount!!! "); -// FCMConnector.initOfficialSignalFirebaseAccount(requireContext()); + Log.d("ConversationListFragment", "SelfAuthenticator -> initOfficialSignalFirebaseAccount!!! "); + FCMConnector.initOfficialSignalFirebaseAccount(requireContext()); } @@ -1936,7 +1945,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode @Override public void authenticationProcessMessage(@NotNull String message) { - com.tm.logger.Log.d("ConversationListFragment", "SelfAuthenticatorProcess -> authenticationProcessMessage = " + message); + Log.d("ConversationListFragment", "SelfAuthenticatorProcess -> authenticationProcessMessage = " + message); if (!message.isEmpty()) { // EventBus.getDefault().post(new MessageEvent(SelfAuthenticatorConstants.Companion.getSelfAuthenticationFailed())); EventBus.getDefault().post(new UpdateEvent(UpdateEvent.EVENTS_TYPE.suspension)); @@ -2005,7 +2014,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode @Override public void failureMDMAuth(String reason) { final String onCancel = "onCancel"; - com.tm.logger.Log.d("ConversationListFragment", "failureMDMAuth, reason: " + reason); + Log.d("ConversationListFragment", "failureMDMAuth, reason: " + reason); //MDMAuthenticator.INSTANCE.signOutUser(requireActivity()); if(reason.equals(onCancel)) { IntuneAuthManager.INSTANCE.showDialog(requireActivity(), this::startMdm); @@ -2013,10 +2022,10 @@ public class ConversationListFragment extends MainFragment implements ActionMode }else if(reason.contains("server") || reason.contains("Authentication failed") /*|| reason.contains("managerID")*/) { //try intune auth again PrefManager.setIntPref(requireContext(),IntuneAuthManager.MDM_Auth_Status_String,IntuneAuthManager.MdmAuthStatus.START_INTUNE_AUTH.ordinal()); - com.tm.logger.Log.d("ConversationListFragment", "status auth is 1"); + Log.d("ConversationListFragment", "status auth is 1"); }else { //this case should pass to self-auth PrefManager.setIntPref(requireContext(),IntuneAuthManager.MDM_Auth_Status_String,IntuneAuthManager.MdmAuthStatus.START_SELF_AUTH.ordinal()); - com.tm.logger.Log.d("ConversationListFragment", "status auth is 2"); + Log.d("ConversationListFragment", "status auth is 2"); startSelfAuth(); } @@ -2024,7 +2033,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode @Override public void successMDMAuth() { - com.tm.logger.Log.d("ConversationListFragment", "successMDMAuth"); + Log.d("ConversationListFragment", "successMDMAuth"); String e164number = PrefManager.getStringPref(requireContext(), ArchivePreferenceConstants.PREF_KEY_DEVICE_PHONE_NUMBER); startIntuneAutoAuthentication(e164number); @@ -2035,7 +2044,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode * @param e164number */ private void startIntuneAutoAuthentication(String e164number) { - com.tm.logger.Log.d(TAG, "startAutoAuthentication"); + Log.d(TAG, "startAutoAuthentication"); SelfAuthenticatorManager.INSTANCE.initAuthenticator(e164number); IntuneAuthManager.INSTANCE.continueIntuneAuthentication(this); } diff --git a/app/src/main/java/org/tm/archive/jobs/FcmRefreshJob.java b/app/src/main/java/org/tm/archive/jobs/FcmRefreshJob.java index 85bc71dc..2495d462 100644 --- a/app/src/main/java/org/tm/archive/jobs/FcmRefreshJob.java +++ b/app/src/main/java/org/tm/archive/jobs/FcmRefreshJob.java @@ -103,7 +103,7 @@ public class FcmRefreshJob extends BaseJob { ApplicationDependencies.getSignalServiceAccountManager().setGcmId(token); SignalStore.account().setFcmToken(token.get()); - com.tm.logger.Log.i(TAG, "current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId());//**TM_SA TODO remove this ASAP!**// + Log.i(TAG, "current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId());//**TM_SA TODO remove this ASAP!**// } else { throw new RetryLaterException(new IOException("Failed to retrieve a token.")); } diff --git a/app/src/main/java/org/tm/archive/notifications/v2/DefaultMessageNotifier.kt b/app/src/main/java/org/tm/archive/notifications/v2/DefaultMessageNotifier.kt index 822f2eb0..cbce6f92 100644 --- a/app/src/main/java/org/tm/archive/notifications/v2/DefaultMessageNotifier.kt +++ b/app/src/main/java/org/tm/archive/notifications/v2/DefaultMessageNotifier.kt @@ -115,7 +115,7 @@ class DefaultMessageNotifier(context: Application) : MessageNotifier { } else { //**TM_SA**//Start /*val isAlreadyDoneSelfAuthentication = PrefManager.getBooleanPref(context, "isAlreadyDoneSelfAuthentication", false) - com.tm.logger.Log.d("SelfAuthenticatorProcess", "onCreate = isAlreadyDoneSelfAuthentication = $isAlreadyDoneSelfAuthentication")*/ + .Log.d("SelfAuthenticatorProcess", "onCreate = isAlreadyDoneSelfAuthentication = $isAlreadyDoneSelfAuthentication")*/ if(!CommonUtils.isActivatedUser(context)){ return diff --git a/app/src/main/java/org/tm/archive/notifications/v2/NotificationBuilder.kt b/app/src/main/java/org/tm/archive/notifications/v2/NotificationBuilder.kt index cc61a40e..5b28e9d7 100644 --- a/app/src/main/java/org/tm/archive/notifications/v2/NotificationBuilder.kt +++ b/app/src/main/java/org/tm/archive/notifications/v2/NotificationBuilder.kt @@ -16,8 +16,8 @@ import androidx.core.app.RemoteInput import androidx.core.content.LocusIdCompat import androidx.core.graphics.drawable.IconCompat import com.tm.androidcopysdk.CommonUtils -import com.tm.logger.Log import org.signal.core.util.PendingIntentFlags.mutable +import org.signal.core.util.logging.Log import org.tm.archive.R import org.tm.archive.conversation.ConversationIntents import org.tm.archive.database.RecipientTable diff --git a/app/src/main/java/org/tm/archive/registration/RegistrationRepository.java b/app/src/main/java/org/tm/archive/registration/RegistrationRepository.java index 2ef9db32..da20af36 100644 --- a/app/src/main/java/org/tm/archive/registration/RegistrationRepository.java +++ b/app/src/main/java/org/tm/archive/registration/RegistrationRepository.java @@ -159,7 +159,7 @@ public final class RegistrationRepository { ApplicationDependencies.getRecipientCache().clearSelf(); SignalStore.account().setE164(registrationData.getE164()); - com.tm.logger.Log.i("RegistrationRepository","registerAccountInternal -> fcmToken: "+registrationData.getFcmToken());//**TM_SA TODO remove ASAP!**// + Log.i("RegistrationRepository","registerAccountInternal -> fcmToken: "+registrationData.getFcmToken());//**TM_SA TODO remove ASAP!**// SignalStore.account().setFcmToken(registrationData.getFcmToken()); SignalStore.account().setFcmEnabled(registrationData.isFcm()); diff --git a/app/src/main/java/org/tm/archive/registration/VerifyAccountRepository.kt b/app/src/main/java/org/tm/archive/registration/VerifyAccountRepository.kt index 5663df6b..9c5596ea 100644 --- a/app/src/main/java/org/tm/archive/registration/VerifyAccountRepository.kt +++ b/app/src/main/java/org/tm/archive/registration/VerifyAccountRepository.kt @@ -61,7 +61,7 @@ class VerifyAccountRepository(private val context: Application) { if (fcmToken == null) { return@fromCallable accountManager.createRegistrationSession(null, mcc, mnc) } else { - com.tm.logger.Log.d("VerifyAccountRepository", "requestValidSession -> fcmToken $fcmToken")//**TM_SA**// + Log.d("VerifyAccountRepository", "requestValidSession -> fcmToken $fcmToken")//**TM_SA**// return@fromCallable createSessionAndBlockForPushChallenge(accountManager, fcmToken, mcc, mnc) } } @@ -73,7 +73,7 @@ class VerifyAccountRepository(private val context: Application) { val eventBus = EventBus.getDefault() eventBus.register(subscriber) - com.tm.logger.Log.d("VerifyAccountRepository", + Log.d("VerifyAccountRepository", "createSessionAndBlockForPushChallenge -> fcmToken: $fcmToken" )//**TM_SA**// val response: ServiceResponse = accountManager.createRegistrationSession(fcmToken, mcc, mnc) diff --git a/app/src/main/java/org/tm/archive/registration/fragments/EnterPhoneNumberFragment.java b/app/src/main/java/org/tm/archive/registration/fragments/EnterPhoneNumberFragment.java index b792fff6..eb02f825 100644 --- a/app/src/main/java/org/tm/archive/registration/fragments/EnterPhoneNumberFragment.java +++ b/app/src/main/java/org/tm/archive/registration/fragments/EnterPhoneNumberFragment.java @@ -219,7 +219,7 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R public void run() { progressBarCustomView.setVisibility(View.GONE); progressBarShown = false; - com.tm.logger.Log.d(TAG, "Registration progress hidden"); + Log.d(TAG, "Registration progress hidden"); } }); } @@ -230,7 +230,7 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R public void run() { progressBarCustomView.setVisibility(View.VISIBLE); progressBarShown = true; - com.tm.logger.Log.d(TAG, "Registration progress shown"); + Log.d(TAG, "Registration progress shown"); } }); } @@ -340,14 +340,14 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R @Override public void failureMDMAuth(String reason) { final String onCancel = "onCancel", server = "server"; - com.tm.logger.Log.d(TAG, "failureMDMAuth, reason: " + reason); + Log.d(TAG, "failureMDMAuth, reason: " + reason); if(reason.equals(onCancel)) { IntuneAuthManager.INSTANCE.showDialog(requireActivity(), this::startMdm); } //update app that intune signed failed: two cases. 1. try intune auth again 2. move to self auth else if(reason.contains(server) || reason.contains("Authentication failed") /*|| reason.contains("managerID")*/) { //try intune auth again PrefManager.setIntPref(requireContext(), IntuneAuthManager.MDM_Auth_Status_String,IntuneAuthManager.MdmAuthStatus.START_INTUNE_AUTH.ordinal()); - com.tm.logger.Log.d(TAG, "status auth is " + IntuneAuthManager.MdmAuthStatus.START_INTUNE_AUTH.ordinal()); + Log.d(TAG, "status auth is " + IntuneAuthManager.MdmAuthStatus.START_INTUNE_AUTH.ordinal()); requireActivity().runOnUiThread(new Runnable() { @Override public void run() { @@ -356,7 +356,7 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R }); }else { //this case should pass to self-auth PrefManager.setIntPref(requireContext(),IntuneAuthManager.MDM_Auth_Status_String,IntuneAuthManager.MdmAuthStatus.START_SELF_AUTH.ordinal()); - com.tm.logger.Log.d(TAG, "status auth is " + IntuneAuthManager.MdmAuthStatus.START_SELF_AUTH.ordinal()); + Log.d(TAG, "status auth is " + IntuneAuthManager.MdmAuthStatus.START_SELF_AUTH.ordinal()); requireActivity().runOnUiThread(new Runnable() { @Override public void run() { @@ -369,7 +369,7 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R @Override public void successMDMAuth() { - com.tm.logger.Log.d(TAG, "successMDMAuth"); + Log.d(TAG, "successMDMAuth"); startIntuneAutoAuthentication(mobileNumber); } @@ -379,15 +379,15 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R * @param e164number */ private void startIntuneAutoAuthentication(String e164number) { - com.tm.logger.Log.d(TAG, "startAutoAuthentication"); + Log.d(TAG, "startAutoAuthentication"); SelfAuthenticatorManager.INSTANCE.initAuthenticator(e164number); IntuneAuthManager.INSTANCE.continueIntuneAuthentication(this); } private void startAutoAuthentication(String e164number) { - com.tm.logger.Log.i(TAG , "startAutoAuthentication"); + Log.i(TAG , "startAutoAuthentication"); FCMConnector.initTeleMessageSignalFirebaseAccount(requireContext(), null, true); - com.tm.logger.Log.i(TAG, "current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); + Log.i(TAG, "current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); SelfAuthenticatorManager.INSTANCE.initAuthenticator(e164number); SelfAuthenticatorManager.INSTANCE.startAuthentication(this); if (!progressBarShown) { @@ -695,11 +695,11 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R //**TM_SA**//START /*@Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(MessageEvent event) { - com.tm.logger.Log.d(TAG,"onMessageEvent -> SelfAuthenticator and Intune authenticator"); + Log.d(TAG,"onMessageEvent -> SelfAuthenticator and Intune authenticator"); if (event.message != null) { - com.tm.logger.Log.d(TAG, "event.message = " + event.message); + Log.d(TAG, "event.message = " + event.message); } else { - com.tm.logger.Log.d(TAG, "event.message = null, return;"); + Log.d(TAG, "event.message = null, return;"); return; } boolean authSucceed = event.message.equals(SelfAuthenticatorConstants.Companion.getSelfAuthenticationSucceed()); @@ -717,10 +717,10 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R PrefManager.setIntPref(requireContext(),IntuneAuthManager.MDM_Auth_Status_String, IntuneAuthManager.MdmAuthStatus.ALREADY_SIGN.ordinal()); //update app that intune signed successfully updatedSelfAuthenticatorDonePreference();//update that signed successfully - com.tm.logger.Log.d(TAG, "status auth is ALREADY_SIGN"); + Log.d(TAG, "status auth is ALREADY_SIGN"); } else { PrefManager.setIntPref(requireContext(),IntuneAuthManager.MDM_Auth_Status_String,IntuneAuthManager.MdmAuthStatus.START_SELF_AUTH.ordinal()); //update app that auth should pass to self auth - com.tm.logger.Log.d(TAG, "status auth is START_SELF_AUTH"); + Log.d(TAG, "status auth is START_SELF_AUTH"); } } else { @@ -728,25 +728,25 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R hideProgressBar(); } - com.tm.logger.Log.d(TAG, "event.message 2 = " + event.message); + Log.d(TAG, "event.message 2 = " + event.message); if (authSucceed) { updatedSelfAuthenticatorDonePreference(); - com.tm.logger.Log.d(TAG, "SelfAuthenticationSucceed "); + Log.d(TAG, "SelfAuthenticationSucceed "); } else { //I Removed this because we just show that after 48 hours. //SelfAuthenticatorManager.INSTANCE.showTheRelevantDialogIfNeeded((FragmentActivity)mContext); - com.tm.logger.Log.d(TAG, "getSelfAuthenticationFailure = " + event.message); + Log.d(TAG, "getSelfAuthenticationFailure = " + event.message); } } final NumberViewState number = viewModel.getNumber(); final String e164number = number.getE164Number(); confirmNumberPrompt(mContext, e164number, () -> handleRequestVerification(mContext, true)); - com.tm.logger.Log.i(TAG, "onMessageEvent -> 1 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); - com.tm.logger.Log.d("SelfAuthenticator", "initOfficialSignalFirebaseAccount!!! "); + Log.i(TAG, "onMessageEvent -> 1 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); + Log.d("SelfAuthenticator", "initOfficialSignalFirebaseAccount!!! "); FCMConnector.initOfficialSignalFirebaseAccount(mContext); - com.tm.logger.Log.i(TAG, "onMessageEvent -> 2 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); + Log.i(TAG, "onMessageEvent -> 2 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); } }*/ @@ -755,7 +755,7 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R if (event == null) { return; } - com.tm.logger.Log.d("EnterPhoneNumberFragment", "UpdateEvent -> onEvent: " + event.type); + Log.d("EnterPhoneNumberFragment", "UpdateEvent -> onEvent: " + event.type); if (event.type == UpdateEvent.EVENTS_TYPE.activated) { CommonUtils.setActivatedUser(requireContext(), true); @@ -769,10 +769,10 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R dialog.doSendLogsClicked(requireActivity(), progressBarCustomView); } - com.tm.logger.Log.i(TAG, "onMessageEvent -> 1 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); - com.tm.logger.Log.d("SelfAuthenticator", "initOfficialSignalFirebaseAccount!!! "); + Log.i(TAG, "onMessageEvent -> 1 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); + Log.d("SelfAuthenticator", "initOfficialSignalFirebaseAccount!!! "); FCMConnector.initOfficialSignalFirebaseAccount(mContext); - com.tm.logger.Log.i(TAG, "onMessageEvent -> 2 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); + Log.i(TAG, "onMessageEvent -> 2 current FCM: " + FirebaseApp.getInstance().getOptions().getProjectId()); if (progressBarShown) { hideProgressBar(); @@ -782,7 +782,7 @@ public final class EnterPhoneNumberFragment extends LoggingFragment implements R @Override public void authenticationProcessMessage(@NotNull String message) { - com.tm.logger.Log.d(TAG, "authenticationProcessMessage = " + message); + Log.d(TAG, "authenticationProcessMessage = " + message); if (!message.isEmpty()) { mIsLoginAuthenticationInProgress = false; // EventBus.getDefault().post(new MessageEvent(SelfAuthenticatorConstants.Companion.getSelfAuthenticationFailed())); diff --git a/app/src/tm/java/org/archiver/FCMConnector.kt b/app/src/tm/java/org/archiver/FCMConnector.kt index 1e4cde2a..ffd866dd 100644 --- a/app/src/tm/java/org/archiver/FCMConnector.kt +++ b/app/src/tm/java/org/archiver/FCMConnector.kt @@ -6,12 +6,12 @@ import com.google.firebase.FirebaseOptions import com.tm.androidcopysdk.AndroidCopySDK import com.tm.androidcopysdk.CommonUtils import com.tm.androidcopysdk.utils.PrefManager -import com.tm.logger.Log import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.archiver.ArchiveUtil.Companion.fetchFCMToken import org.archiver.ArchiveUtil.Companion.getFCMTokenIfExists +import org.signal.core.util.logging.Log import org.tm.archive.dependencies.ApplicationDependencies import org.tm.archive.gcm.FcmUtil import org.tm.archive.jobs.FcmRefreshJob diff --git a/app/src/tm/java/org/archiver/device/CallManagerRecordingDelegate.kt b/app/src/tm/java/org/archiver/device/CallManagerRecordingDelegate.kt index 531bea1a..5f28fcd6 100644 --- a/app/src/tm/java/org/archiver/device/CallManagerRecordingDelegate.kt +++ b/app/src/tm/java/org/archiver/device/CallManagerRecordingDelegate.kt @@ -1,8 +1,8 @@ package org.archiver.device import android.content.Context -import com.tm.logger.Log import org.archiver.model.Messages.stringify +import org.signal.core.util.logging.Log import org.signal.ringrtc.CallId import org.signal.ringrtc.CallManager import org.signal.ringrtc.GroupCall diff --git a/app/src/tm/java/org/archiver/device/TeleMessageSignalCallManager.kt b/app/src/tm/java/org/archiver/device/TeleMessageSignalCallManager.kt index 28ae56eb..24af6e5d 100644 --- a/app/src/tm/java/org/archiver/device/TeleMessageSignalCallManager.kt +++ b/app/src/tm/java/org/archiver/device/TeleMessageSignalCallManager.kt @@ -2,8 +2,8 @@ package org.archiver.device import android.app.Application import com.tm.androidcopysdk.api.IFiler -import com.tm.logger.Log import org.archiver.data.TeleMessageTable +import org.signal.core.util.logging.Log import org.signal.ringrtc.CallId import org.signal.ringrtc.GroupCall import org.signal.ringrtc.Remote diff --git a/app/src/tm/java/org/archiver/gcm/TeleMessageFcmReceiveService.kt b/app/src/tm/java/org/archiver/gcm/TeleMessageFcmReceiveService.kt index f39545e9..d72788fe 100644 --- a/app/src/tm/java/org/archiver/gcm/TeleMessageFcmReceiveService.kt +++ b/app/src/tm/java/org/archiver/gcm/TeleMessageFcmReceiveService.kt @@ -11,7 +11,6 @@ import com.tm.androidcopysdk.network.appSettings.UpdateEvent import com.tm.androidcopysdk.utils.PrefManager import com.tm.authenticatorsdk.selfAuthenticator.IOnCredentialsArrived import com.tm.authenticatorsdk.selfAuthenticator.SelfAuthenticator.getUserCredentials -import com.tm.logger.Log //import org.archive.selfAuthentication.SelfAuthenticatorConstants.Companion.selfAuthenticationFailed //import org.archive.selfAuthentication.SelfAuthenticatorConstants.Companion.selfAuthenticationSucceed import org.archiver.ArchiveConstants @@ -19,6 +18,7 @@ import org.archiver.ArchivePreferenceConstants import org.archiver.FCMConnector import org.archiver.FCMConnector.Companion.updateSignUpCredentials import org.greenrobot.eventbus.EventBus +import org.signal.core.util.logging.Log import org.signal.core.util.logging.Log.i import org.tm.archive.BuildConfig import org.tm.archive.gcm.FcmReceiveService diff --git a/app/src/tm/java/org/tm/archive/TmMainActivity.kt b/app/src/tm/java/org/tm/archive/TmMainActivity.kt index 0a0c34c4..98da107c 100644 --- a/app/src/tm/java/org/tm/archive/TmMainActivity.kt +++ b/app/src/tm/java/org/tm/archive/TmMainActivity.kt @@ -12,13 +12,13 @@ import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import com.tm.androidcopysdk.network.appSettings.UpdateEvent import com.tm.androidcopysdk.utils.PrefManager -import com.tm.logger.Log import org.archiver.ArchivePreferenceConstants import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import org.selfAuthentication.SelfAuthenticatorManager import org.selfAuthentication.SelfAuthenticatorManager.hideDialogAndShowSuspendDialog +import org.signal.core.util.logging.Log import org.tm.archive.dependencies.ApplicationDependencies import org.tm.archive.util.views.CircularProgressMaterialButton @@ -83,15 +83,18 @@ class TmMainActivity : MainActivity() { } private fun showSuspendDialog() { - suspendDialog = Dialog(this, android.R.style.Theme_DeviceDefault_Light_NoActionBar_Fullscreen) // Fullscreen theme - suspendDialog!!.apply { - setContentView(R.layout.fragment_registration_enter_phone_number) - val layout = findViewById(R.id.constraint_layout) - layout.setBackgroundColor(resources.getColor(R.color.white)) - val button = findViewById(R.id.registerButton) - button.visibility = View.GONE - setCancelable(false) - show() + if (suspendDialog == null) { + suspendDialog = Dialog(this, android.R.style.Theme_DeviceDefault_Light_NoActionBar_Fullscreen) // Fullscreen theme + suspendDialog!!.apply { + setContentView(R.layout.fragment_registration_enter_phone_number) + val layout = findViewById(R.id.constraint_layout) + layout.setBackgroundColor(resources.getColor(R.color.white)) + val button = findViewById(R.id.registerButton) + button.visibility = View.GONE + setCancelable(false) + if (!this@TmMainActivity.isFinishing || this@TmMainActivity.isDestroyed) show() + } } } + } \ No newline at end of file