Skip to content

Commit

Permalink
Fix bad theme
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Jan 7, 2020
1 parent 3dd7b82 commit 4f5cf52
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 112 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ QNotified is a Xposed module for mobile QQ that aims to
- QQ内模块界面主题自动跟随QQ主题或ColorQQ(2).

**功能介绍**
1. 可以设置隐藏消息列表上方小程序入口
2. 可屏蔽 \@全体成员 或者 群红包 的通知(不影响接收消息,不影响某些插件抢红包功能)
1. 隐藏消息列表小程序入口
2. 屏蔽 \@全体成员 或者 群红包 的通知(不影响接收消息,不影响某些插件抢红包功能)
3. 语音消息转发
4. 文本消息群发(原QQHelper)
5. 以图片方式打开闪照(原辅助模块)
Expand All @@ -26,6 +26,8 @@ QNotified is a Xposed module for mobile QQ that aims to
9. 被删好友通知
10. 防撤回(实验性,不稳定)
11. 签到文本化,隐藏礼物动画
12. 简洁模式圆头像(from Rikka)
13. 屏蔽QQ更新提示

**在建功能** (未必一次更新全部到位)
1. 查看已删除好友的聊天记录
Expand All @@ -36,16 +38,15 @@ QNotified is a Xposed module for mobile QQ that aims to
6. 屏蔽回执消息通知
7. 自定义复读次数
8. 修复偶发性的莫名其妙好友全部被标记为删除的bug
9. 屏蔽更新提示

**考虑中功能**
1. 去你大爷的TX地图
2. _用户建议_ 打开网页请用户选择使用内置浏览器或外部浏览器(可设置)
2. _用户建议_ 打开网页请用户选择使用内置浏览器或外部浏览器
3. _用户建议_ (可详细设置)在某些情景模式下禁用QQ提醒功能

**如发现bug或好的建议请在Issue区留言**

本模块是完全免费开源的,近期发现模块倒卖现象非常严重,请勿上当
本模块完全免费开源,近期发现模块倒卖现象严重,请勿上当

(EE) CET4 failed,update halted.

4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="nil.nadph.qnotified"
android:versionName="0.5.1"
android:versionCode="19">
android:versionName="0.5.2"
android:versionCode="20">

