Skip to content

Commit

Permalink
仅支持203615037
Browse files Browse the repository at this point in the history
  • Loading branch information
kooritea committed Oct 1, 2020
1 parent 9e92ca6 commit 566fa20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
使用xposed让被完全停止的应用响应fcm,让fcm送达率达到100%,不错过任何通知

- 允许fcm唤醒选中的应用来发送通知
- 修复在国内网络下出现重连服务出现负数问题
- 固定心跳间隔为117s
- 修复在国内网络下出现重连服务出现负数问题(仅203615037有效)
- 固定心跳间隔为117s(仅203615037有效)

## 注意
在国内版miui上,除了在本应用中勾选目标应用之外,还要给予目标应用自启动权限中的允许系统唤醒权限(eu版和国际版则不需要给自启动权限)
在国内版miui上,除了在本应用中勾选目标应用之外,还要给予目标应用自启动权限中的允许系统唤醒权限(eu版和国际版则不需要给自启动权限)

## todo
没想到版本更新后混淆名称会变,支持多版本的事等之后有空再说吧
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ public ReconnectManagerFix(XC_LoadPackage.LoadPackageParam loadPackageParam) {

protected void startHook(){
this.GcmChimeraService = XposedHelpers.findClass("com.google.android.gms.gcm.GcmChimeraService",loadPackageParam.classLoader);
XposedHelpers.findAndHookMethod(XposedHelpers.findClass("abbo",loadPackageParam.classLoader),"a", long.class, new XC_MethodHook() {
XposedHelpers.findAndHookMethod(XposedHelpers.findClass("abcn",loadPackageParam.classLoader),"a", long.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
// 修改心跳间隔
Intent intent = (Intent) XposedHelpers.getObjectField(param.thisObject,"e");
Intent intent = (Intent) XposedHelpers.getObjectField(param.thisObject,"d");
if("com.google.android.gms.gcm.HEARTBEAT_ALARM".equals(intent.getAction())){
param.args[0] = 117000L;
}
}
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
// 防止计时器出现负数计时,分别是心跳计时和重连计时
Intent intent = (Intent) XposedHelpers.getObjectField(param.thisObject,"e");
Intent intent = (Intent) XposedHelpers.getObjectField(param.thisObject,"d");
if("com.google.android.intent.action.GCM_RECONNECT".equals(intent.getAction()) || "com.google.android.gms.gcm.HEARTBEAT_ALARM".equals(intent.getAction())){
new Timer("ReconnectManagerFix").schedule(new TimerTask() {
@Override
public void run() {
long nextConnectionTime = XposedHelpers.getLongField(param.thisObject,"g");
long nextConnectionTime = XposedHelpers.getLongField(param.thisObject,"f");
if(nextConnectionTime !=0 && nextConnectionTime - SystemClock.elapsedRealtime() < 0){
AndroidAppHelper.currentApplication().getApplicationContext().sendBroadcast(new Intent("com.google.android.intent.action.GCM_RECONNECT"));
printLog("Send broadcast GCM_RECONNECT");
Expand Down

0 comments on commit 566fa20

Please sign in to comment.