图片谨以悼念那个在手机设计上富有活力的索尼爱立信,那颗曾经充满创造力的“绿色小心脏”再也不会跳动了。
我看到的最原始来源是这里:http://bbs.gfan.com/android-8395526-1-1.html
步骤简单来说是这个样子的:
首先,你得打开手机的开发者模式;
然后,手机用数据线连接上电脑,(手机上建议除了提示授权开发者模式连接权限外,啥都别点);
打开adb窗口,先用命令:adb devices 看看设备是否正常,
如果显示offline的话,试试更换最新版本的adb,或者把手机重启下;
正常连接上adb后,按需求执行一下命令:
全屏沉浸模式(包括状态栏和虚拟按键): adb shell settings put global policy_control immersive.full=*
沉浸状态栏:adb shell settings put global policy_control immersive.status=*
沉浸虚拟按键(隐藏后底部上划可以呼出):adb shell settings put global policy_control immersive.navigation=*
恢复正常模式(如果不想用上面这些了):adb shell settings put global policy_control null
对于悲剧的大法,沉浸虚拟键后相机界面会杯具(无法退出,别问我怎么知道的:sm30 )。解决方案是执行下面的命令(其实就是让相机界面里不隐藏虚拟键):
Adb shell settings put global policy_control immersive.full=apps,-com.sonyericsson.android.camera,-com.android.settings
好啦,就这些这些神奇的玩意儿。这几项在本人的Z5上是正常工作的,目前没发现什么可见的副作用(相机的已被解决)。大家按需使用吧。
PS:没ROOT的安卓简直连咸鱼都不如:sm31
adb去叹号方案:
来源:https://www.evil42.com/index.php/archives/17/
5.0 - 6.x教程
5和6还不支持HTTPS,直接修改即可
检测开关相关:
先处理开关状态,这个变量删除就是默认开启的,删除操作随意执行,反正没影响,删除状态下获取这个变量会返回null。
注意:如果关闭,则无法判断当前网络是否需要登录,无法自动弹出登录页面
删除
adb shell settings delete global captive_portal_server
禁用
adb shell settings put global captive_portal_server 0
查询状态
adb shell settings get global captive_portal_server
服务器地址相关:
删除地址就可以恢复默认的谷歌服务器
adb shell settings delete global captive_portal_server
设置一个可用地址(高通/V2EX都推荐)
adb shell settings put global captive_portal_server captive.v2ex.co
查询当前地址
adb shell settings get global captive_portal_server
7.0 - 7.1教程
这两个版本相比5和6没有大的更改,只是默认连接服务器的时候使用HTTPS,但是提供了一个开关用以指定是否使用HTTPS
检测开关相关:
同5.0 - 6.x
HTTPS开关相关:
删除(直接删除则默认使用HTTPS)
adb shell settings delete global captive_portal_use_https
禁用HTTPS(写1启用 写0禁用)
adb shell settings put global captive_portal_use_https 0
查询HTTPS开关状态
adb shell settings get global captive_portal_use_https
服务器地址相关:
(如果启用了HTTPS需要先确定地址是否支持HTTPS)
同5.0 - 6.x
7.1.1教程
这个版本把HTTPS和HTTP两个地址分开保存,并通过7.0加入的HTTPS开关来控制使用哪一个地址。
检测开关相关:
同5.0 - 6.x
HTTPS开关相关:
同7.0 - 7.1
服务器地址相关:
删除(删除默认用HTTPS)
adb shell settings delete global captive_portal_https_url
adb shell settings delete global captive_portal_http_url
分别修改两个地址
adb shell settings put global captive_portal_http_url http://captive.v2ex.co/generate_204
adb shell settings put global captive_portal_https_url https://captive.v2ex.co/generate_204
7.1.2教程
此版本服务器地址判断逻辑相比7.1.1没有更改,但是检测的开关却变了。
检测开关:
删除变量:(删除以后默认启用)
adb shell settings delete global captive_portal_mode
关闭检测:
adb shell settings put global captive_portal_mode 0
查看当前状态:
adb shell settings get global captive_portal_mode
服务器地址相关(同7.1.1):
删除(删除默认用HTTPS)
adb shell settings delete global captive_portal_https_url
adb shell settings delete global captive_portal_http_url
分别修改两个地址
adb shell settings put global captive_portal_http_url http://captive.v2ex.co/generate_204
adb shell settings put global captive_portal_https_url https://captive.v2ex.co/generate_204
8.0.0和8.1.0和9.0(Android P)同上7.1.2,未做修改