Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Added extra options
Browse files Browse the repository at this point in the history
- Removed apk expire.
- Choose between passphrase protection and the Android screenlock.
- Option to treat view-once media as normal media.
- Option to ignore remote deletion.
- Choose between FCM or websocket notification delivery.
- Option to delete only the media from a message, not the rest of the message.
- Removed forward limit.
- Enabled internal preferences. Use at your own risk.
- Added options to select who can add you to a group.

Script:

COMMIT_ID=c6f74bf5e41ea79e95d332300b8093358eb4d91f
UPSTREAM="upstream/main"

git cherry-pick $COMMIT_ID

reset_list=(
    "README.md"
    "app/build.gradle.kts"
    "app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java"
    "app/src/main/java/org/thoughtcrime/securesms/components/location/SignalMapView.java"
    "app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListFragment.java"
    "app/src/main/java/org/thoughtcrime/securesms/database"
    "app/src/main/java/org/thoughtcrime/securesms/keyvalue/MiscellaneousValues.kt"
    "app/src/main/java/org/thoughtcrime/securesms/maps/PlacePickerActivity.java"
    "app/src/main/java/org/thoughtcrime/securesms/util/BackupUtil.java"
    "app/src/main/java/org/thoughtcrime/securesms/util/StorageUtil.java"
    "app/src/main/java/org/thoughtcrime/securesms/util/Util.java"
    "gradle/verification-metadata.xml"
    "app/src/main/res"
)

remove_list=(
    "app/src/main/java/org/thoughtcrime/securesms/ExitActivity.java"
    "app/src/main/java/org/thoughtcrime/securesms/ImportExportActivity.java"
    "app/src/main/java/org/thoughtcrime/securesms/ImportExportFragment.java"
    "app/src/main/java/org/thoughtcrime/securesms/ImportWhatsappDialog.java"
    "app/src/main/java/org/thoughtcrime/securesms/database/whatsapp"
    "app/src/main/java/org/thoughtcrime/securesms/util/FileUtilsJW.java"
    "app/src/main/java/org/thoughtcrime/securesms/util/UriUtils.java"
)

for i in "${reset_list[@]}"; do
    echo "Resetting $i to state in $UPSTREAM"
    git checkout "$UPSTREAM" -- "$i"
done

for i in "${remove_list[@]}"; do
    echo "Removing $i to state in $UPSTREAM"
    git rm "$i"
done

git checkout HEAD -- "app/src/main/java/org/thoughtcrime/securesms/database/MediaTable.kt"
git checkout HEAD -- "app/src/main/java/org/thoughtcrime/securesms/database/MessageTable.kt"

echo '
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">

    <string-array name="pref_group_add_entries">
        <item>@string/preferences__group_anyone</item>
        <item>@string/preferences__group_non_blocked</item>
        <item>@string/preferences__group_only_contats</item>
        <item>@string/preferences__group_only_systemcontats</item>
        <item>@string/preferences__group_nobody</item>
    </string-array>

    <string-array name="pref_group_add_values" translatable="false">
        <item>anyone</item>
        <item>nonblocked</item>
        <item>onlycontacts</item>
        <item>onlysystemcontacts</item>
        <item>nobody</item>
    </string-array>
</resources>
' > 'app/src/main/res/values/arrays1.xml'

