Skip to content

Commit

Permalink
add more dir
Browse files Browse the repository at this point in the history
  • Loading branch information
KyuubiRan committed Aug 10, 2020
1 parent 73332d8 commit 3c0399a
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 104 deletions.
6 changes: 2 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ android {
applicationId "me.kyuubiran.qqcleaner"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
versionCode 2
versionName "0.2"
}

buildTypes {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"properties": [],
"versionCode": 1,
"versionName": "0.1",
"versionCode": 2,
"versionName": "0.2",
"enabled": true,
"outputFile": "app-release.apk"
}
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
<activity android:name="me.kyuubiran.qqcleaner.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="xposedmodule"
android:value="true" />
Expand Down
13 changes: 0 additions & 13 deletions app/src/main/java/me/kyuubiran/qqcleaner/MainActivity.java

This file was deleted.

99 changes: 80 additions & 19 deletions app/src/main/java/me/kyuubiran/qqcleaner/MainHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,47 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Class<?> FormSimpleItem = XposedHelpers.findClass("com.tencent.mobileqq.widget.FormSimpleItem", lpparam.classLoader);
View item = (View) Utils.iget_object_or_null(param.thisObject, "a", FormSimpleItem);
final Context context = (Context) item.getContext();
View entity = (View) Utils.new_instance(FormSimpleItem, param.thisObject, Context.class);
Utils.invoke_virtual(entity, "setLeftText", "一键瘦身", CharSequence.class);
View clean = (View) Utils.new_instance(FormSimpleItem, param.thisObject, Context.class);
View cleanAll = (View) Utils.new_instance(FormSimpleItem, param.thisObject, Context.class);
Utils.invoke_virtual(clean, "setLeftText", "一键瘦身", CharSequence.class);
Utils.invoke_virtual(cleanAll, "setLeftText", "彻底瘦身(彻底清理缓存)", CharSequence.class);
ViewGroup vg = (ViewGroup) item.getParent();
vg.addView(entity, 2);
entity.setOnClickListener(new View.OnClickListener() {
vg.addView(clean, 2);
vg.addView(cleanAll, 3);
clean.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(context, "长按以清除缓存", LENGTH_SHORT).show();
}
});
entity.setOnLongClickListener(new View.OnLongClickListener() {
clean.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
cleanCache(context);
cleanCache(context, false);
return true;
}
});
cleanAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(context, "长按清理所有缓存(某些缓存会在重启QQ后重新加载)", LENGTH_SHORT).show();
}
});
cleanAll.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
cleanCache(context, true);
return true;
}
});

}
});
}
}
}