<uses-sdk
android:targetSdkVersion="27"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/xposed_init
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nil.nadph.qnotified.HookLoader
nil.nadph.qnotified.HookEntry
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
LinearLayout.LayoutParams _lp_fat = new LinearLayout.LayoutParams(MATCH_PARENT, 0);
_lp_fat.weight = 1;
//__ll.addView(bounceScrollView,_lp_fat);
//sdlv.setBackgroundColor(0xFFAA0000)
ActProxyMgr.setContentBackgroundDrawable(self, QThemeKit.skin_background);
invoke_virtual(self, "setTitle", "关于", CharSequence.class);
invoke_virtual(self, "setImmersiveStatus");
invoke_virtual(self, "enableLeftBtn", true, boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
invoke_virtual(self, "setTitle", "打赏", CharSequence.class);
invoke_virtual(self, "setImmersiveStatus");
invoke_virtual(self, "enableLeftBtn", true, boolean.class);
ActProxyMgr.setContentBackgroundDrawable(self, QThemeKit.skin_background);
//TextView rightBtn=(TextView)invoke_virtual(self,"getRightTextView");
//log("Title:"+invoke_virtual(self,"getTextTitle"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
rl.addView(tv, mwllp);
rl.addView(sdlv, mmlp);
self.setContentView(rl);
//sdlv.setBackgroundColor(0xFFAA0000)
invoke_virtual(self, "setTitle", "历史好友", CharSequence.class);
invoke_virtual(self, "setImmersiveStatus");
invoke_virtual(self, "enableLeftBtn", true, boolean.class);
Expand Down Expand Up @@ -117,6 +116,7 @@ public void run(){
exm.clearUnreadFlag();
tv.setText("最后更新: " + Utils.getRelTimeStrSec(exm.lastUpdateTimeSec) + "\n长按列表可删除");
QQViewBuilder.listView_setAdapter(sdlv, this);
ActProxyMgr.setContentBackgroundDrawable(self, QThemeKit.skin_background);
//invoke_virtual(sdlv,"setOnScrollGroupFloatingListener",true,load("com/tencent/widget/AbsListView$OnScrollListener"));
self.getWindow().getDecorView().setTag(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void onClick(View v) {
LinearLayout.LayoutParams _lp_fat = new LinearLayout.LayoutParams(MATCH_PARENT, 0);
_lp_fat.weight = 1;
//__ll.addView(bounceScrollView,_lp_fat);
//sdlv.setBackgroundColor(0xFFAA0000)
ActProxyMgr.setContentBackgroundDrawable(self, QThemeKit.skin_background);
invoke_virtual(self, "setTitle", "导出好友列表", CharSequence.class);
invoke_virtual(self, "setImmersiveStatus");
invoke_virtual(self, "enableLeftBtn", true, boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import nil.nadph.qnotified.hook.*;
import nil.nadph.qnotified.record.ConfigManager;
import nil.nadph.qnotified.util.NewsHelper;
import nil.nadph.qnotified.util.QThemeKit;
import nil.nadph.qnotified.util.UpdateCheck;
import nil.nadph.qnotified.util.Utils;

Expand Down Expand Up @@ -85,7 +86,6 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
ll.addView(newListItemSwitchConfigInit(self, "隐藏送礼动画", null, qn_hide_gift_animation, false, HideGiftAnim.get()));
}
ll.addView(newListItemSwitchConfigInit(self, "签到文本化", null, qn_sign_in_as_text, false, SimpleCheckInHook.get()));
ll.addView(newListItemSwitchConfigInit(self, "屏蔽更新提醒", null, qh_pre_upgrade, false, PreUpgradeHook.get()));
ll.addView(subtitle(self, "消息通知设置(不影响接收消息)屏蔽后可能仍有[橙字],但不会有通知)"));
ll.addView(subtitle(self, " 注:屏蔽后可能仍有[橙字],但不会有通知"));
ll.addView(_t = newListItemButton(self, "屏蔽指定群@全体成员通知", Html.fromHtml("<font color='" + get_RGB(hiColor.getDefaultColor()) + "'>[@全体成员]</font>就这点破事"), "%d个群", clickToProxyActAction(ACTION_MUTE_AT_ALL)));
Expand All @@ -100,15 +100,18 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
//ll.addView(newListItemSwitchConfigInit(self, "聊天图片背景透明", null, qn_gallery_bg, false, GalleryBgHook.get()));
ll.addView(subtitle(self, "实验性功能"));
ll.addView(newListItemSwitchConfigInit(self, "收藏更多表情", "保存在本地", qqhelper_fav_more_emo, false, FavMoreEmo.get()));
ll.addView(newListItemSwitchConfigInit(self, "自定义猜拳骰子", null, qh_random_cheat, false, CheatHook.get()));
ll.addView(newListItemSwitchConfigInit(self, "防撤回", "来自旧版QX,稳定性不如最新版QX", qn_anti_revoke_msg, false, RevokeMsgHook.get()));
ll.addView(newListItemSwitchConfigInit(self, "屏蔽更新提醒", null, qh_pre_upgrade, false, PreUpgradeHook.get()));
if (!Utils.isTim(self)) {
ll.addView(newListItemSwitchConfigInit(self, "自定义猜拳骰子", null, qh_random_cheat, false, CheatHook.get()));
ll.addView(newListItemSwitchConfigInit(self, "简洁模式圆头像", "From Rikka", qn_round_avatar, false, RoundAvatarHook.get()));
}
ll.addView(subtitle(self, "好友列表"));
ll.addView(newListItemButton(self, "历史好友", null, null, clickToProxyActAction(ACTION_EXFRIEND_LIST)));
ll.addView(newListItemButton(self, "导出历史好友列表", "支持csv/json格式", null, clickToProxyActAction(ACTION_FRIENDLIST_EXPORT_ACTIVITY)));
ll.addView(newListItemSwitchConfigNext(self, "隐藏分组下方入口", "隐藏分组列表最下方的历史好友按钮", qn_hide_ex_entry_group, false));
if (!Utils.isTim(self)) {
ll.addView(newListItemSwitchConfigNext(self, "隐藏分组下方入口", "隐藏分组列表最下方的历史好友按钮", qn_hide_ex_entry_group, false));
}
ll.addView(subtitle(self, "还没完成的功能(咕咕咕)"));
ll.addView(newListItemSwitchConfigStub(self, "屏蔽回执消息的通知", null, qn_mute_talk_back, false));
ll.addView(newListItemSwitchConfigStub(self, "禁止自动@", "[>=8.1.3]去除回复消息时自动@特性", qn_disable_auto_at, false));
Expand Down Expand Up @@ -143,7 +146,7 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
LinearLayout.LayoutParams _lp_fat = new LinearLayout.LayoutParams(MATCH_PARENT, 0);
_lp_fat.weight = 1;
//__ll.addView(bounceScrollView,_lp_fat);
//sdlv.setBackgroundColor(0xFFAA0000)
ActProxyMgr.setContentBackgroundDrawable(self, QThemeKit.skin_background);
invoke_virtual(self, "setTitle", "高级", CharSequence.class);
invoke_virtual(self, "setImmersiveStatus");
invoke_virtual(self, "enableLeftBtn", true, boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
LinearLayout main = new LinearLayout(mActivity);
main.setOrientation(LinearLayout.VERTICAL);
main.setGravity(Gravity.CENTER_HORIZONTAL);
main.setBackgroundDrawable(QThemeKit.skin_background);
LinearLayout bar = new LinearLayout(mActivity);
bar.setOrientation(LinearLayout.HORIZONTAL);
search = new EditText(mActivity);
Expand All @@ -249,19 +248,19 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
reverse.setText("反选");
reverse.setId(R_ID_TRP_REVERSE);
reverse.setTextColor(cTitle);
reverse.setBackgroundDrawable(QThemeKit.getListItemBackground());
reverse.setBackgroundDrawable(null);
reverse.setOnClickListener(this);
selectAll = new Button(mActivity);
selectAll.setText("全选");
selectAll.setId(R_ID_TRP_SELECT_ALL);
selectAll.setTextColor(cTitle);
selectAll.setBackgroundDrawable(QThemeKit.getListItemBackground());
selectAll.setBackgroundDrawable(null);
selectAll.setOnClickListener(this);
cancel = new Button(mActivity);
cancel.setText("取消");
cancel.setTextColor(cTitle);
cancel.setId(R_ID_TRP_CANCEL);
cancel.setBackgroundDrawable(QThemeKit.getListItemBackground());
cancel.setBackgroundDrawable(null);
cancel.setOnClickListener(this);
cancel.setVisibility(GONE);
bar.addView(search, searchlp);
Expand Down Expand Up @@ -290,7 +289,6 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
f.addView(sdlv, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
main.addView(f, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
mActivity.setContentView(main);
//sdlv.setBackgroundColor(0xFFAA0000)
String title = "Fatal error!";
if (mActionInt == ACTION_MUTE_AT_ALL)
title = "屏蔽@全体成员";
Expand Down Expand Up @@ -326,6 +324,7 @@ else if (mActionInt == ACTION_MUTE_RED_PACKET)
if (muted != null && muted.size() > 0) {
rightBtn.setText("完成(" + muted.size() + ")");
}
ActProxyMgr.setContentBackgroundDrawable(mActivity, QThemeKit.skin_background);
mActivity.getWindow().getDecorView().setTag(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
//invoke_virtual(bounceScrollView,"a",true,500,500,boolean.class,int.class,int.class);
bounceScrollView.setLayoutParams(mmlp);
bounceScrollView.addView(ll, new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
bounceScrollView.setBackgroundDrawable(QThemeKit.qq_setting_item_bg_nor);
//invoke_virtual(bounceScrollView,"setNeedHorizontalGesture",true,boolean.class);
LinearLayout.LayoutParams fixlp = new LinearLayout.LayoutParams(MATCH_PARENT, dip2px(self, 48));
RelativeLayout.LayoutParams __lp_l = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
Expand Down Expand Up @@ -101,6 +100,7 @@ public void doOnPostCreate(Bundle savedInstanceState) throws Throwable {
invoke_virtual(self, "setTitle", "故障排除", CharSequence.class);
invoke_virtual(self, "setImmersiveStatus");
invoke_virtual(self, "enableLeftBtn", true, boolean.class);
ActProxyMgr.setContentBackgroundDrawable(self, QThemeKit.skin_background);

}

Expand Down
70 changes: 36 additions & 34 deletions app/src/main/java/nil/nadph/qnotified/util/ArscKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
import android.content.Context;
import nil.nadph.qnotified.record.ConfigManager;

import java.io.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;

import static nil.nadph.qnotified.util.Utils.log;
import java.util.*;
import java.net.*;

public class ArscKit {

private static final String CACHED_RES_ID_NAME_PREFIX = "cached_res_id_name_";
private static final String CACHED_RES_ID_CODE_PREFIX = "cached_res_id_code_";

//FailureZero
//FailureZero
public static int getIdentifier(Context ctx, String type, String name, boolean allowSearch) {
if (name == null) return 0;
if (name.contains("@")) {
Expand Down Expand Up @@ -58,23 +61,23 @@ public static int getIdentifier(Context ctx, String type, String name, boolean a
}

private static int enumArsc(String pkgname, String type, String name) {
Enumeration<URL> urls = null;
Enumeration<URL> urls = null;
try {
urls = (Enumeration<URL>) Utils.invoke_virtual(Initiator.getClassLoader(), "findResources", "resources.arsc", String.class);
} catch (Throwable e) {
log(e);
}
if (urls == null) {
log(new RuntimeException("Error! Enum<URL<resources.arsc>> == null, loader = " + Initiator.getClassLoader()));
return 0;
}
InputStream in;
byte[] buf=new byte[4096];
byte[] content;
int ret =0;
ArrayList<String> rets = new ArrayList<String>();
while (urls.hasMoreElements()) {
try {
if (urls == null) {
log(new RuntimeException("Error! Enum<URL<resources.arsc>> == null, loader = " + Initiator.getClassLoader()));
return 0;
}
InputStream in;
byte[] buf = new byte[4096];
byte[] content;
int ret = 0;
ArrayList<String> rets = new ArrayList<String>();
while (urls.hasMoreElements()) {
try {
in = urls.nextElement().openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int ii;
Expand All @@ -83,29 +86,28 @@ private static int enumArsc(String pkgname, String type, String name) {
}
in.close();
content = baos.toByteArray();
ret=seekInArsc(content,pkgname,type,name);
if(ret!=0)return ret;
} catch (IOException e) {
log(e);
}
}
//404
return 0;
ret = seekInArsc(content, pkgname, type, name);
if (ret != 0) return ret;
} catch (IOException e) {
log(e);
}
}
//404
return 0;
}

//FailureZero
private static int seekInArsc(byte[] p,String pkgname, String type, String name) {

}


public static int readLe32(byte[] xml, int pos) {
int i = (xml[pos]) & 0xff | (xml[pos + 1] << 8) & 0x0000ff00 | (xml[pos + 2] << 16) & 0x00ff0000 | ((xml[pos + 3] << 24) & 0xff000000);
return i;
//FailureZero
private static int seekInArsc(byte[] p, String pkgname, String type, String name) {
throw new RuntimeException("Stub!");
}


public static int readLe32(byte[] xml, int pos) {
return (xml[pos]) & 0xff | (xml[pos + 1] << 8) & 0x0000ff00 | (xml[pos + 2] << 16) & 0x00ff0000 | ((xml[pos + 3] << 24) & 0xff000000);
}

public static short readLe16(byte[] xml, int pos) {
return (short) ((xml[pos]) & 0xff | (xml[pos + 1] << 8) & 0xff00);
}

}
18 changes: 9 additions & 9 deletions app/src/main/java/nil/nadph/qnotified/util/BinaryXmlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,31 @@ public static XmlNode parseXml(byte[] xml) {
pos[0] += headerSize;
break s;
case RES_STRING_POOL_TYPE:
int str_num = readLe32(xml, pos[0] + 8);
int stringCount = readLe32(xml, pos[0] + 8);
int style_num = readLe32(xml, pos[0] + 12);
int flag = readLe32(xml, pos[0] + 16);
int str_start = readLe32(xml, pos[0] + 20);
int stringStart = readLe32(xml, pos[0] + 20);
int style_start = readLe32(xml, pos[0] + 24);
boolean uft8 = (flag & (1 << 8)) != 0;
int strpos;
String str;
int len;
stringPool = new ArrayList<>();
for (int i = 0; i < str_num; i++) {
for (int i = 0; i < stringCount; i++) {
strpos = readLe32(xml, pos[0] + 28 + i * 4);
if (uft8) {
len = xml[pos[0] + str_start + strpos];
len = xml[pos[0] + stringStart + strpos];
try {
str = new String(xml, pos[0] + str_start + strpos + 2, len, "utf-8");
str = new String(xml, pos[0] + stringStart + strpos + 2, len, "utf-8");
} catch (UnsupportedEncodingException e) {
str = new String(xml, pos[0] + str_start + strpos + 2, len);
str = new String(xml, pos[0] + stringStart + strpos + 2, len);
}
} else {
len = readLe16(xml, pos[0] + str_start + strpos);
len = readLe16(xml, pos[0] + stringStart + strpos);
try {
str = new String(xml, pos[0] + str_start + strpos + 2, len, "utf-16");
str = new String(xml, pos[0] + stringStart + strpos + 2, len, "utf-16");
} catch (UnsupportedEncodingException e) {
str = new String(xml, pos[0] + str_start + strpos + 2, len);
str = new String(xml, pos[0] + stringStart + strpos + 2, len);
}
}
stringPool.add(i, str);
Expand Down
Loading

0 comments on commit 4f5cf52

Please sign in to comment.