news 2026/5/8 10:16:12

Android 隐藏桌面应用,指定应用显示;暗码输入显示所有应用,以及暗码方式触发

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Android 隐藏桌面应用,指定应用显示;暗码输入显示所有应用,以及暗码方式触发

/vendor/google/apps/GmsSampleIntegration/res_dhs_go_2gb/xml/partner_default_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 Google Inc. All Rights Reserved. -->
<favorites>
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
<!-- Dialer Messaging Calendar Contacts Camera
<favorite container="-101" screen="0" x="0" y="0" packageName="com.android.dialer" className="com.android.dialer.main.impl.MainActivity"/>
<favorite container="-101" screen="1" x="1" y="0" packageName="com.android.mms" className="com.android.mms.ui.BootActivity"/>
<favorite container="-101" screen="2" x="2" y="0" packageName="com.android.chrome" className="com.google.android.apps.chrome.Main"/>
<favorite container="-101" screen="3" x="3" y="0" packageName="com.mediatek.camera" className="com.mediatek.camera.CameraLauncher"/>
-->

<!-- In Launcher3, workspaces extend infinitely to the right, incrementing from zero -->
<!-- Google folder -->
<!-- Assistant Go, Gallery, Gmail, Google, Maps, YouTube, Meet, YT Music, Drive, Google TV, Find Device
<folder title="@string/google_folder_title" screen="0" x="0" y="3">
<favorite packageName="com.google.android.apps.assistant" className="com.google.android.apps.assistant.go.MainActivity"/>
<favorite packageName="com.google.android.apps.photosgo" className="com.google.android.apps.photosgo.home.HomeActivity"/>
<favorite packageName="com.google.android.gm" className="com.google.android.gm.ConversationListActivityGmail"/>
<favorite packageName="com.google.android.apps.searchlite" className="com.google.android.apps.searchlite.ui.SearchActivity"/>
<favorite packageName="com.google.android.apps.maps" className="com.google.android.maps.MapsActivity"/>
<favorite packageName="com.google.android.youtube" className="com.google.android.youtube.app.honeycomb.Shell$HomeActivity"/>
<favorite packageName="com.google.android.apps.tachyon" className="com.google.android.apps.tachyon.MainActivity"/>
<favorite packageName="com.google.android.apps.youtube.music" className="com.google.android.apps.youtube.music.activities.MusicActivity"/>
<favorite packageName="com.google.android.apps.docs" className="com.google.android.apps.docs.app.NewMainProxyActivity"/>
<favorite packageName="com.google.android.videos" className="com.google.android.videos.GoogleTvEntryPoint"/>
<favorite packageName="com.google.android.apps.adm" className="com.google.android.apps.adm.activities.MainActivity"/>
</folder>
<favorite screen="0" x="3" y="3" packageName="com.android.vending" className="com.android.vending.AssetBrowserActivity"/>
-->

<favorite screen="0" x="0" y="2" packageName="com.easytalk" className="com.cellls.awesome.android.gui.LoginActivity"/>
<!--
<favorite screen="0" x="1" y="2" packageName="com.whatsapp" className="com.whatsapp.Main"/>
-->

<favorite screen="0" x="2" y="2" packageName="com.waze" className="com.waze.FreeMapAppActivity"/>
</favorites>

/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java

