Developer options toast insulter

Inspired by the Bash insulter written by hkbakke

https://www.ostechnix.com/bash-insulter-script-insults-user-typing-wrong-command/

Change-Id: I48d52de431de1eedf7a965a83a7dcb464ef3ed3a
Signed-off-by: Joey Huab <joey@evolution-x.org>
Signed-off-by: AnierinB <anierin@evolution-x.org>
This commit is contained in:
Mazda--
2024-04-09 02:09:52 +00:00
committed by Joey
parent ce4586c514
commit 530e4adc08
2 changed files with 26 additions and 3 deletions

View File

@@ -46,8 +46,6 @@
}</string>
<!-- [CHAR LIMIT=NONE] Device Info screen. Confirmation that developer settings are enabled -->
<string name="show_dev_on_cm">You have enabled development settings!</string>
<!-- [CHAR LIMIT=NONE] Device Info screen. Okay we get it, stop pressing, you already have it on -->
<string name="show_dev_already_cm">No need, you have already enabled development settings.</string>
<!-- Double tap to sleep on status bar or lockscreen -->
<string name="status_bar_double_tap_to_sleep_title">Tap to sleep</string>

View File

@@ -52,6 +52,8 @@ import com.android.settingslib.utils.StringUtil;
import com.google.android.setupcompat.util.WizardManagerHelper;
import java.util.Random;
public class BuildNumberPreferenceController extends BasePreferenceController implements
LifecycleObserver, OnStart {
@@ -70,6 +72,27 @@ public class BuildNumberPreferenceController extends BasePreferenceController im
private int mDevHitCountdown;
private boolean mProcessingLastDevHit;
public final static java.lang.String[] insults = {
"Hahaha, n00b!",
"What are you doing??",
"n00b alert!",
"What is this...? Amateur hour!?",
"This is not Windows",
"Please step away from the device!",
"error code: 1D10T",
"Go touch some grass",
"¯\\_(ツ)_/¯",
"Pro tip: Stop doing this",
"Perhaps this Android thing is not for you...",
"Don't you have anything better to do?",
"Looks like you're evolving... Just BACKWARDS!",
"This won't make you look cooler to your friends",
"Go back to your stock ROM",
"FBI! OPEN UP!",
"Would you prefer iOS next time?",
"We should hack your device just for this",
};
public BuildNumberPreferenceController(Context context, String key) {
super(context, key);
mUm = (UserManager) context.getSystemService(Context.USER_SERVICE);
@@ -201,7 +224,9 @@ public class BuildNumberPreferenceController extends BasePreferenceController im
if (mDevHitToast != null) {
mDevHitToast.cancel();
}
mDevHitToast = Toast.makeText(mContext, R.string.show_dev_already_cm,
Random randomInsult = new Random();
final int toasts = randomInsult.nextInt(insults.length);
mDevHitToast = Toast.makeText(mContext, insults[toasts],
Toast.LENGTH_LONG);
mDevHitToast.show();
mMetricsFeatureProvider.action(