application trigger

This commit is contained in:
lucky 2022-07-14 18:26:28 +03:00
parent ebf2a59fa6
commit 712ef42214
77 changed files with 532 additions and 10 deletions

View File

@ -24,6 +24,7 @@ locks a device and optionally runs wipe.
Also you can:
* fire when a device was not unlocked for X time
* fire when a USB data connection is made while a device is locked
* fire when a fake messenger app is launched
* fire when a duress password is entered (companion app: [Duress](https://github.com/x13a/Duress))
The app works in `Work Profile` too. Use [Shelter](https://github.com/PeterCxy/Shelter) to install

View File

@ -10,8 +10,8 @@ android {
applicationId "me.lucky.wasted"
minSdk 23
targetSdk 32
versionCode 34
versionName "1.5.5"
versionCode 35
versionName "1.5.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -156,5 +156,77 @@
</intent-filter>
</receiver>
<activity
android:name=".trigger.application.ApplicationActivity"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:enabled="false"
android:exported="false">
</activity>
<activity-alias
android:name=".trigger.application.SignalActivity"
android:targetActivity=".trigger.application.ApplicationActivity"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:label="@string/signal"
android:icon="@mipmap/ic_signal"
android:roundIcon="@mipmap/ic_signal_round"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
android:name=".trigger.application.TelegramActivity"
android:targetActivity=".trigger.application.ApplicationActivity"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:label="@string/telegram"
android:icon="@mipmap/ic_telegram"
android:roundIcon="@mipmap/ic_telegram_round"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
android:name=".trigger.application.ThreemaActivity"
android:targetActivity=".trigger.application.ApplicationActivity"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:label="@string/threema"
android:icon="@mipmap/ic_threema"
android:roundIcon="@mipmap/ic_threema_round"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
android:name=".trigger.application.SessionActivity"
android:targetActivity=".trigger.application.ApplicationActivity"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"
android:label="@string/session"
android:icon="@mipmap/ic_session"
android:roundIcon="@mipmap/ic_session_round"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
</application>
</manifest>

View File

@ -143,6 +143,7 @@ open class MainActivity : AppCompatActivity() {
R.id.nav_trigger_tile -> TileFragment()
R.id.nav_trigger_notification -> NotificationFragment()
R.id.nav_trigger_lock -> LockFragment()
R.id.nav_trigger_application -> ApplicationFragment()
R.id.top_settings -> SettingsFragment()
else -> MainFragment()
}

View File

@ -22,6 +22,7 @@ class Preferences(ctx: Context, encrypted: Boolean = true) {
private const val TRIGGERS = "triggers"
private const val TRIGGER_LOCK_COUNT = "trigger_lock_count"
private const val TRIGGER_TILE_DELAY = "trigger_tile_delay"
private const val TRIGGER_APPLICATION_OPTIONS = "trigger_application_options"
private const val FILE_NAME = "sec_shared_prefs"
@ -85,6 +86,10 @@ class Preferences(ctx: Context, encrypted: Boolean = true) {
get() = prefs.getLong(TRIGGER_TILE_DELAY, DEFAULT_TRIGGER_TILE_DELAY)
set(value) = prefs.edit { putLong(TRIGGER_TILE_DELAY, value) }
var triggerApplicationOptions: Int
get() = prefs.getInt(TRIGGER_APPLICATION_OPTIONS, 0)
set(value) = prefs.edit { putInt(TRIGGER_APPLICATION_OPTIONS, value) }
fun registerListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) =
prefs.registerOnSharedPreferenceChangeListener(listener)
@ -114,4 +119,12 @@ enum class Trigger(val value: Int) {
NOTIFICATION(1 shl 4),
LOCK(1 shl 5),
USB(1 shl 6),
APPLICATION(1 shl 7),
}
enum class ApplicationOption(val value: Int) {
SIGNAL(1),
TELEGRAM(1 shl 1),
THREEMA(1 shl 2),
SESSION(1 shl 3),
}

View File

@ -36,6 +36,7 @@ class Utils(private val ctx: Context) {
setBroadcastEnabled(enabled && triggers.and(Trigger.BROADCAST.value) != 0)
setNotificationEnabled(enabled && triggers.and(Trigger.NOTIFICATION.value) != 0)
updateForegroundRequiredEnabled()
updateApplicationEnabled()
}
fun setPanicKitEnabled(enabled: Boolean) {
@ -60,6 +61,29 @@ class Utils(private val ctx: Context) {
fun setNotificationEnabled(enabled: Boolean) =
setComponentEnabled(NotificationListenerService::class.java, enabled)
fun updateApplicationEnabled() {
val prefix = "${ctx.packageName}.trigger.application"
val prefs = Preferences(ctx)
val options = prefs.triggerApplicationOptions
val enabled = prefs.isEnabled && prefs.triggers.and(Trigger.APPLICATION.value) != 0
setComponentEnabled(
"$prefix.SignalActivity",
enabled && options.and(ApplicationOption.SIGNAL.value) != 0,
)
setComponentEnabled(
"$prefix.TelegramActivity",
enabled && options.and(ApplicationOption.TELEGRAM.value) != 0,
)
setComponentEnabled(
"$prefix.ThreemaActivity",
enabled && options.and(ApplicationOption.THREEMA.value) != 0,
)
setComponentEnabled(
"$prefix.SessionActivity",
enabled && options.and(ApplicationOption.SESSION.value) != 0,
)
}
fun updateForegroundRequiredEnabled() {
val prefs = Preferences(ctx)
val enabled = prefs.isEnabled
@ -78,8 +102,14 @@ class Utils(private val ctx: Context) {
}
private fun setComponentEnabled(cls: Class<*>, enabled: Boolean) =
setComponentEnabled(ComponentName(ctx, cls), enabled)
private fun setComponentEnabled(cls: String, enabled: Boolean) =
setComponentEnabled(ComponentName(ctx, cls), enabled)
private fun setComponentEnabled(componentName: ComponentName, enabled: Boolean) =
ctx.packageManager.setComponentEnabledSetting(
ComponentName(ctx, cls),
componentName,
if (enabled) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP,

View File

@ -0,0 +1,95 @@
package me.lucky.wasted.fragment
import android.content.Context
import android.content.SharedPreferences
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import me.lucky.wasted.ApplicationOption
import me.lucky.wasted.Preferences
import me.lucky.wasted.Utils
import me.lucky.wasted.databinding.FragmentApplicationBinding
class ApplicationFragment : Fragment() {
private lateinit var binding: FragmentApplicationBinding
private lateinit var ctx: Context
private lateinit var prefs: Preferences
private lateinit var prefsdb: Preferences
private val utils by lazy { Utils(ctx) }
private val prefsListener = SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
prefs.copyTo(prefsdb, key)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
binding = FragmentApplicationBinding.inflate(inflater, container, false)
init()
setup()
return binding.root
}
override fun onStart() {
super.onStart()
prefs.registerListener(prefsListener)
}
override fun onStop() {
super.onStop()
prefs.unregisterListener(prefsListener)
}
private fun init() {
ctx = requireContext()
prefs = Preferences(ctx)
prefsdb = Preferences(ctx, encrypted = false)
binding.apply {
val options = prefs.triggerApplicationOptions
signal.isChecked = options.and(ApplicationOption.SIGNAL.value) != 0
telegram.isChecked = options.and(ApplicationOption.TELEGRAM.value) != 0
threema.isChecked = options.and(ApplicationOption.THREEMA.value) != 0
session.isChecked = options.and(ApplicationOption.SESSION.value) != 0
}
}
private fun setup() = binding.apply {
signal.setOnCheckedChangeListener { _, isChecked ->
prefs.triggerApplicationOptions = Utils.setFlag(
prefs.triggerApplicationOptions,
ApplicationOption.SIGNAL.value,
isChecked,
)
utils.updateApplicationEnabled()
}
telegram.setOnCheckedChangeListener { _, isChecked ->
prefs.triggerApplicationOptions = Utils.setFlag(
prefs.triggerApplicationOptions,
ApplicationOption.TELEGRAM.value,
isChecked,
)
utils.updateApplicationEnabled()
}
threema.setOnCheckedChangeListener { _, isChecked ->
prefs.triggerApplicationOptions = Utils.setFlag(
prefs.triggerApplicationOptions,
ApplicationOption.THREEMA.value,
isChecked,
)
utils.updateApplicationEnabled()
}
session.setOnCheckedChangeListener { _, isChecked ->
prefs.triggerApplicationOptions = Utils.setFlag(
prefs.triggerApplicationOptions,
ApplicationOption.SESSION.value,
isChecked,
)
utils.updateApplicationEnabled()
}
}
}

View File

@ -60,6 +60,7 @@ class SettingsFragment : Fragment() {
notification.isChecked = triggers.and(Trigger.NOTIFICATION.value) != 0
lock.isChecked = triggers.and(Trigger.LOCK.value) != 0
usb.isChecked = triggers.and(Trigger.USB.value) != 0
application.isChecked = triggers.and(Trigger.APPLICATION.value) != 0
}
}
@ -93,5 +94,9 @@ class SettingsFragment : Fragment() {
prefs.triggers = Utils.setFlag(prefs.triggers, Trigger.USB.value, isChecked)
utils.updateForegroundRequiredEnabled()
}
application.setOnCheckedChangeListener { _, isChecked ->
prefs.triggers = Utils.setFlag(prefs.triggers, Trigger.APPLICATION.value, isChecked)
utils.updateApplicationEnabled()
}
}
}

View File

@ -0,0 +1,26 @@
package me.lucky.wasted.trigger.application
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import me.lucky.wasted.Preferences
import me.lucky.wasted.Trigger
import me.lucky.wasted.admin.DeviceAdminManager
class ApplicationActivity : AppCompatActivity() {
private val prefs by lazy { Preferences(this) }
private val admin by lazy { DeviceAdminManager(this) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!prefs.isEnabled || prefs.triggers.and(Trigger.APPLICATION.value) == 0) {
finishAndRemoveTask()
return
}
try {
admin.lockNow()
if (prefs.isWipeData) admin.wipeData()
} catch (exc: SecurityException) {}
finishAndRemoveTask()
}
}

View File

@ -10,11 +10,8 @@ import me.lucky.wasted.trigger.broadcast.BroadcastReceiver
class ShortcutActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (Preferences(this).triggers.and(Trigger.SHORTCUT.value) == 0) {
finishAndRemoveTask()
return
}
BroadcastReceiver.panic(this, intent)
if (Preferences(this).triggers.and(Trigger.SHORTCUT.value) != 0)
BroadcastReceiver.panic(this, intent)
finishAndRemoveTask()
}
}

View File

@ -0,0 +1,35 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.07452"
android:scaleY="0.07452"
android:translateX="16.74"
android:translateY="16.74">
<path
android:pathData="M500,500m-500,0a500,500 0,1 1,1000 0a500,500 0,1 1,-1000 0"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:startX="500"
android:startY="-0"
android:endX="500"
android:endY="992.6"
android:type="linear">
<item android:offset="0" android:color="#FF2AABEE"/>
<item android:offset="1" android:color="#FF229ED9"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M226.3,494.7C372.1,431.2 469.3,389.4 517.9,369.1C656.8,311.4 685.6,301.3 704.4,301C708.6,300.9 717.8,302 723.8,306.8C728.9,310.9 730.3,316.5 730.9,320.4C731.6,324.2 732.4,333.1 731.8,340C724.2,419.1 691.7,611 675.1,699.5C668.1,737 654.3,749.5 640.9,750.8C611.9,753.4 589.9,731.6 561.7,713.2C517.7,684.3 492.9,666.3 450.2,638.2C400.8,605.7 432.8,587.8 460.9,558.6C468.3,550.9 596.2,434.6 598.7,424C599,422.7 599.3,417.8 596.4,415.2C593.4,412.6 589.1,413.5 586,414.2C581.6,415.2 511.3,461.6 375.1,553.6C355.2,567.3 337.1,573.9 320.9,573.6C303,573.2 268.7,563.5 243.2,555.2C211.9,545 187,539.6 189.1,522.3C190.3,513.3 202.7,504.1 226.3,494.7Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</group>
</vector>

View File

@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.15093666"
android:scaleY="0.15093666"
android:translateX="31.128567"
android:translateY="28.62">
<path
android:pathData="M255.67,170.86l-63.48,-35.17h43.03c37.41,0 67.85,-30.43 67.85,-67.84S272.63,0 235.22,0H85C38.13,0 0,38.13 0,85c0,33.42 18.16,64.25 47.4,80.45l63.48,35.17H67.85C30.44,200.62 0,231.05 0,268.46s30.44,67.85 67.85,67.85h150.22c46.87,0 85,-38.13 85,-85C303.06,217.88 284.9,187.06 255.67,170.86zM57.58,147.05c-22.06,-12.22 -35.95,-35.25 -36.54,-60.39C20.19,50.57 50.5,21.02 86.61,21.02h147.25c25.18,0 46.88,19.31 48.12,44.46c1.33,26.88 -20.16,49.18 -46.76,49.18c0,0 -60.99,0.01 -84.81,0.01c-5.19,0 -9.37,4.21 -9.38,9.39l-0.02,69.22L57.58,147.05zM216.46,315.28H69.2c-25.18,0 -46.88,-19.31 -48.12,-44.46c-1.33,-26.88 20.16,-49.18 46.76,-49.18h84.81c5.19,0 9.39,-4.21 9.39,-9.39v-69.23l83.44,46.23c22.06,12.22 35.95,35.25 36.54,60.39C282.87,285.73 252.56,315.28 216.46,315.28z"
android:fillColor="#00F782"/>
</group>
</vector>

View File

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.3459375"
android:scaleY="0.3459375"
android:translateX="31.86"
android:translateY="31.86">
<group>
<clip-path
android:pathData="M0,0h128v128h-128z"/>
<path
android:pathData="M48.64,1.87L50.08,7.69C44.42,9.08 38.99,11.32 34,14.34L30.92,9.2C36.42,5.88 42.4,3.41 48.64,1.87ZM79.36,1.87L77.92,7.69C83.58,9.08 89.01,11.32 94,14.34L97.1,9.2C91.59,5.88 85.61,3.4 79.36,1.87L79.36,1.87ZM9.2,30.92C5.88,36.42 3.41,42.4 1.87,48.64L7.69,50.08C9.08,44.42 11.32,38.99 14.34,34L9.2,30.92ZM6,64C6,61.09 6.22,58.19 6.65,55.31L0.72,54.41C-0.24,60.77 -0.24,67.23 0.72,73.59L6.65,72.69C6.22,69.81 6,66.91 6,64L6,64ZM97.08,118.8L94,113.66C89.01,116.67 83.6,118.92 77.94,120.31L79.38,126.13C85.61,124.59 91.58,122.12 97.08,118.8L97.08,118.8ZM122,64C122,66.91 121.79,69.81 121.35,72.69L127.28,73.59C128.24,67.23 128.24,60.77 127.28,54.41L121.35,55.31C121.79,58.19 122,61.09 122,64L122,64ZM126.13,79.36L120.31,77.92C118.92,83.58 116.68,89.01 113.66,94L118.8,97.1C122.13,91.59 124.6,85.61 126.13,79.36ZM72.69,121.36C66.93,122.23 61.07,122.23 55.31,121.36L54.41,127.29C60.77,128.25 67.23,128.25 73.59,127.29L72.69,121.36ZM110.69,98.41C107.23,103.1 103.09,107.24 98.4,110.69L101.96,115.52C107.13,111.72 111.7,107.16 115.52,102L110.69,98.41ZM98.4,17.31C103.09,20.77 107.23,24.91 110.69,29.6L115.52,26C111.71,20.84 107.16,16.28 102,12.48L98.4,17.31ZM17.31,29.6C20.77,24.91 24.91,20.77 29.6,17.31L26,12.48C20.84,16.28 16.28,20.84 12.48,26L17.31,29.6ZM118.8,30.92L113.66,34C116.67,38.99 118.92,44.4 120.31,50.06L126.13,48.62C124.59,42.38 122.12,36.42 118.8,30.92L118.8,30.92ZM55.31,6.65C61.07,5.78 66.93,5.78 72.69,6.65L73.59,0.72C67.23,-0.24 60.77,-0.24 54.41,0.72L55.31,6.65ZM20.39,117.11L8,120L10.89,107.61L5.05,106.24L2.16,118.63C1.69,120.65 2.29,122.77 3.76,124.24C5.23,125.71 7.35,126.31 9.37,125.84L21.75,123L20.39,117.11ZM6.3,100.89L12.14,102.25L14.14,93.66C11.23,88.76 9.05,83.46 7.69,77.92L1.87,79.36C3.17,84.66 5.16,89.78 7.77,94.57L6.3,100.89ZM34.3,113.89L25.71,115.89L27.07,121.73L33.39,120.26C38.19,122.87 43.3,124.86 48.6,126.16L50.04,120.34C44.51,118.96 39.22,116.78 34.34,113.85L34.3,113.89ZM64,12C45.08,12.01 27.66,22.3 18.51,38.86C9.36,55.42 9.93,75.65 20,91.67L15,113L36.33,108C55.04,119.78 79.15,118.45 96.45,104.67C113.74,90.89 120.43,67.68 113.12,46.82C105.82,25.95 86.11,11.98 64,12L64,12Z"
android:fillColor="#FFFFFF"/>
</group>
</group>
</vector>

View File

@ -0,0 +1,29 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.072773434"
android:scaleY="0.072773434"
android:translateX="16.74"
android:translateY="16.74">
<path
android:pathData="M50,0L974,0A50,50 0,0 1,1024 50L1024,974A50,50 0,0 1,974 1024L50,1024A50,50 0,0 1,0 974L0,50A50,50 0,0 1,50 0z"
android:strokeWidth="1"
android:fillColor="#323232"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M367.8,688.8L203,730L238.2,589.1C203.3,543.1 183,487.9 183,428.5C183,268.6 330.3,139 512,139C693.7,139 841,268.6 841,428.5C841,588.4 693.7,718 512,718C460.3,718 411.4,707.5 367.8,688.8L367.8,688.8ZM418.7,404.5L415,404.5C406.7,404.5 400,411.2 400,419.5L400,551C400,559.3 406.7,566 415,566L609,566C617.3,566 624,559.3 624,551L624,419.5C624,411.2 617.3,404.5 609,404.5L605.3,404.5L605.3,367.2C605.3,315.8 563.6,274 512,274C460.4,274 418.7,315.8 418.7,367.2L418.7,404.5ZM568,404.5L456,404.5L456,367.2C456,336.3 481.1,311.3 512,311.3C542.9,311.3 568,336.3 568,367.2C568,387.8 568,400.2 568,404.5Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M568,848C568,878.9 542.9,904 511.9,904C481,904 456,878.9 456,848C456,817.1 481,792 511.9,792C542.9,792 568,817.1 568,848ZM366,848C366,878.9 341,904 310,904C279.1,904 254,878.9 254,848C254,817.1 279.1,792 310,792C341,792 366,817.1 366,848ZM769.9,848C769.9,878.9 744.9,904 713.9,904C683,904 658,878.9 658,848C658,817.1 683,792 713.9,792C744.9,792 769.9,817.1 769.9,848Z"
android:strokeWidth="1"
android:fillColor="#05A63F"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</group>
</vector>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.ApplicationFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<CheckBox
android:id="@+id/signal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:text="@string/signal"
android:textAppearance="?attr/textAppearanceBodyLarge" />
<CheckBox
android:id="@+id/telegram"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:text="@string/telegram"
android:textAppearance="?attr/textAppearanceBodyLarge" />
<CheckBox
android:id="@+id/threema"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:text="@string/threema"
android:textAppearance="?attr/textAppearanceBodyLarge" />
<CheckBox
android:id="@+id/session"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:text="@string/session"
android:textAppearance="?attr/textAppearanceBodyLarge" />
</LinearLayout>
</ScrollView>
</FrameLayout>

View File

@ -142,6 +142,25 @@
android:text="@string/trigger_usb_description"
android:textAppearance="?attr/textAppearanceBodySmall" />
<Space
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="5dp" />
<CheckBox
android:id="@+id/application"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:text="@string/trigger_application" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/trigger_application_description"
android:textAppearance="?attr/textAppearanceBodySmall" />
</LinearLayout>
</ScrollView>
</FrameLayout>

View File

@ -23,6 +23,10 @@
android:id="@+id/nav_trigger_lock"
android:title="@string/trigger_lock" />
<item
android:id="@+id/nav_trigger_application"
android:title="@string/trigger_application" />
</group>
</menu>

View File

@ -14,7 +14,7 @@
<item
android:id="@+id/top_copy"
android:icon="@drawable/ic_baseline_content_copy_24"
android:title="@string/top_copy"
android:title="@android:string/copy"
app:showAsAction="ifRoom" />
</group>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_session_background"/>
<foreground android:drawable="@drawable/ic_session_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_session_background"/>
<foreground android:drawable="@drawable/ic_session_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_signal_background"/>
<foreground android:drawable="@drawable/ic_signal_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_signal_background"/>
<foreground android:drawable="@drawable/ic_signal_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_telegram_background"/>
<foreground android:drawable="@drawable/ic_telegram_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_telegram_background"/>
<foreground android:drawable="@drawable/ic_telegram_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_threema_background"/>
<foreground android:drawable="@drawable/ic_threema_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_threema_background"/>
<foreground android:drawable="@drawable/ic_threema_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -25,6 +25,12 @@
<string name="copied_popup">Copiato</string>
<string name="main">Principale</string>
<string name="settings">Impostazioni</string>
<string name="edit">Modifica</string>
<string name="goto_button">Vai</string>
<string name="authentication">Autenticazione</string>
<string name="edit_secret_hint">segreto</string>
<string name="edit_secret_helper_text">Usa un segreto abbastanza forte.</string>
<string name="edit_secret_error">Non deve essere vuoto!</string>
<string name="trigger_panic_kit_description">Abilita il panic responder. PanicKit è una raccolta di strumenti per la creazione di \"pulsanti di panico\" che possono attivare una risposta a livello di sistema quando l\'utente si trova in una situazione di ansia o di pericolo. Consente alle app trigger e alle app responder di connettersi tra loro in modo sicuro e semplice. L\'utente si collega all\'app trigger quando si trova in una situazione di panico. Le app di risposta ricevono il segnale di attivazione ed eseguono individualmente le operazioni per le quali sono state configurate.</string>
<string name="trigger_tile_description">Abilita il servizio toggle. Si tratta di un pulsante nel pannello delle impostazioni rapide quando scorri il dito dalla parte superiore dello schermo. Questo pulsante simula la modalità aereo.</string>
<string name="trigger_shortcut_description">Abilita la scorciatoia dell\'icona. È un pulsante che viene visualizzato quando si tocca a lungo l\'icona di Wasted.</string>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Wasted</string>
<string name="wipe_data_checkbox">Tøm data</string>
<string name="wipe_embedded_sim_checkbox">Tøm eSIM</string>
<string name="panic_app_dialog_title">Bekreft panikk-app</string>
<string name="panic_app_dialog_message">Er du sikker på at du vil tillate %1$s å utløse destruktive handlinger\\?</string>
<string name="panic_app_unknown_app">en ukjent app</string>
<string name="allow">Tillat</string>
<string name="tile_label">Flymodus</string>
<string name="shortcut_label">Panikk</string>
<string name="trigger_lock_time_hint">tid</string>
<string name="trigger_lock_time_error">7d / 48t / 120m</string>
<string name="trigger_lock_time_helper_text">Hvor lenge å vente. Modifikatorer: [d]ays [h]ours [m]inutes</string>
<string name="trigger_tile_delay_description">Sikker forsinkelse før den utløses. Gir deg litt tid til å kansellere utløseren hvis du trykker på flisen med et uhell.</string>
<string name="notification_channel_default_name">Standard</string>
<string name="foreground_service_notification_title">Vakt</string>
<string name="trigger_panic_kit">PanicKit</string>
<string name="trigger_tile">Flis</string>
<string name="trigger_shortcut">Snarvei</string>
<string name="trigger_broadcast">Kringkasting</string>
<string name="trigger_notification">Varsel</string>
<string name="trigger_lock">Lås</string>
<string name="trigger_usb">USB</string>
<string name="copied_popup">Kopiert</string>
<string name="main">Primær</string>
<string name="settings">Innstillinger</string>
<string name="edit">Edit</string>
<string name="goto_button">GOTO</string>
<string name="authentication">Authentication</string>
<string name="edit_secret_hint">secret</string>
<string name="edit_secret_helper_text">Use strong enough secret.</string>
<string name="edit_secret_error">Must not be blank!</string>
<string name="trigger_panic_kit_description">Skru på panikk responder. PanicKit er en samling verktøy for å lage \"panikknapper\" som kan utløse en systemomfattende respons når brukeren er i en skummel eller farlig situasjon. Den aktiverer utløser-apper og responder-apper for å sikkert og enkelt kobles mot hverandre. Brukeren interagerer med utløserknappen når de er i en panikksituasjon. Responder-appene mottar et utløsersignal, og kjører stegene de ble konfigurert til å kjøre individuelt.</string>
<string name="trigger_tile_description">Aktivér flis-tjenesten. Det er en knapp i hurtiginnstillingpanelet når du sveiper ned fra toppen av skjermen. Denne knappen vil etterligne flymodusknappen.</string>
<string name="trigger_shortcut_description">Aktivér ikonsnarvei. Det er en knapp du vil se når du trykker og holder inne på Wasted-ikonet.</string>
<string name="trigger_broadcast_description">Enable broadcast receiver. It is useful to communicate with another Android apps. For example you can fire Wasted from Tasker using this.</string>
<string name="trigger_notification_description">Enable device notification listener. It will scan all notifications it has access to for the secret code. When found it will fire.</string>
<string name="trigger_lock_description">Enable lock job scheduler. It will schedule a job every time you lock a device and cancel it every time you unlock a device. When you do not unlock a device for X time a job will fire.</string>
<string name="trigger_usb_description">Enable USB state receiver. When you make a USB data connection while a device is locked it will fire. It must not fire on charger, only on device and accessory.</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_session_background">#323031</color>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_signal_background">#4975E8</color>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_telegram_background">#23A0DC</color>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_threema_background">#323232</color>
</resources>

View File

@ -22,11 +22,11 @@
<string name="trigger_notification">Notification</string>
<string name="trigger_lock">Lock</string>
<string name="trigger_usb">USB</string>
<string name="trigger_application">Application</string>
<string name="copied_popup">Copied</string>
<string name="main">Main</string>
<string name="settings">Settings</string>
<string name="edit">Edit</string>
<string name="top_copy">Copy</string>
<string name="goto_button">GOTO</string>
<string name="authentication">Authentication</string>
<string name="edit_secret_hint">secret</string>
@ -39,4 +39,9 @@
<string name="trigger_notification_description">Enable device notification listener. It will scan all notifications it has access to for the secret code. When found it will fire.</string>
<string name="trigger_lock_description">Enable lock job scheduler. It will schedule a job every time you lock a device and cancel it every time you unlock a device. When you do not unlock a device for X time a job will fire.</string>
<string name="trigger_usb_description">Enable USB state receiver. When you make a USB data connection while a device is locked it will fire. It must not fire on charger, only on device and accessory.</string>
<string name="trigger_application_description">Enable fake application. It will add fake messenger applications. Launching them will fire Wasted.</string>
<string name="signal">Signal</string>
<string name="telegram">Telegram</string>
<string name="threema">Threema</string>
<string name="session">Session</string>
</resources>

View File

@ -0,0 +1,3 @@
application trigger
add Norwegian translation, thanks to Frederik
update Italian translation, thanks to Giovanni Donisi (@gdonisi + @giovannidonisi)

View File

@ -6,6 +6,7 @@ Device Administration API, it locks a device and optionally runs wipe.
Also you can:
* fire when a device was not unlocked for X time
* fire when a USB data connection is made while a device is locked
* fire when a fake messenger app is launched
* fire when a duress password is entered (companion app: [Duress](https://github.com/x13a/Duress))
The app works in Work Profile too. Use Shelter to install risky apps and Wasted in it. Then you can

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB