Skip to content

Commit

Permalink
chore: replace hardcoded path with package name
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Sep 10, 2023
1 parent e62af55 commit ba30026
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/src/main/java/cc/hicore/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

package cc.hicore;

import cc.ioctl.util.HostInfo;

public class Env {
public static String app_save_path = "/sdcard/Android/data/com.tencent.mobileqq/files/.tool/";
public static String app_save_path = "/sdcard/Android/data/" + HostInfo.getPackageName() + "/files/.tool/";
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
package cc.hicore.QQDecodeUtils;

import android.os.Environment;
import cc.ioctl.util.HostInfo;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
Expand All @@ -40,9 +41,9 @@ private static int conVertToInt(byte[] b){
private static final byte[] GIFMask = {0,1,0,1};
public static String decodeGifForLocalPath(int dwTabID,byte[] sbufID){
try{
String path = Environment.getExternalStorageDirectory()+"/Android/data/com.tencent.mobileqq/Tencent/MobileQQ/.emotionsm/"+dwTabID+"/"
String path = Environment.getExternalStorageDirectory()+"/Android/data/" + HostInfo.getPackageName() + "/Tencent/MobileQQ/.emotionsm/"+dwTabID+"/"
+bytesToHex(sbufID);
String cachePath = Environment.getExternalStorageDirectory()+"/Android/data/com.tencent.mobileqq/cache/" +bytesToHex(sbufID);
String cachePath = Environment.getExternalStorageDirectory()+"/Android/data/" + HostInfo.getPackageName() + "/cache/" +bytesToHex(sbufID);
decodeGif(path,cachePath);
return cachePath;
}catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public static void sendArkApp(Object _Session, Object arkAppMsg) {

public static void sendVoice(Object _Session, String path) {
try {
if (!path.contains("com.tencent.mobileqq/Tencent/MobileQQ/" + QAppUtils.getCurrentUin())) {
String newPath = Environment.getExternalStorageDirectory() + "/Android/data/com.tencent.mobileqq/Tencent/MobileQQ/" + QAppUtils.getCurrentUin()
if (!path.contains(HostInfo.getPackageName() + "/Tencent/MobileQQ/" + QAppUtils.getCurrentUin())) {
String newPath = Environment.getExternalStorageDirectory() + "/Android/data/" + HostInfo.getPackageName() + "/Tencent/MobileQQ/" + QAppUtils.getCurrentUin()
+ "/ptt/" + new File(path).getName();
FileUtils.copy(path, newPath);
path = newPath;
Expand Down

0 comments on commit ba30026

Please sign in to comment.