public void cleanCache(final Context context) {
public void cleanCache(final Context context, final boolean cleanAll) {
Toast.makeText(context, "正在清理缓存", LENGTH_SHORT).show();
new Thread(new Runnable() {
@Override
Expand Down Expand Up @@ -90,27 +106,72 @@ public void run() {
//编辑过的图片
File QQEditPic = new File(QQ_Images + "/QQEditPic");

//执行清理
//清理
Utils.deleteAllFiles(cache);
// XposedBridge.log("清理cache成功");
Utils.deleteAllFiles(diskcache);
// XposedBridge.log("清理diskcache成功");
Utils.deleteAllFiles(ScribbleCache);
// XposedBridge.log("清理ScribbleCache成功");
Utils.deleteAllFiles(photo);
// XposedBridge.log("清理photo成功");
Utils.deleteAllFiles(shortVideo);
// XposedBridge.log("清理shortVideo成功");
Utils.deleteAllFiles(thumb);
// XposedBridge.log("清理thumb成功");
Utils.deleteAllFiles(qbosssplahAD);
// XposedBridge.log("清理qbosssplahAD成功");
Utils.deleteAllFiles(pddata);
// XposedBridge.log("清理pddata成功");
Utils.deleteAllFiles(chatpic);
// XposedBridge.log("清理chatpic成功");
Utils.deleteAllFiles(QQEditPic);
// XposedBridge.log("清理QQEditPic成功");

//特殊缓存目录
if (cleanAll) {
//字体
File font_info = new File(MobileQQ + "/.font_info");
//送礼物
File gift = new File(MobileQQ + "/.gift");
//头像挂件
File pendant = new File(MobileQQ + "/.pendant");
//资料卡背景
File profilecard = new File(MobileQQ + "/.profilecard");
//表情推荐
File sticker_recommended_pics = new File(MobileQQ + "/.sticker_recommended_pics");
//进场特效
File enter_effects = new File(MobileQQ + "/.troop/enter_effects");
//戳一戳
File vaspoke = new File(MobileQQ + "/.vaspoke");
File newpoke = new File(MobileQQ + "/newpoke");
File poke = new File(MobileQQ + "/poke");
//vip图标
File vipicon = new File(MobileQQ + "/.vipicon");
//斗图相关
File DoutuRes = new File(MobileQQ + "/DoutuRes");
//QQ电话动画背景
File funcall = new File(MobileQQ + "/funcall");
//头像缓存
File head = new File(MobileQQ + "/head");
//热图?
File hotpic = new File(MobileQQ + "/hotpic");
//貌似也是表情
File pe = new File(MobileQQ + "/pe");
//暂时不知道的东西
File qav = new File(MobileQQ + "/qav");
//qq音乐
File qqmusic = new File(MobileQQ + "/qqmusic");

//清理
Utils.deleteAllFiles(font_info);
Utils.deleteAllFiles(gift);
Utils.deleteAllFiles(pendant);
Utils.deleteAllFiles(profilecard);
Utils.deleteAllFiles(sticker_recommended_pics);
Utils.deleteAllFiles(enter_effects);
Utils.deleteAllFiles(vaspoke);
Utils.deleteAllFiles(newpoke);
Utils.deleteAllFiles(poke);
Utils.deleteAllFiles(vipicon);
Utils.deleteAllFiles(DoutuRes);
Utils.deleteAllFiles(funcall);
Utils.deleteAllFiles(head);
Utils.deleteAllFiles(hotpic);
Utils.deleteAllFiles(pe);
Utils.deleteAllFiles(qav);
Utils.deleteAllFiles(qqmusic);
}
} catch (Throwable t) {
XposedBridge.log(TAG + t);
}
Expand Down
48 changes: 0 additions & 48 deletions app/src/main/res/layout/activity_main.xml

This file was deleted.

6 changes: 1 addition & 5 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">QQ瘦身</string>
<string name="tips">由于QQ越来越过粪了 动不动就十几甚至几十个G 你一个聊天软件搞这么大干什么???所以我就搞了这个软件 帮大家一键清理QQ常年累积的垃圾(自带的缓存清理还没什么屌用 清理完还变大了就很弱智)</string>
<string name="tips2">注意:本软件保留聊天记录 仅清理缓存 并且仅支持8.2.8+(QQ把数据放在Android/data目录下之后的版本)的QQ版本(最好用8.4.1)低版本请不要使用本软件 避免出现神奇的Bug</string>
<string name="tips3">\nQQ设置->关于->一键瘦身\n</string>
<string name="xposeddescription">清理QQ的缓存文件 By.KyuubiRan</string>
<string name="tips4">本项目已在Github上开源 \n作者:@KyuubiRan</string>
<string name="xposeddescription">QQ设置->关于->一键瘦身 本项目已在Github上开源 作者:KyuubiRan</string>
</resources>
6 changes: 1 addition & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<resources>
<string name="app_name">QQ Cleaner</string>
<string name="tips">Give me disk space back QQ!!!!</string>
<string name="tips2">JUST SUPPORTED QQ8.2.8+(Data in Android/Data)</string>
<string name="tips3">Settings -> About ->一键瘦身</string>
<string name="xposeddescription">QQ Cleaner by KyuubiRan</string>
<string name="tips4">Open-source on github \n By KyuubiRan</string>
<string name="xposeddescription">Settings->About->一键清理 by KyuubiRan</string>
</resources>

0 comments on commit 3c0399a

Please sign in to comment.