安卓中Settings.apk的修改

原文地址

先转过来,慢慢看。。。

标题:Does anyone know how to edit Settings.apk? [Solved!]

提问:

I've been trying to do this for some time, but I've hit a wall. I want to take the Settings.apk from my current rom (which ever one it happens to be). Decompile it. Edit some entries. Then recompile and sign it, so that I can use it with said rom. 

I've tried using apktool (and a few automated versions of it). It works great to decompile and recompile. I then use signapk.jar to sign the apk using a test key. But when I copy Settings.apk over to my /system/app folder, change the permissions, and reboot, the settings menu fails to load and my wallpaper disappears.

I thought that it might be edits I am making. So I tried decompiling, recompiling, and signing with no edits and I still get the same problem where the settings menu fails to load. 

I even tried following this crazy guide: [HOW-TO] Modify the Keyboard and Screen Timeouts Settings
But I had the same problem. 

I have successfully used apktool and my signing tool to edit and use other apk files. So I know that they work. Can anyone (probably a dev) explain what I'm doing wrong?

Thanks!

Update: Solution

------------------------

Originally Posted by  mmarz  View Post
Here is how you can do it yourself:
(自己翻译一下下面的步骤,水平有效,可能有出入)
  1. Download: Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux) - xda-developers(下载Apk Manager工具,最新下载地址http://apkmultitool.com/?q=node/5。注意5.0是linux版本,5.0.2是Windows的版本哦)
  2. Get your Settings.apk off of your phone either with root explorer or adb:(将Settings.apk文件从手机提取出来)
    Code:
    adb pull /system/app/Settings.apk
  3. Keep a copy of Settings.apk somewhere safe.(保存一份备份,以便修改失败后再来一次)
  4. Place one copy into the "place-apk-here-for-modding" folder in apk manager.(复制一份到"place-apk-here-for-modding" 目录
  5. Run Script.bat.(运行Script.bat脚本)
  6. Enter option 22.(进入选项22-Set Current Project,将APK文件加载到当前工程)
  7. Select the Settings.apk(选择 Settings.apk)
  8. Enter option 9.(进入选项9-Decompile apk,对apk反编译)
  9. Open folder projects\Settings.apk\res\xml\(打开文件夹 projects\Settings.apk\res\xml\
  10. Open settings.xml in notepad or any other simple text editor.(用记事本或其他文本编辑工具打开 settings.xml 文件
  11. Remove these lines:(删除以下内容)
    Code:
       <com.android.settings.IconPreferenceScreen android:title="@string/privacy_settings" android:key="privacy_settings" settings:icon="@drawable/ic_settings_privacy">
            <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.PrivacySettings" />
      </com.android.settings.IconPreferenceScreen>
  12. Save the file.(保存文件)
  13. Enter option 11 in app manager. (进入选项11-Compile apk,编译apk)
  14. Enter "y" (yes) for if this is a system apk. (输入‘y’若修改的文件是系统文件的话,此处我们输入y)
  15. Enter "y" for the next option too.(接下来还是输入‘y’)
  16. Open the newly created "keep" folder inside of your app manager folder. (在app manager目录中打开最新生成的‘keep’文件夹)
  17. Delete resources.arsc (删除 resources.arsc 文件
  18. Then delete keep\res\xml\settings.xml (接着删除 keep\res\xml\settings.xml 文件
  19. Go back to app manager and hit enter to continue. (返回 app manager 目录,输入‘回车’继续)
  20. Look inside "place-apk-here-for-modding" and find your newly created "unsignedSettings.apk" (在"place-apk-here-for-modding" 目录找到最新生成的unsignedSettings.apk"文件
  21. I used this file and it worked great. Signing it broke it for some reason. ( 我试用过这个文件,它允许的很好,对其签名时由于一些问题损坏了)
  22. Copy "unsignedSettings.apk" to the folder that contains adb.exe and rename it to "Settings.apk" (复制unsignedSettings.apk"文件到包含 adb.exe的目录然后重命名为 Settings.apk"
  23. Open command prompt and enter: (打开命令行输入以下命令:)
    Code:
    adb remount
    adb push Settings.apk /system/app/Settings.apk
    adb shell chmod 644 /system/app/Settings.apk
    adb reboot

If everything went right, your settings should load like normal but privacy should be gone now. If something went wrong, your wallpaper will be gone and settings will not load. Retrace your steps in that event. Maybe try signing the  apk. Who knows why only the unsigned version works for me?
(如果一切正常的话,你的 Settings 会开起来正常但是“隐私”项会不见了。若是操作有误的话,你的壁纸会消失,而且Settings不能加载。你要重新再进行下上面的步骤。你也可以尝试对apk签名。谁知道为什么只有未签名的版本在我这上面有效?)
-----------------------------

Thank you so much for posting this walk-through. I was trying to change the icons in the settings menu to the ICS icons and for some reason it wasn't working. After reading the walk-through (and testing) I realized it was because I was entering "n" on the second question after compiling. Now my settings menu looks awesome! 


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 在Android设备上,搜索5GHz Wi-Fi的关键是Wi-Fi芯片集成电路和设备驱动程序。但是,有时候搜索不到5GHz Wi-Fi的原因可能是由于设备的硬件限制,例如缺乏5GHz Wi-Fi支持的无线网卡。 如果你的设备支持5GHz Wi-Fi,但是搜索不到,请确保以下设置: 1. 确认无线路由器支持5GHz Wi-Fi并已经打开。 2. 确保设备和路由器之间的距离不要太远。 3. 确保设备的Wi-Fi设置的“高级选项”的“Wi-Fi频段”设置为“自动”或“5GHz优先”。 如果上述步骤都没有解决问题,请尝试重启设备和路由器,并确保使用最新的设备驱动程序和操作系统版本。 ### 回答2: 安卓 settings.apk安卓系统的设置应用程序,常用于对设备进行个性化配置和管理。在这个应用程序,没有特定的参数可以直接控制设备的 WiFi 搜索功能,因为这是设备的无线模块和驱动程序的功能。 通常情况下,设备是否可以搜索到5GHZ WiFi 信号,取决于设备的无线网卡硬件和驱动程序是否支持该频段。大多数现代设备都支持5GHZ WiFi,但仍然有一些旧设备或低端设备可能不支持。 要在设备搜索和连接5GHZ WiFi,可以按照以下步骤进行操作: 1. 打开设备的设置应用程序 (settings.apk)。 2. 在设置界面找到 "无线和网络" 或类似的选项,点击进入。 3. 在无线和网络设置,找到 "Wi-Fi" 选项,点击进入。 4. 在 Wi-Fi 设置界面,找到 "附近的网络" 或类似的选项,点击进入。 5. 在附近的网络列表,系统会自动搜索和显示附近的 Wi-Fi 网络。 6. 如果设备的无线网卡硬件和驱动程序支持5GHZ频段,设备会显示包含5GHZ频段的无线网络。 7. 选择你想要连接的5GHZ WiFi 网络,输入密码或其他必要的信息进行连接。 需要注意的是,5GHZ WiFi 的搜索和连接功能可能在不同的设备和安卓版本有所差异。如果你的设备无法搜索到5GHZ WiFi,可以尝试更新设备的系统版本或者咨询设备制造商的技术支持部门以获得进一步的帮助。 ### 回答3: 在安卓设备的settings.apk应用程序,允许设备搜索到5GHz WiFi需要调整的参数是WiFi频段选择的设置。 在许多安卓设备,默认设置为自动选择WiFi频段。这意味着设备会自动搜索并连接到可用的2.4GHz或5GHz WiFi网络。然而,某些设备可能会优先选择2.4GHz频段,因为它的传输范围更广,尽管5GHz频段可以提供更大的带宽和速度。 要让设备能够搜索到5GHz WiFi,可以在设置应用程序找到无线和网络部分,或者叫作Wi-Fi设置,然后进入高级设置或类似选项。在这里,可以找到WiFi频段选择的选项,并将其设置为5GHz。这样一来,设备将主动搜索并连接可用的5GHz WiFi网络。 需要注意的是,不是所有的设备都支持5GHz WiFi,这取决于设备的硬件能力。因此,即使将WiFi频段选择设置为5GHz,如果设备不支持该频段,仍然无法搜索到5GHz WiFi。在购买设备时,请仔细查看设备的规格和技术规范,确保其支持5GHz WiFi。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值