Skip to content

Commit

Permalink
under the hood improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky committed Jul 16, 2022
1 parent 59223ba commit 409fe57
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "me.lucky.wasted"
minSdk 23
targetSdk 32
versionCode 36
versionName "1.5.7"
versionCode 37
versionName "1.5.8"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
android:label="@string/signal"
android:icon="@mipmap/ic_signal"
android:roundIcon="@mipmap/ic_signal_round"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -185,6 +188,9 @@
android:label="@string/telegram"
android:icon="@mipmap/ic_telegram"
android:roundIcon="@mipmap/ic_telegram_round"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -198,6 +204,9 @@
android:label="@string/threema"
android:icon="@mipmap/ic_threema"
android:roundIcon="@mipmap/ic_threema_round"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -211,6 +220,9 @@
android:label="@string/session"
android:icon="@mipmap/ic_session"
android:roundIcon="@mipmap/ic_session_round"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/me/lucky/wasted/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ class Utils(private val ctx: Context) {
val prefs = Preferences(ctx)
val enabled = prefs.isEnabled
val triggers = prefs.triggers
val isLock = triggers.and(Trigger.LOCK.value) != 0
val isUSB = triggers.and(Trigger.USB.value) != 0
setForegroundEnabled(enabled && (isLock || isUSB))
setComponentEnabled(RestartReceiver::class.java, enabled && (isLock || isUSB))
val foregroundEnabled = enabled && (triggers.and(Trigger.LOCK.value) != 0 || isUSB)
setForegroundEnabled(foregroundEnabled)
setComponentEnabled(RestartReceiver::class.java, foregroundEnabled)
setComponentEnabled(UsbReceiver::class.java, enabled && isUSB)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class SettingsFragment : Fragment() {
binding.apply {
val triggers = prefs.triggers
panicKit.isChecked = triggers.and(Trigger.PANIC_KIT.value) != 0
tile.isChecked = triggers.and(Trigger.TILE.value) != 0
tile.isEnabled = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
tile.isChecked = triggers.and(Trigger.TILE.value) != 0
shortcut.isChecked = triggers.and(Trigger.SHORTCUT.value) != 0
broadcast.isChecked = triggers.and(Trigger.BROADCAST.value) != 0
notification.isChecked = triggers.and(Trigger.NOTIFICATION.value) != 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ class ForegroundService : Service() {
}

private fun deinit() {
try {
unregisterReceiver(lockReceiver)
unregisterReceiver(usbReceiver)
} catch (exc: IllegalArgumentException) {}
val unregister: (BroadcastReceiver) -> Unit = {
try { unregisterReceiver(it) } catch (exc: IllegalArgumentException) {}
}
unregister(lockReceiver)
unregister(usbReceiver)
}

override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/37.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
under the hood improvements
2 changes: 1 addition & 1 deletion fastlane/metadata/android/fr-FR/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Vous pouvez également:
* déclencher lorsqu'un appareil n'a pas été déverrouillé pendant X temps
* déclencher lorsqu'une connexion de données USB est établie alors que le dispositif est verrouillé
* déclencher quand une fausse application de messagerie est lancée
* Déclenchement lorsqu'un mot de passe sous contrainte est entré (application compagnon : [Duress](https://github.com/x13a/Duress))
* déclenchement lorsqu'un mot de passe sous contrainte est entré (application compagnon : [Duress](https://github.com/x13a/Duress))

L'application fonctionne également dans le profil de travail. Utilisez Shelter pour installer des applications à risque et Wasted dans celui-ci. Vous pouvez ensuite effacer les données de ce profil en un clic sans effacer l'ensemble de l'appareil.

Expand Down

0 comments on commit 409fe57

Please sign in to comment.