Skip to content

Commit

Permalink
修复点击多选框无效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kooritea committed Sep 18, 2020
1 parent acb9cc5 commit e7af6ca
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/src/main/java/com/kooritea/fcmfix/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3)
appListAdapter.notifyDataSetChanged();
}
});
this.initHeartbeatInterval();
}

private void initHeartbeatInterval(){
if(this.sharedPreferences.getString("heartbeatInterval","").equals("")){
this.sharedPreferencesEditor.putString("heartbeatInterval","117000");
this.sharedPreferencesEditor.commit();
this.setWorldReadable();
}
}

private void addAppInAllowList(String packageName){
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/kooritea/fcmfix/XposedMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class XposedMain implements IXposedHookLoadPackage {

public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if(loadPackageParam.packageName.equals("android")){
XposedBridge.log("[fcmfix] com.android.server.am.ActivityManagerService");
XposedBridge.log("[fcmfix] start hook com.android.server.am.ActivityManagerService");
new BroadcastFix(loadPackageParam);
}
if(loadPackageParam.packageName.equals("com.google.android.gms")){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.IntentFilter;
import android.os.SystemClock;

import java.util.HashSet;
import java.util.Timer;
import java.util.TimerTask;

Expand All @@ -30,7 +31,14 @@ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable
// 修改心跳间隔
Intent intent = (Intent) XposedHelpers.getObjectField(param.thisObject,"e");
if("com.google.android.gms.gcm.HEARTBEAT_ALARM".equals(intent.getAction())){
param.args[0] = 117000L;
String heartbeatIntervalString = getXSharedPreferences().getString("heartbeatInterval","");
if(heartbeatIntervalString.equals("")){
heartbeatIntervalString = "117000";
}
long heartbeatInterval = new Long(heartbeatIntervalString).longValue();
if(heartbeatInterval>5000L){
param.args[0] = heartbeatInterval;
}
}
}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ protected XSharedPreferences getXSharedPreferences(){
protected void printLog(String text){
Intent log = new Intent("com.kooritea.fcmfix.log");
log.putExtra("text",text);
AndroidAppHelper.currentApplication().getApplicationContext().sendBroadcast(log);
try{
AndroidAppHelper.currentApplication().getApplicationContext().sendBroadcast(log);
}catch (Exception e){
e.printStackTrace();;
}

}
}
2 changes: 2 additions & 0 deletions app/src/main/res/layout/app_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
android:layout_height="match_parent"
android:gravity="center"
android:focusable="false"
android:clickable="false"
android:focusableInTouchMode="false"
android:layoutDirection="rtl" />

</LinearLayout>

0 comments on commit e7af6ca

Please sign in to comment.