echo '
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- preferences.xml -->
<string name="preferences__group_anyone">Anyone</string>
<string name="preferences__group_non_blocked">All non-blocked persons</string>
<string name="preferences__group_only_contats">Only contacts</string>
<string name="preferences__group_only_systemcontats">Only non-blocked system contacts</string>
<string name="preferences__group_nobody">Nobody</string>
<!-- app protection-->
<string name="preferences_app_protection__method_passphrase">Use a passphrase</string>
<string name="preferences_app_protection__method_passphrase_summary">Use a passphrase to protect Signal instead of the Android screen lock or fingerprint</string>
<string name="preferences_app_protection__screenlock_requires_lollipop">Using the system screenlock requires Android 5.0 (Lollipop) or higher.</string>
<string name="preferences_app_protection__android_version_too_low">Android version too low</string>
<!-- FCM switch -->
<string name="preferences_advanced__push_notifications_fcm">Push Notifications via FCM</string>
<string name="preferences_advanced__push_notifications_fcm_summary">Receive push notifications via Google Play Services. When switched off a websocket will be used, which might cause more battery usage</string>
<string name="preferences_advanced__play_services_not_found">Google Play Services not found</string>
<string name="preferences_advanced__need_to_restart">Signal needs to restart for the changes to take effect</string>
<string name="ImportFragment_restore_ok">OK</string>
<!-- Keep messages -->
<string name="preferences_chats__control_message_deletion">Control message deletion</string>
<string name="preferences_chats__chat_keep_view_once_messages">Keep view-once media</string>
<string name="preferences_chats__keep_view_once_messages_summary">When checked incoming view-once media will be treated as normal view-always media and will not be deleted after view</string>
<string name="preferences_chats__chat_ignore_remote_delete">Ignore remote delete</string>
<string name="preferences_chats__chat_ignore_remote_delete_summary">When checked, this option prevents the remote deletion of messages by the sender</string>
<string name="preferences_chats__delete_media_only">Delete media only</string>
<string name="preferences_chats__delete_media_only_summary">Delete only media, not the message itself, when media is deleted in the All media screen</string>
<!-- group control -->
<string name="preferences_chats__group_control">Group control</string>
<string name="preferences_chats__who_can_add_you_to_groups">Who can add you to groups</string>
</resources>
' > 'app/src/main/res/values/strings1.xml'
  • Loading branch information
johanw666 authored and pixincreate committed Aug 10, 2024
1 parent 60ee967 commit 698b961
Show file tree
Hide file tree
Showing 24 changed files with 681 additions and 141 deletions.
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,11 @@
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:exported="false"/>