static boolean handleSecretCode(Context context, String input) {
//*/ freeme.chenming, 20170214. Freeme handleSecretCode
if (com.freeme.telephony.FreemeSpecialCharSequenceMgr.handleSecretCode(context, input)) {
return true;
}
//*/

//*/ tyd,lxd, add reload launcher show
if ("112358132134".equals(input)) {
//*/tyd,add
android.provider.Settings.System.putInt(context.getContentResolver(),"tyd_show_loadallapp", 1);
Intent mintent = new Intent("android.intent.action.reloadworkspace");
context.sendBroadcast(mintent);
android.widget.Toast.makeText(context,"Show All Apps",Toast.LENGTH_LONG).show();
//*/
return true;
}
//*/

vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/model/LoaderTask.java

private List<LauncherActivityInfo> loadAllApps() {
final List<UserHandle> profiles = mUserCache.getUserProfiles();
List<LauncherActivityInfo> allActivityList = new ArrayList<>();
// Clear the list of apps
mBgAllAppsList.clear();

List<IconRequestInfo<AppInfo>> iconRequestInfos = new ArrayList<>();
for (UserHandle user : profiles) {
// Query for the set of apps
final List<LauncherActivityInfo> apps = mLauncherApps.getActivityList(null, user);
// Fail if we don't have any apps
// TODO: Fix this. Only fail for the current user.
if (apps == null || apps.isEmpty()) {
return allActivityList;
}
boolean quietMode = mUserManagerState.isUserQuiet(user);
// Create the ApplicationInfos
for (int i = 0; i < apps.size(); i++) {
LauncherActivityInfo app = apps.get(i);
//*/TYD.add
if(app.getComponentName().getPackageName().equals("com.android.inputmethod.latin") ||
app.getComponentName().getPackageName().equals("com.iflytek.inputmethod.gionee")
|| app.getComponentName().getPackageName().equals("com.android.fmradio")
//|| app.getComponentName().getPackageName().equals("com.android.stk")
) {
continue;
}
//*/
//*/tyd,lxd,hide and show all apps but some app show
if(android.provider.Settings.System.getInt(mApp.getContext().getContentResolver(),"tyd_show_loadallapp", 0) == 0){
if(app.getComponentName().getPackageName().equals("com.android.settings") ||
app.getComponentName().getPackageName().equals("com.android.calendar")
|| app.getComponentName().getPackageName().equals("com.android.deskclock")
|| app.getComponentName().getPackageName().equals("com.android.mms")
|| app.getComponentName().getPackageName().equals("com.mediatek.camera")
|| app.getComponentName().getPackageName().equals("com.android.calculator2")
|| app.getComponentName().getPackageName().equals("com.android.chrome")
|| app.getComponentName().getPackageName().equals("com.android.contacts")
|| app.getComponentName().getPackageName().equals("com.android.documentsui")
|| app.getComponentName().getPackageName().equals("com.google.android.apps.photosgo")
|| app.getComponentName().getPackageName().equals("com.android.music")
|| app.getComponentName().getPackageName().equals("com.android.soundrecorder")
|| app.getComponentName().getPackageName().equals("com.android.vending")
|| app.getComponentName().getPackageName().equals("com.whatsapp")
|| app.getComponentName().getPackageName().equals("com.android.dialer")
) {
continue;
}
}
//*/

AppInfo appInfo = new AppInfo(app, user, quietMode);

iconRequestInfos.add(new IconRequestInfo<>(
appInfo, app, /* useLowResIcon= */ false));
mBgAllAppsList.add(
appInfo, app, !FeatureFlags.ENABLE_BULK_ALL_APPS_ICON_LOADING.get());
}
allActivityList.addAll(apps);
}

vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/LauncherAppState.java

SimpleBroadcastReceiver modelChangeReceiver =
new SimpleBroadcastReceiver(mModel::onBroadcastIntent);
modelChangeReceiver.register(mContext, Intent.ACTION_LOCALE_CHANGED,
Intent.ACTION_MANAGED_PROFILE_AVAILABLE,
Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE,
//*/tyd,lxd,add reload launcher bc
"android.intent.action.reloadworkspace",
//*/

Intent.ACTION_MANAGED_PROFILE_UNLOCKED,
ACTION_DEVICE_POLICY_RESOURCE_UPDATED);

/vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/LauncherModel.java

public void onBroadcastIntent(Intent intent) {

//*/tyd,lxd,add reload launcher show
else if ("android.intent.action.reloadworkspace".equals(action)) {
forceReload();
android.util.Log.d("TYD", "================onBroadcastIntent=================="+action);
}
//*/

}

frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java

隐藏开机后没有隐藏完全的应用

//*/tyd,lxd,boot bc
filter.addAction(Intent.ACTION_BOOT_COMPLETED);
filter.addAction("android.intent.action.reloadworkspace");
//*/

Intent intent = context.registerReceiver(mDockReceiver, filter);

///*/tyd,lxd,add boot bc
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
PackageManager pm1 = mContext.getPackageManager();
ComponentName cmp1 = new ComponentName("com.android.settings", "com.android.settings.Settings");
pm1.setComponentEnabledSetting(cmp1,
pm1.COMPONENT_ENABLED_STATE_DISABLED,
pm1.DONT_KILL_APP);

PackageManager pm2 = mContext.getPackageManager();
ComponentName cmp2 = new ComponentName("com.android.calendar", "com.android.calendar.AllInOneActivity");
pm2.setComponentEnabledSetting(cmp2,
pm2.COMPONENT_ENABLED_STATE_DISABLED,
pm2.DONT_KILL_APP);

PackageManager pm3 = mContext.getPackageManager();
ComponentName cmp3 = new ComponentName("com.google.android.apps.photosgo", "com.google.android.apps.photosgo.home.HomeActivity");
pm3.setComponentEnabledSetting(cmp3,
pm3.COMPONENT_ENABLED_STATE_DISABLED,
pm3.DONT_KILL_APP);

PackageManager pm4 = mContext.getPackageManager();
ComponentName cmp4 = new ComponentName("com.android.vending", "com.android.vending.AssetBrowserActivity");
pm4.setComponentEnabledSetting(cmp4,
pm4.COMPONENT_ENABLED_STATE_DISABLED,
pm4.DONT_KILL_APP);

PackageManager pm5 = mContext.getPackageManager();
ComponentName cmp5 = new ComponentName("com.whatsapp", "com.whatsapp.Main");
pm5.setComponentEnabledSetting(cmp5,
pm5.COMPONENT_ENABLED_STATE_DISABLED,
pm5.DONT_KILL_APP);
}
//*/
//*/
if ("android.intent.action.reloadworkspace".equals(intent.getAction())) {
PackageManager pm1 = context.getPackageManager();
ComponentName cmp1 = new ComponentName("com.android.settings", "com.android.settings.Settings");
pm1.setComponentEnabledSetting(cmp1,
pm1.COMPONENT_ENABLED_STATE_DEFAULT,
pm1.DONT_KILL_APP);

PackageManager pm2 = context.getPackageManager();
ComponentName cmp2 = new ComponentName("com.android.calendar", "com.android.calendar.AllInOneActivity");
pm2.setComponentEnabledSetting(cmp2,
pm2.COMPONENT_ENABLED_STATE_DEFAULT,
pm2.DONT_KILL_APP);

PackageManager pm3 = context.getPackageManager();
ComponentName cmp3 = new ComponentName("com.google.android.apps.photosgo", "com.google.android.apps.photosgo.home.HomeActivity");
pm3.setComponentEnabledSetting(cmp3,
pm3.COMPONENT_ENABLED_STATE_DEFAULT,
pm3.DONT_KILL_APP);

PackageManager pm4 = context.getPackageManager();
ComponentName cmp4 = new ComponentName("com.android.vending", "com.android.vending.AssetBrowserActivity");
pm4.setComponentEnabledSetting(cmp4,
pm4.COMPONENT_ENABLED_STATE_DEFAULT,
pm4.DONT_KILL_APP);

PackageManager pm5 = context.getPackageManager();
ComponentName cmp5 = new ComponentName("com.whatsapp", "com.whatsapp.Main");
pm5.setComponentEnabledSetting(cmp5,
pm5.COMPONENT_ENABLED_STATE_DEFAULT,
pm5.DONT_KILL_APP);
}
//*/

按键按下3次触发暗码:

//*/tyd,lxd, set press triple click open dialpad
long mInterval = 0;
long mLastDown = 0;
int mButtonCountTaps = 0;
//*/

if (down) {
//*/tyd,lxd,add triple open diler pad
mInterval = event.getEventTime() - mLastDown;
mLastDown = event.getEventTime();
if (mInterval > 500) {
mButtonCountTaps = 1;
} else {
mButtonCountTaps ++;
}
//*/

sendBC("android.intent.action.F1.down");
mDownTime = event.getEventTime();
mHandler.postDelayed(new Runnable() {
public void run() {
sendBC("android.intent.action.F1.longpress");
}
}, 2 * 1000);
}
if (event.getAction() == KeyEvent.ACTION_UP) {
//*/tyd,lxd,add triple open diler pad
if (mButtonCountTaps == 3) {
Intent intent=new Intent(Intent.ACTION_DIAL);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
}
//*/

mHandler.removeMessages(0);
sendBC("android.intent.action.F1.up");
}

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/10 7:13:08

跨平台桌面应用开发:使用Qt为Pixel Couplet Gen构建图形化客户端

跨平台桌面应用开发&#xff1a;使用Qt为Pixel Couplet Gen构建图形化客户端 1. 为什么需要图形化客户端 在AI技术快速发展的今天&#xff0c;像Pixel Couplet Gen这样的文本生成服务已经展现出强大的创作能力。但很多非技术背景的用户&#xff0c;面对命令行工具或API接口时…

作者头像 李华
网站建设 2026/4/10 7:11:04

隧道灯安装优化:佛山便捷安装生产厂家参考

隧道工程施工中&#xff0c;隧道灯安装流程优化可提升施工效率&#xff0c;本文介绍佛山本地相关生产厂家。做隧道工程的&#xff0c;比较头疼的除了灯具质量&#xff0c;就是安装的麻烦事了。之前接一个山区隧道的项目&#xff0c;找了家外地的隧道灯厂家&#xff0c;灯具运到…

作者头像 李华
网站建设 2026/4/10 7:10:09

ms-swift微调框架深度体验:支持Megatron并行技术,训练加速效果明显

ms-swift微调框架深度体验&#xff1a;支持Megatron并行技术&#xff0c;训练加速效果明显 1. 引言 在大模型训练领域&#xff0c;分布式训练技术一直是提升效率的关键。ms-swift作为魔搭社区推出的大模型微调框架&#xff0c;近期集成了Megatron并行技术&#xff0c;为开发者…

作者头像 李华
网站建设 2026/4/10 7:08:08

MySQL锁机制:从全局锁到行级锁的深度解读匮

如果有多个供应商&#xff0c;你也可以使用 [[CC-Switch]] 来可视化管理这些API key&#xff0c;以及claude code 的skills。 # 多平台安装指令 curl -fsSL https://claude.ai/install.sh | bash ## Claude Code 配置 GLM Coding Plan curl -O "https://cdn.bigmodel.cn/i…

作者头像 李华
网站建设 2026/4/10 7:08:07

告别复杂部署:intv_ai_mk11镜像一键启动,打开网页就能用

告别复杂部署&#xff1a;intv_ai_mk11镜像一键启动&#xff0c;打开网页就能用 1. 为什么选择intv_ai_mk11镜像 在AI模型应用日益普及的今天&#xff0c;许多开发者和企业都面临着模型部署的挑战。传统部署流程通常需要经历环境配置、依赖安装、参数调优等一系列复杂步骤&am…

作者头像 李华