update
This commit is contained in:
parent
afe1407825
commit
4c1aeed350
src
@ -1,3 +1,3 @@
|
|||||||
Manifest-Version: 1.0
|
Manifest-Version: 1.0
|
||||||
Main-Class: com.qy.utils.CsjTools
|
Main-Class: com.qy.ui.AppMain
|
||||||
|
|
||||||
|
@ -63,6 +63,15 @@ public class AutoRandomAdSDK {
|
|||||||
private SmaliApkToolsPath inter;
|
private SmaliApkToolsPath inter;
|
||||||
private boolean isDev = false;
|
private boolean isDev = false;
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
if (adClass != null)
|
||||||
|
adClass.clear();
|
||||||
|
if (nowAdClass != null)
|
||||||
|
nowAdClass.clear();
|
||||||
|
if (nowAdFile != null)
|
||||||
|
nowAdFile.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
// new AutoRandomAdSDK(new File("JooMobAdSDK_6.1.8.jar"), "5600", "5", 1, null);
|
// new AutoRandomAdSDK(new File("JooMobAdSDK_6.1.8.jar"), "5600", "5", 1, null);
|
||||||
@ -103,11 +112,13 @@ public class AutoRandomAdSDK {
|
|||||||
public AutoRandomAdSDK() {
|
public AutoRandomAdSDK() {
|
||||||
|
|
||||||
}
|
}
|
||||||
private SmaliApkToolsPath batchInter;
|
|
||||||
|
private SmaliApkToolsPath batchInter;
|
||||||
private JSONArray batch;
|
private JSONArray batch;
|
||||||
|
|
||||||
public AutoRandomAdSDK(JSONArray batch, SmaliApkToolsPath inter) {
|
public AutoRandomAdSDK(JSONArray batch, SmaliApkToolsPath inter) {
|
||||||
batchInter=inter;
|
batchInter = inter;
|
||||||
this.batch=batch;
|
this.batch = batch;
|
||||||
for (Object o : batch) {
|
for (Object o : batch) {
|
||||||
//System.out.println("循环");
|
//System.out.println("循环");
|
||||||
final JSONObject item = (JSONObject) o;
|
final JSONObject item = (JSONObject) o;
|
||||||
@ -123,10 +134,12 @@ public class AutoRandomAdSDK {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private int outIndex=0;
|
|
||||||
|
private int outIndex = 0;
|
||||||
|
|
||||||
private void outInter(JSONArray array) {
|
private void outInter(JSONArray array) {
|
||||||
outIndex++;
|
outIndex++;
|
||||||
if(batch.length()==outIndex){
|
if (batch.length() == outIndex) {
|
||||||
batchInter.smaliPath(batch.toString());
|
batchInter.smaliPath(batch.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -225,12 +238,12 @@ public class AutoRandomAdSDK {
|
|||||||
+ clazzs.getString(i).replace(".", File.separator) + ".smali");
|
+ clazzs.getString(i).replace(".", File.separator) + ".smali");
|
||||||
|
|
||||||
if (clz.exists()) {
|
if (clz.exists()) {
|
||||||
// System.out.println("key="+clazzs.getString(i)+" value="+clz);
|
// System.out.println("key="+clazzs.getString(i)+" value="+clz);
|
||||||
adClass.put(clazzs.getString(i), clz);
|
adClass.put(clazzs.getString(i), clz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String key : adClass.keySet()) {
|
for (String key : adClass.keySet()) {
|
||||||
// System.out.println("注入的值:" + key);
|
// System.out.println("注入的值:" + key);
|
||||||
}
|
}
|
||||||
mkdirs();
|
mkdirs();
|
||||||
update();
|
update();
|
||||||
@ -446,6 +459,7 @@ public class AutoRandomAdSDK {
|
|||||||
public void smaliPath(String path) {
|
public void smaliPath(String path) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
try {
|
try {
|
||||||
|
smalitools.clear();
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
outManifest();
|
outManifest();
|
||||||
File lt;
|
File lt;
|
||||||
@ -479,6 +493,7 @@ public class AutoRandomAdSDK {
|
|||||||
}
|
}
|
||||||
if (inter != null)
|
if (inter != null)
|
||||||
inter.smaliPath(nLt == null ? rootPath : nLt.getAbsolutePath());
|
inter.smaliPath(nLt == null ? rootPath : nLt.getAbsolutePath());
|
||||||
|
clear();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -513,7 +528,7 @@ public class AutoRandomAdSDK {
|
|||||||
if (!config.getBoolean("isAllPackage")) {
|
if (!config.getBoolean("isAllPackage")) {
|
||||||
filePath = new File(file.getAbsolutePath().replace(file.getName(), ""));
|
filePath = new File(file.getAbsolutePath().replace(file.getName(), ""));
|
||||||
}
|
}
|
||||||
// System.out.println(nowAdClass.get(key)+" "+file.getName()+" "+filePath.getAbsolutePath());
|
// System.out.println(nowAdClass.get(key)+" "+file.getName()+" "+filePath.getAbsolutePath());
|
||||||
//System.out.println(key + " | " + file.getAbsolutePath() + " | " + fileName + " | " + filePath.getAbsolutePath());
|
//System.out.println(key + " | " + file.getAbsolutePath() + " | " + fileName + " | " + filePath.getAbsolutePath());
|
||||||
if (filePath.listFiles() == null) {
|
if (filePath.listFiles() == null) {
|
||||||
//System.out.println("filePath为空:" + filePath.getAbsolutePath());
|
//System.out.println("filePath为空:" + filePath.getAbsolutePath());
|
||||||
@ -521,7 +536,7 @@ public class AutoRandomAdSDK {
|
|||||||
}
|
}
|
||||||
//moveFile(filePath,key);
|
//moveFile(filePath,key);
|
||||||
for (File fs : filePath.listFiles()) {
|
for (File fs : filePath.listFiles()) {
|
||||||
// System.out.println(fs.getAbsolutePath());
|
// System.out.println(fs.getAbsolutePath());
|
||||||
if (fs.isDirectory()) {
|
if (fs.isDirectory()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -533,12 +548,12 @@ public class AutoRandomAdSDK {
|
|||||||
//System.out.println(fs.getAbsolutePath().replace(rootPath,"")+" > "+nName);
|
//System.out.println(fs.getAbsolutePath().replace(rootPath,"")+" > "+nName);
|
||||||
if (fs.getName().startsWith(fileName.split("\\$")[0] + "$")) {
|
if (fs.getName().startsWith(fileName.split("\\$")[0] + "$")) {
|
||||||
if (getNewName(fs.getAbsolutePath()).endsWith("[notmover]")) {
|
if (getNewName(fs.getAbsolutePath()).endsWith("[notmover]")) {
|
||||||
Tools.copyFileToName(fs.getAbsolutePath(), fs.getAbsolutePath(), fs
|
Tools.copyFileToName(fs.getAbsolutePath(), fs.getAbsolutePath(), fs
|
||||||
.getName().replace(fs.getName().split("\\$")[0], nName), true);
|
.getName().replace(fs.getName().split("\\$")[0], nName), true);
|
||||||
file.delete();
|
file.delete();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
moveFile(fs, key, nName+fs.getName().substring(fileName.length()), false);
|
moveFile(fs, key, nName + fs.getName().substring(fileName.length()), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -600,7 +615,7 @@ public class AutoRandomAdSDK {
|
|||||||
boolean t = Tools.copyFileToName(file.getAbsolutePath(), path,
|
boolean t = Tools.copyFileToName(file.getAbsolutePath(), path,
|
||||||
nName, true);
|
nName, true);
|
||||||
file.delete();
|
file.delete();
|
||||||
//System.err.println("移动文件:" + file.getAbsolutePath() + " 到" + path + " 重命名为:" + nName + " 结果" + t);
|
//System.err.println("移动文件:" + file.getAbsolutePath() + " 到" + path + " 重命名为:" + nName + " 结果" + t);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void allpackage(File file, String packge) {
|
private void allpackage(File file, String packge) {
|
||||||
@ -625,9 +640,9 @@ public class AutoRandomAdSDK {
|
|||||||
if (packageName != null && file.getAbsolutePath().contains(packageName.replace(".", File.separator))) {
|
if (packageName != null && file.getAbsolutePath().contains(packageName.replace(".", File.separator))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String sdkPackageName=config.isNull("regexPackage")?null:config.getString("regexPackage");
|
String sdkPackageName = config.isNull("regexPackage") ? null : config.getString("regexPackage");
|
||||||
if(sdkPackageName!=null){
|
if (sdkPackageName != null) {
|
||||||
toPath=toPath.replace(sdkPackageName.replace(".",File.separator),"");
|
toPath = toPath.replace(sdkPackageName.replace(".", File.separator), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
@ -645,11 +660,11 @@ public class AutoRandomAdSDK {
|
|||||||
|
|
||||||
|
|
||||||
//boolean data = file.renameTo(new File(rootPath + toPath, file.getName()));
|
//boolean data = file.renameTo(new File(rootPath + toPath, file.getName()));
|
||||||
boolean data=Tools.copyFile(file.getAbsolutePath(),rootPath + toPath,true);
|
boolean data = Tools.copyFile(file.getAbsolutePath(), rootPath + toPath, true);
|
||||||
file.delete();
|
file.delete();
|
||||||
// System.out.println("移动文件:" + file.getAbsolutePath().replace(rootPath, "") + " 到 " + (rootPath + toPath) + " > " + fileName + " " + nowAdClass.get(fileName) + " >! " + data);
|
// System.out.println("移动文件:" + file.getAbsolutePath().replace(rootPath, "") + " 到 " + (rootPath + toPath) + " > " + fileName + " " + nowAdClass.get(fileName) + " >! " + data);
|
||||||
if (nowAdClass.containsKey(fileName)) {
|
if (nowAdClass.containsKey(fileName)) {
|
||||||
// System.err.println("移动文件:"+file.getAbsolutePath().replace(rootPath, "")+" 到 "+toPath+" > "+fileName+" "+nowAdClass.get(fileName));
|
// System.err.println("移动文件:"+file.getAbsolutePath().replace(rootPath, "")+" 到 "+toPath+" > "+fileName+" "+nowAdClass.get(fileName));
|
||||||
// //System.out.println(file.getAbsolutePath().replace(rootPath,"")+" "+toPath);
|
// //System.out.println(file.getAbsolutePath().replace(rootPath,"")+" "+toPath);
|
||||||
nowAdClass.put(fileName, new File(rootPath + File.separator + toPath));
|
nowAdClass.put(fileName, new File(rootPath + File.separator + toPath));
|
||||||
}
|
}
|
||||||
@ -675,11 +690,11 @@ public class AutoRandomAdSDK {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getNewName(String name) {
|
private String getNewName(String name) {
|
||||||
File file=new File(name);
|
File file = new File(name);
|
||||||
String packageName=file.getAbsolutePath().replace(rootPath + File.separator + "smali" + File.separator,"").replace(file.getName(),"");
|
String packageName = file.getAbsolutePath().replace(rootPath + File.separator + "smali" + File.separator, "").replace(file.getName(), "");
|
||||||
String nName = getNewNameForSrc(packageName.replace(File.separator,".")+file.getName());
|
String nName = getNewNameForSrc(packageName.replace(File.separator, ".") + file.getName());
|
||||||
if(nName.equals(packageName.replace(File.separator,".")+file.getName().replace(".smali",""))){
|
if (nName.equals(packageName.replace(File.separator, ".") + file.getName().replace(".smali", ""))) {
|
||||||
nName=getNewNameForSrc(file.getName());
|
nName = getNewNameForSrc(file.getName());
|
||||||
}
|
}
|
||||||
if (nName.endsWith("[notmover]")) {
|
if (nName.endsWith("[notmover]")) {
|
||||||
nName = nName.replace("[notmover]", "");
|
nName = nName.replace("[notmover]", "");
|
||||||
@ -751,9 +766,6 @@ public class AutoRandomAdSDK {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
nowAdClass.put(clazzs.getString(i), mkdir);
|
nowAdClass.put(clazzs.getString(i), mkdir);
|
||||||
for (String key : nowAdClass.keySet()) {
|
|
||||||
// System.out.println("key=" + key + " file=" + nowAdClass.get(key) + " oldFile=" + adClass.get(key));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,6 +302,7 @@ public class CsjTools {
|
|||||||
apk_Path = path;
|
apk_Path = path;
|
||||||
apk_res = apk_Path + File.separator + "res" + File.separator + "values";
|
apk_res = apk_Path + File.separator + "res" + File.separator + "values";
|
||||||
runStart();
|
runStart();
|
||||||
|
utils.clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -319,6 +320,7 @@ public class CsjTools {
|
|||||||
csj_Path = path;
|
csj_Path = path;
|
||||||
csj_res = csj_Path + File.separator + "res" + File.separator + "values";
|
csj_res = csj_Path + File.separator + "res" + File.separator + "values";
|
||||||
_log.smaliPath("开始修改穿山甲");
|
_log.smaliPath("开始修改穿山甲");
|
||||||
|
utils.clear();
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -27,7 +27,7 @@ public class SmaliUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SmaliUtils() {
|
public SmaliUtils() {
|
||||||
clazzList = new HashMap<>();
|
clazzList = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPath(String uPath) {
|
public void setPath(String uPath) {
|
||||||
@ -256,6 +256,15 @@ public class SmaliUtils {
|
|||||||
|
|
||||||
List<String> list;
|
List<String> list;
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
if (clazzList != null)
|
||||||
|
clazzList.clear();
|
||||||
|
if (list != null)
|
||||||
|
list.clear();
|
||||||
|
if (files != null)
|
||||||
|
files.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public void setFilter(List<String> list) {
|
public void setFilter(List<String> list) {
|
||||||
this.list = list;
|
this.list = list;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user