<!-- JW: added the windowSoftInputMode="stateAlwaysVisible" flag here to show a keyboard on open -->
<activity android:name=".PassphrasePromptActivity"
android:launchMode="singleTask"
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
android:windowSoftInputMode="stateAlwaysVisible"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:exported="false"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void onFirstEverAppLaunch(@NonNull Context context) {
TextSecurePreferences.setJobManagerVersion(context, JobManager.CURRENT_VERSION);
TextSecurePreferences.setLastVersionCode(context, Util.getCanonicalVersionCode());
TextSecurePreferences.setHasSeenStickerIntroTooltip(context, true);
SignalStore.settings().setPassphraseDisabled(true);
//SignalStore.settings().setPassphraseDisabled(true); // JW: don't do this
TextSecurePreferences.setReadReceiptsEnabled(context, true);
TextSecurePreferences.setTypingIndicatorsEnabled(context, true);
TextSecurePreferences.setHasSeenWelcomeScreen(context, false);
Expand Down Expand Up @@ -73,7 +73,7 @@ public static void onRepairFirstEverAppLaunch(@NonNull Context context) {
TextSecurePreferences.setJobManagerVersion(context, JobManager.CURRENT_VERSION);
TextSecurePreferences.setLastVersionCode(context, Util.getCanonicalVersionCode());
TextSecurePreferences.setHasSeenStickerIntroTooltip(context, true);
SignalStore.settings().setPassphraseDisabled(true);
//SignalStore.settings().setPassphraseDisabled(true); // JW: don't do this
AppDependencies.getMegaphoneRepository().onFirstEverAppLaunch();
SignalStore.onFirstEverAppLaunch();
AppDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.ZOZO.getPackId(), BlessedPacks.ZOZO.getPackKey(), false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager; // JW: added
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageButton;
Expand Down Expand Up @@ -271,10 +272,14 @@ private void initializeResources() {
private void setLockTypeVisibility() {
if (SignalStore.settings().getScreenLockEnabled()) {
passphraseAuthContainer.setVisibility(View.GONE);
// JW: to override setSoftInputMode it has to be defined in the manifest file
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); // JW
unlockView.setVisibility(View.VISIBLE);
lockScreenButton.setVisibility(View.VISIBLE);
} else {
passphraseAuthContainer.setVisibility(View.VISIBLE);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); // JW
passphraseText.requestFocus(); // JW
unlockView.setVisibility(View.GONE);
lockScreenButton.setVisibility(View.GONE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.thoughtcrime.securesms.components.settings.DSLSettingsFragment
import org.thoughtcrime.securesms.components.settings.DSLSettingsText
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppPaymentCheckoutLauncher.createBackupsCheckoutLauncher
import org.thoughtcrime.securesms.components.settings.configure
import org.thoughtcrime.securesms.util.TextSecurePreferences // JW: added
import org.thoughtcrime.securesms.util.RemoteConfig
import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
import org.thoughtcrime.securesms.util.navigation.safeNavigate
Expand All @@ -19,6 +20,8 @@ class ChatsSettingsFragment : DSLSettingsFragment(R.string.preferences_chats__ch

private lateinit var viewModel: ChatsSettingsViewModel
private lateinit var checkoutLauncher: ActivityResultLauncher<InAppPaymentType>
private val groupAddLabels by lazy { resources.getStringArray(R.array.pref_group_add_entries) } // JW: added
private val groupAddValues by lazy { resources.getStringArray(R.array.pref_group_add_values) } // JW: added

override fun onResume() {
super.onResume()
Expand Down Expand Up @@ -112,6 +115,54 @@ class ChatsSettingsFragment : DSLSettingsFragment(R.string.preferences_chats__ch
Navigation.findNavController(requireView()).safeNavigate(R.id.action_chatsSettingsFragment_to_backupsPreferenceFragment)
}
)

dividerPref()

sectionHeaderPref(R.string.preferences_chats__control_message_deletion)

// JW: added
switchPref(
title = DSLSettingsText.from(R.string.preferences_chats__chat_keep_view_once_messages),
summary = DSLSettingsText.from(R.string.preferences_chats__keep_view_once_messages_summary),
isChecked = state.keepViewOnceMessages,
onClick = {
viewModel.keepViewOnceMessages(!state.keepViewOnceMessages)
}
)

// JW: added
switchPref(
title = DSLSettingsText.from(R.string.preferences_chats__chat_ignore_remote_delete),
summary = DSLSettingsText.from(R.string.preferences_chats__chat_ignore_remote_delete_summary),
isChecked = state.ignoreRemoteDelete,
onClick = {
viewModel.ignoreRemoteDelete(!state.ignoreRemoteDelete)
}
)

// JW: added
switchPref(
title = DSLSettingsText.from(R.string.preferences_chats__delete_media_only),
summary = DSLSettingsText.from(R.string.preferences_chats__delete_media_only_summary),
isChecked = state.deleteMediaOnly,
onClick = {
viewModel.deleteMediaOnly(!state.deleteMediaOnly)
}
)

dividerPref()

sectionHeaderPref(R.string.preferences_chats__group_control)

// JW: added
radioListPref(
title = DSLSettingsText.from(R.string.preferences_chats__who_can_add_you_to_groups),
listItems = groupAddLabels,
selected = groupAddValues.indexOf(state.whoCanAddYouToGroups),
onSelected = {
viewModel.setWhoCanAddYouToGroups(groupAddValues[it])
}
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ data class ChatsSettingsState(
val enterKeySends: Boolean,
val localBackupsEnabled: Boolean,
val canAccessRemoteBackupsSettings: Boolean
// JW: added extra preferences
,
val keepViewOnceMessages: Boolean,
val ignoreRemoteDelete: Boolean,
val deleteMediaOnly: Boolean,
val whoCanAddYouToGroups: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.thoughtcrime.securesms.dependencies.AppDependencies
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.thoughtcrime.securesms.util.BackupUtil
import org.thoughtcrime.securesms.util.ConversationUtil
import org.thoughtcrime.securesms.util.TextSecurePreferences // JW: added
import org.thoughtcrime.securesms.util.ThrottledDebouncer
import org.thoughtcrime.securesms.util.livedata.Store

Expand All @@ -28,7 +29,13 @@ class ChatsSettingsViewModel @JvmOverloads constructor(
useSystemEmoji = SignalStore.settings.isPreferSystemEmoji,
enterKeySends = SignalStore.settings.isEnterKeySends,
localBackupsEnabled = SignalStore.settings.isBackupEnabled && BackupUtil.canUserAccessBackupDirectory(AppDependencies.application),
canAccessRemoteBackupsSettings = SignalStore.backup.areBackupsEnabled
canAccessRemoteBackupsSettings = SignalStore.backup.areBackupsEnabled
// JW: added
,
keepViewOnceMessages = TextSecurePreferences.isKeepViewOnceMessages(AppDependencies.application),
ignoreRemoteDelete = TextSecurePreferences.isIgnoreRemoteDelete(AppDependencies.application),
deleteMediaOnly = TextSecurePreferences.isDeleteMediaOnly(AppDependencies.application),
whoCanAddYouToGroups = TextSecurePreferences.whoCanAddYouToGroups(AppDependencies.application)
)
)

Expand Down Expand Up @@ -83,5 +90,46 @@ class ChatsSettingsViewModel @JvmOverloads constructor(
) {
store.update { it.copy(localBackupsEnabled = backupsEnabled, canAccessRemoteBackupsSettings = remoteBackupsEnabled) }
}
// JW: added. This is required to update the UI for settings that are not in the Signal store but in the shared preferences.
store.update { getState().copy() }
}

// JW: added
fun keepViewOnceMessages(enabled: Boolean) {
TextSecurePreferences.setKeepViewOnceMessages(AppDependencies.application, enabled)
refresh()
}

// JW: added
fun ignoreRemoteDelete(enabled: Boolean) {
TextSecurePreferences.setIgnoreRemoteDelete(AppDependencies.application, enabled)
refresh()
}

// JW: added
fun deleteMediaOnly(enabled: Boolean) {
TextSecurePreferences.setDeleteMediaOnly(AppDependencies.application, enabled)
refresh()
}

// JW: added
fun setWhoCanAddYouToGroups(adder: String) {
TextSecurePreferences.setWhoCanAddYouToGroups(AppDependencies.application, adder)
refresh()
}

// JW: added
private fun getState() = ChatsSettingsState(
generateLinkPreviews = SignalStore.settings.isLinkPreviewsEnabled,
useAddressBook = SignalStore.settings.isPreferSystemContactPhotos,
keepMutedChatsArchived = SignalStore.settings.shouldKeepMutedChatsArchived(),
useSystemEmoji = SignalStore.settings.isPreferSystemEmoji,
enterKeySends = SignalStore.settings.isEnterKeySends,
localBackupsEnabled = SignalStore.settings.isBackupEnabled,
canAccessRemoteBackupsSettings = SignalStore.backup.areBackupsEnabled,
keepViewOnceMessages = TextSecurePreferences.isKeepViewOnceMessages(AppDependencies.application),
ignoreRemoteDelete = TextSecurePreferences.isIgnoreRemoteDelete(AppDependencies.application),
deleteMediaOnly = TextSecurePreferences.isDeleteMediaOnly(AppDependencies.application),
whoCanAddYouToGroups = TextSecurePreferences.whoCanAddYouToGroups(AppDependencies.application)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,30 +182,62 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac

sectionHeaderPref(R.string.PrivacySettingsFragment__app_security)

if (state.isObsoletePasswordEnabled) {
// JW: added toggle between password and Android screenlock
switchPref(
title = DSLSettingsText.from(R.string.preferences_app_protection__method_passphrase),
summary = DSLSettingsText.from(R.string.preferences_app_protection__method_passphrase_summary),
isChecked = state.isProtectionMethodPassphrase,
onClick = {
// After a togggle, we disable both passphrase and Android keylock.
// Remove the passphrase if there is one set
if (state.isObsoletePasswordEnabled) {
MasterSecretUtil.changeMasterSecretPassphrase(
activity,
KeyCachingService.getMasterSecret(context),
MasterSecretUtil.UNENCRYPTED_PASSPHRASE
)
SignalStore.settings.setPassphraseDisabled(true)
val intent = Intent(context, KeyCachingService::class.java)
intent.action = KeyCachingService.DISABLE_ACTION
requireActivity().startService(intent)
}
TextSecurePreferences.setProtectionMethod(activity, !state.isProtectionMethodPassphrase)
viewModel.setNoLock()
}
)

//if (state.isObsoletePasswordEnabled) {
if (viewModel.isPassphraseSelected()) { // JW: method changed
switchPref(
title = DSLSettingsText.from(R.string.preferences__enable_passphrase),
summary = DSLSettingsText.from(R.string.preferences__lock_signal_and_message_notifications_with_a_passphrase),
isChecked = true,
isChecked = state.isObsoletePasswordEnabled, // JW
onClick = {
MaterialAlertDialogBuilder(requireContext()).apply {
setTitle(R.string.ApplicationPreferencesActivity_disable_passphrase)
setMessage(R.string.ApplicationPreferencesActivity_this_will_permanently_unlock_signal_and_message_notifications)
setIcon(R.drawable.symbol_error_triangle_fill_24)
setPositiveButton(R.string.ApplicationPreferencesActivity_disable) { _, _ ->
MasterSecretUtil.changeMasterSecretPassphrase(
activity,
KeyCachingService.getMasterSecret(context),
MasterSecretUtil.UNENCRYPTED_PASSPHRASE
)
SignalStore.settings.passphraseDisabled = true
val intent = Intent(activity, KeyCachingService::class.java)
intent.action = KeyCachingService.DISABLE_ACTION
requireActivity().startService(intent)
viewModel.refresh()
if (state.isObsoletePasswordEnabled) { // JW: added if else
MaterialAlertDialogBuilder(requireContext()).apply {
setTitle(R.string.ApplicationPreferencesActivity_disable_passphrase)
setMessage(R.string.ApplicationPreferencesActivity_this_will_permanently_unlock_signal_and_message_notifications)
setIcon(R.drawable.symbol_error_triangle_fill_24)
setPositiveButton(R.string.ApplicationPreferencesActivity_disable) { _, _ ->
MasterSecretUtil.changeMasterSecretPassphrase(
activity,
KeyCachingService.getMasterSecret(context),
MasterSecretUtil.UNENCRYPTED_PASSPHRASE
)
SignalStore.settings.setPassphraseDisabled(true)
val intent = Intent(activity, KeyCachingService::class.java)
intent.action = KeyCachingService.DISABLE_ACTION
requireActivity().startService(intent)
viewModel.refresh()
}
setNegativeButton(android.R.string.cancel, null)
show()
}
setNegativeButton(android.R.string.cancel, null)
show()
} else {
// enable password
val intent = Intent(activity, PassphraseChangeActivity::class.java)
startActivity(intent)
viewModel.refresh()
}
}
)
Expand Down Expand Up @@ -237,14 +269,15 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac

clickPref(
title = DSLSettingsText.from(R.string.preferences__inactivity_timeout_interval),
summary = DSLSettingsText.from(getScreenLockInactivityTimeoutSummary(state.isObsoletePasswordTimeoutEnabled,60 * state.obsoletePasswordTimeout.toLong())), // JW
onClick = {
childFragmentManager.clearFragmentResult(TimeDurationPickerDialog.RESULT_DURATION)
childFragmentManager.clearFragmentResultListener(TimeDurationPickerDialog.RESULT_DURATION)
childFragmentManager.setFragmentResultListener(TimeDurationPickerDialog.RESULT_DURATION, this@PrivacySettingsFragment) { _, bundle ->
val timeout = bundle.getLong(TimeDurationPickerDialog.RESULT_KEY_DURATION_MILLISECONDS).milliseconds.inWholeMinutes.toInt()
viewModel.setObsoletePasswordTimeout(max(timeout, 1))
}
TimeDurationPickerDialog.create(state.screenLockActivityTimeout.seconds).show(childFragmentManager, null)
TimeDurationPickerDialog.create(state.obsoletePasswordTimeout.seconds * 60).show(childFragmentManager, null) // JW
}
)
} else {
Expand All @@ -258,6 +291,7 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac
},
isEnabled = isKeyguardSecure,
onDisabledClicked = {
viewModel.setOnlyScreenlockEnabled(!state.screenLock) // JW: changed
Snackbar
.make(
requireView(),
Expand Down Expand Up @@ -404,4 +438,4 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac
viewModel.refresh()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ data class PrivacySettingsState(
val isObsoletePasswordTimeoutEnabled: Boolean,
val obsoletePasswordTimeout: Int,
val universalExpireTimer: Int
// JW: added
,
val isProtectionMethodPassphrase: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,41 @@ class PrivacySettingsViewModel(
refresh()
}

// JW: added
fun setPassphraseEnabled(enabled: Boolean) {
sharedPreferences.edit().putBoolean(TextSecurePreferences.DISABLE_PASSPHRASE_PREF, !enabled).apply()
sharedPreferences.edit().putBoolean("pref_enable_passphrase_temporary", enabled).apply()
sharedPreferences.edit().putBoolean(TextSecurePreferences.SCREEN_LOCK, !enabled).apply()
refresh()
}

// JW: added
fun setOnlyScreenlockEnabled(enabled: Boolean) {
sharedPreferences.edit().putBoolean(TextSecurePreferences.DISABLE_PASSPHRASE_PREF, true).apply()
sharedPreferences.edit().putBoolean("pref_enable_passphrase_temporary", false).apply()
sharedPreferences.edit().putBoolean(TextSecurePreferences.SCREEN_LOCK, enabled).apply()
refresh()
}

// JW: added
fun setNoLock() {
sharedPreferences.edit().putBoolean(TextSecurePreferences.DISABLE_PASSPHRASE_PREF, true).apply()
sharedPreferences.edit().putBoolean("pref_enable_passphrase_temporary", false).apply()
sharedPreferences.edit().putBoolean(TextSecurePreferences.SCREEN_LOCK, false).apply()
refresh()
}

// JW: added method.
fun isPassphraseSelected(): Boolean {
// Because this preference may be undefined when this app is first ran we also check if there is a passphrase
// defined, if so, we assume passphrase protection:
val myContext = AppDependencies.application

return TextSecurePreferences.isProtectionMethodPassphrase(myContext) ||
TextSecurePreferences.getBooleanPreference(myContext, "pref_enable_passphrase_temporary", false) &&
!TextSecurePreferences.isPasswordDisabled(myContext)
}

fun refresh() {
store.update(this::updateState)
}
Expand All @@ -80,6 +115,9 @@ class PrivacySettingsViewModel(
isObsoletePasswordTimeoutEnabled = SignalStore.settings.passphraseTimeoutEnabled,
obsoletePasswordTimeout = SignalStore.settings.passphraseTimeout,
universalExpireTimer = SignalStore.settings.universalExpireTimer
// JW: added
,
isProtectionMethodPassphrase = TextSecurePreferences.isProtectionMethodPassphrase(AppDependencies.application)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ class AdvancedPrivacySettingsFragment : DSLSettingsFragment(R.string.preferences
viewModel.setAlwaysRelayCalls(!state.alwaysRelayCalls)
}

// JW: added
switchPref(
title = DSLSettingsText.from(R.string.preferences_advanced__push_notifications_fcm),
summary = DSLSettingsText.from(R.string.preferences_advanced__push_notifications_fcm_summary),
isChecked = state.pushNotificationsViaFCM
) {
val isFcm = state.pushNotificationsViaFCM
viewModel.setPushNotificationsViaFCM(!isFcm)
FCMPreferenceFunctions.onFCMPreferenceChange(context, !isFcm)
}

dividerPref()

sectionHeaderPref(R.string.preferences_communication__category_censorship_circumvention)
Expand Down
Loading

0 comments on commit 698b961

Please sign in to comment.