玩机兴趣一般都是从机型的美化界面开始。虽然目前各机型多种多样的主题很多,但有些方面主题是替代不了的。玩出与别人不同的风格。今天的帖子给朋友梦分享下修改miui机型设置选项的一些与众不同的操作。
千篇一律的官方miui设置界面与修改的界面对比
?
一.? 首先我们要对miui机型的设置选项进行反编译.app名字为Settings.apk.通过反编译.文件在系统的路径为--安卓11 12:/system/system_ext/priv-app/Settings/Settings.apk 安卓10:/system/product/priv-app/Settings/Settings.apk 安卓9:/system/priv-app/Settings/Settings.apk
机型不同 可能略有差异。反编译后为下图所示文件组成;
找到/res/xml/settings_header.xml 打开后如下
**********一般这个app的类似全代码为
<!-- <?xml version="1.0" encoding="utf-8"?> -->
<preference-headers xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:miuisettings="http://schemas.android.com/apk/miuisettings" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:miui="http://schemas.android.com/apk/res/miui" xmlns:aapt="http://schemas.android.com/aapt">
<header android:icon="@drawable/ic_account_avatar" android:id="@+id/mi_account_settings" android:title="@string/unlogin_account_title">
<intent android:targetPackage="com.xiaomi.account" android:action="android.settings.XIAOMI_ACCOUNT_SYNC_SETTINGS"/>
<extra android:name="account_type" android:value="com.xiaomi"/>
</header>
<header android:icon="@drawable/ic_my_device" android:id="@+id/my_device" android:title="@string/my_device" android:fragment="com.android.settings.device.MiuiMyDeviceSettings"/>
<header android:icon="@drawable/ic_system_apps_updater" android:id="@+id/system_apps_updater" android:title="@string/system_apps_updater">
<intent android:targetPackage="com.xiaomi.discover" android:targetClass="com.xiaomi.market.ui.UpdateAppsActivity"/>
</header>
<header android:icon="@drawable/ic_security_status" android:id="@+id/security_status" android:title="@string/security_status" android:fragment="com.android.settings.MiuiSecurityStatusSettings"/>
<header/>
<header android:icon="@drawable/ic_settings_dualsim" android:id="@+id/msim_settings" android:title="@string/sim_management_title">
<intent android:targetPackage="com.android.phone" android:action="android.intent.action.MAIN" android:targetClass="com.android.phone.settings.MobileNetworkSettings"/>
</header>
<header android:icon="@drawable/ic_wifi_settings" android:id="@+id/wifi_settings" android:title="@string/wifi_settings_title">
<intent android:targetPackage="com.android.settings" android:action="android.settings.WIFI_SETTINGS"/>
</header>
<header android:icon="@drawable/ic_bluetooth_settings" android:id="@+id/bluetooth_settings" android:title="@string/bluetooth_settings_title" android:fragment="com.android.settings.bluetooth.MiuiBluetoothSettings"/>
<header android:icon="@drawable/ic_portable_wlan_hotspot_settings" android:id="@+id/wifi_tether_settings" android:title="@string/wifi_tether_settings_title">
<intent android:targetPackage="com.android.settings" android:targetClass="com.android.settings.Settings$TetherSettingsActivity"/>
</header>
<header android:icon="@drawable/ic_vpn" android:id="@+id/vpn_settings_multiple" android:title="@string/vpn_settings_title" android:fragment="com.android.settings.vpn2.MiuiVpnSettings"/>
<header android:id="@+id/operator_settings" android:fragment="com.android.settings.WirelessSettings">
<intent android:action="com.android.settings.OPERATOR_APPLICATION_SETTING"/>
</header>
<header android:icon="@drawable/ic_device_connection" android:id="@+id/wireless_settings" android:title="@string/connection_and_sharing" android:fragment="com.android.settings.MiuiWirelessSettings" android:breadCrumbTitle="@string/wireless_networks_settings_title"/>
<header/>
<header android:icon="@drawable/ic_multiple_users" android:id="@+id/user_settings" android:title="@string/user_settings_title" android:fragment="com.android.settings.users.UserSettings"/>
<header android:icon="@drawable/ic_unlock_set_settings" android:id="@+id/screen_settings" android:title="@string/aod_and_lock_screen_settings_title" android:fragment="com.android.settings.AodAndLockScreenSettings"/>
<header android:icon="@drawable/ic_display_settings" android:id="@+id/display_settings" android:title="@string/display_settings" android:fragment="com.android.settings.MiuiDisplaySettings"/>
<header android:icon="@drawable/ic_sound_settings" android:id="@+id/sound_settings" android:title="@string/sound_vibrate_settings" android:fragment="com.android.settings.MiuiSoundSettings"/>
<header android:icon="@drawable/ic_notification_center" android:id="@+id/notification_center" android:title="@string/notification_center">
<intent android:targetPackage="com.miui.notification" android:action="android.settings.ALL_APPS_NOTIFICATION_SETTINGS"/>
</header>
<header android:icon="@drawable/ic_miui_home_settings" android:id="@+id/launcher_settings" android:title="@string/home_title">
<intent android:targetPackage="com.miui.home" android:action="android.intent.action.MAIN" android:targetClass="com.miui.home.settings.MiuiHomeSettingActivity"/>
</header>
<header android:icon="@drawable/ic_wallpaper_settings" android:id="@+id/wallpaper_settings" android:title="@string/wallpaper_settings_title">
<intent android:targetPackage="com.miui.miwallpaper" android:targetClass="com.miui.miwallpaper.activity.WallpaperSettingActivity"/>
</header>
<header android:icon="@drawable/com_android_thememanager" android:id="@+id/theme_settings" android:title="@string/theme_settings_title">
<intent android:targetPackage="com.android.thememanager" android:targetClass="com.android.thememanager.activity.ThemeSettingsActivity"/>
</header>
<header/>
<header android:icon="@drawable/ic_security_settings_settings" android:id="@+id/security_settings" android:title="@string/password_and_security" android:fragment="com.android.settings.security.MiuiSecurityAndPrivacySettings"/>
<header android:icon="@drawable/ic_privacy_protection" android:id="@+id/privacy_protection_settings" android:title="@string/privacy_protection">
<intent android:action="miui.intent.action.PRIVACY_SETTINGS"/>
</header>
<header android:icon="@drawable/ic_battery_settings" android:id="@+id/battery_settings" android:title="@string/power_usage_summary_title">
<intent android:action="miui.intent.action.POWER_HIDE_MODE_ACTIVITY"/>
</header>
<header android:icon="@drawable/ic_battery_settings" android:id="@+id/battery_settings_new" android:title="@string/power_usage_summary_title_new">
<intent android:action="miui.intent.action.POWER_MANAGER"/>
</header>
<header android:icon="@drawable/ic_system_app_settings" android:id="@+id/application_settings" android:title="@string/applications_settings_title" android:fragment="com.android.settings.applications.MiuiApplicationsSettings"/>
<header android:icon="@drawable/ic_other_advanced_settings" android:id="@+id/other_advanced_settings" android:title="@string/other_advanced_settings" android:fragment="com.android.settings.personal.OtherPersonalSettings"/>
<header/>
<header android:icon="@drawable/xiaoai" android:id="@+id/voice_assist" android:title="@string/voice_assist">
<intent android:action="miui.intent.action.APP_SETTINGS"/>
</header>
<header android:icon="@drawable/ic_app_timer" android:id="@+id/app_timer" android:title="@string/usage_state_app_timer" android:fragment="com.android.settings.usagestats.UsageStatsMainFragment"/>
<header android:icon="@drawable/ic_miui_lab_settings" android:id="@+id/other_special_feature_settings" android:title="@string/miui_special_feature" android:fragment="com.android.settings.special.OtherSpecialFeatureSettings"/>
<header android:id="@+id/manufacturer_settings">
<intent android:action="com.android.settings.MANUFACTURER_APPLICATION_SETTING"/>
</header>
<header/>
<header android:icon="@drawable/xiaomi_account" android:id="@+id/micloud_settings" android:title="@string/xiaomi_account">
<intent android:targetPackage="com.xiaomi.account" android:action="android.settings.XIAOMI_ACCOUNT_SYNC_SETTINGS"/>
<extra android:name="account_type" android:value="com.xiaomi"/>
</header>
<header android:icon="@drawable/ic_account_settings" android:id="@+id/account_list" android:title="@string/sync_settings" android:fragment="com.android.settings.accounts.MiuiAccountSettings"/>
<header android:id="@+id/global_feedback_category"/>
<header android:icon="@drawable/ic_privacy_settings" android:id="@+id/privacy_settings" android:title="@string/privacy_dashboard_title">
<intent android:action="android.settings.PRIVACY_SETTINGS"/>
</header>
<header android:icon="@drawable/ic_location_info_settings" android:id="@+id/location_settings" android:title="@string/location_settings_title" android:fragment="com.android.settings.location.LocationSettings"/>
<header android:icon="@drawable/ic_bugreport_settings" android:id="@+id/feedback_services_settings" android:title="@string/feedback_settings">
<intent android:action="miui.intent.action.miservice"/>
</header>
</preference-headers>
*******我们可以在设置首界面添加一些语句或者其他。类似
?
*********代码如下;
<!-- <?xml version="1.0" encoding="utf-8"?> -->
<preference-headers xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:miuisettings="http://schemas.android.com/apk/miuisettings" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:miui="http://schemas.android.com/apk/res/miui" xmlns:aapt="http://schemas.android.com/aapt">
<header android:title="只有经历过地狱般的折磨,才有征服天堂的力量。只有流过血的手指才能弹出世间的绝唱。"/>
<header android:title="自己要先看得起自己,别人才会看得起你。"/>
<header android:title="加油 奥利给"/>
***********还可以这样修改效果。其实原理都是一样的
?**********代码添加:
<!-- <?xml version="1.0" encoding="utf-8"?> -->
<preference-headers xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:miuisettings="http://schemas.android.com/apk/miuisettings" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:miui="http://schemas.android.com/apk/res/miui" xmlns:aapt="http://schemas.android.com/aapt">
<header android:title=" 鸡蛋,从外打破是食物,从内打破是生命,人生也是如此,从外打破是压力,从内打破是成长。谁爱逼逼就揍谁 达二文 " />
二。有的友友们可能要问了。设置或者其他菜单类的可以修改名字吗。答案是肯定的
来看效果图
下方的各自图标其实都是可以修改替换的,我只是图个方便给朋友梦演示下。
?有的朋友有问了? miui版本那里可以修改吗?看图
?那么可以在设置里增加选项吗,可以的 类似
代码如下;
<header
android:icon="@drawable/ic_my_device"
android:title="高级设置">
<intent
android:targetPackage="com.miui.gaojishezhi.plus"
android:action="android.intent.action.MAIN"
android:targetClass="com.iapp.app.logoActivity"/>
</header>
其中ison为图标路径
title为设置选项下的名字。可以随意填写
其余的为软件真实英文名字与跳转和快捷方式等
提示;
Settings.apk包含了设置所有的图标.文字 布局等等。其实apk类的我前面的帖子就有说明。电脑有解压软件的。右击就可以解压查看里面所有的文件包括图片。通过反编译软件替换即可达到修改的目的、
不管哪种操作,记得完成后替换到Settings.apk系统真实路径里更改权限。否则设置进不去. 严重会导致进不去系统的问题。当然你也可以做包的时候把反编译后的Settings.apk替换源文件打包即可。
关注我带你了解安卓玩机搞机的一些基本技巧和故障解决.期待我的教程贴能带给你帮助。如果可以希望获得打赏? 谢谢
|