articles's People
articles's Issues
Android Google Servive与 SSR导致的耗电的解决过程
在刚升级Android 8.0 之后,电池明显耐用了几天。但随后续航就崩了,为了找回自信的感觉,研究了一番,终于找到了原因
1. BetterBatteryStatus查看Partial Wakelocks
//图片1
发现Google服务的GCM一直在搞事情
于是就Google关键字“Google GCM ShadowsocksR"
看到有人用*##426##*拨号盘来打开gcm的分析页面,来检查gcm频繁唤醒的原因。
3. 用Nova Launcher打开GCM status页面
但是我无法使用”##426##“来打开,又看到有人回复可以用Nova Launcher来打开Activity,于是就去搜对应方法。
//图2
结果居然是在Nova手势快捷栏里的活动列表,就是一个跟其他快捷方式长得一样的图标,点进去居然能获取到所有app的activitiy,Nova真的是太强了。
将gcm 分析页面设置为双击启动,成功打开了该页面
4. 用gcm event 找原因
//图3
可以看到gcm一直在接收一个app,我搜了一下,居然是Amoled Wallpapers,这玩意儿我不是早删掉了吗?为什么还要接收它?
然后我又安装了它,好像GCM不怎么接收它了。但是换成了另外的提示:一直断线重连。
5. 搜找到的关键字
这跟我之前搜索到的别人的问题是一样的,于是就仔细的在各个issues之间跳来跳去,大概判断出来,需要把SSR的服务器timeout修改为600.
6. 修改服务器timeout
因为我当初用的是一个魔改一键安装版本的SSR服务器,所以在安装过程中没有修改timeout的地方,然后我发现了可以修改etc文件夹的shadowsocks.json文件来修改timeout.
最后利用以前收藏的重启SSR服务器命令来重启,好像就没有一直重连的问题了。
7. 还有问题
//图片4
因为我以为问题解决了,就把Amoled Wallpapers删掉了,过一会儿再看GCM event,又看到它一直在Receive Amoled Wallpapers,无奈又要下回来,不知道这要怎么办了
8. 再次修改timeout
又思考了一下timeout有什么用,GCM event变成大概10几分钟一次了。看了别人的分析,我觉得大概是移动网络的问题。GCM需要接收返回信息,移动网络不行,接收不到,超过了服务器的timeout,就自己关了。
因为移动网络是难换的,就只能再把timeout设置的大一点。
需要同时设置服务器和客户端的timeout。
服务器的timeout就是刚刚设置的方式。
客户端的没有设置的页面,想要Fork源代码,修改参数之后再编译,但是看到Readme里写着不能Windows编译,下面的编译操作也很复杂,就算了。
又看到可以用MT管理器修改,就按照教程,搜索classes.dex文件的参数,修改timeout为3000,然后编译,重新签名,安装。
现在应该就剩下那个Wallpapers搞不懂了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.