Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
TUGOhost committed Jan 8, 2023
1 parent 78d9606 commit 89f5b04
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.gradle
local.properties
build
13 changes: 0 additions & 13 deletions anti/src/main/cpp/utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,3 @@
#include <iostream>
#include <array>
#include <memory>

std::string Utils::exec(const std::string &cmd) {
std::array<char, 128> buffer{};
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
if (!pipe) {

}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
result += buffer.data();
}
return result;
}
7 changes: 1 addition & 6 deletions anti/src/main/cpp/utils/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define ANTI_ANDROID_UTILS_H

#include <android/log.h>
#include <string>

//定义TAG之后,我们可以在LogCat通过TAG过滤出NDK打印的日志
#define TAG "ANTI"
Expand All @@ -17,10 +16,6 @@
// 定义error信息
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__)

class Utils {
public:
static std::string exec(const std::string &cmd);
};

#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG,__VA_ARGS__)

#endif //ANTI_ANDROID_UTILS_H
1 change: 1 addition & 0 deletions anti/src/main/cpp/xposeddetector/plt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <elf.h>
#include <link.h>
#include <stdbool.h>
#include "Utils.h"

#ifdef __cplusplus
extern "C" {
Expand Down
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
release

0 comments on commit 89f5b04

Please sign in to comment.