Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff committed Jul 18, 2024
1 parent 4bbf952 commit 493c79b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 270 deletions.
2 changes: 2 additions & 0 deletions module/src/main/cpp/binder/include/kernel/binder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <linux/types.h>
#include <linux/ioctl.h>

#ifndef B_PACK_CHARS
#define B_PACK_CHARS(c1, c2, c3, c4) ((((c1) << 24)) | (((c2) << 16)) | (((c3) << 8)) | (c4))
#endif
#define B_TYPE_LARGE 0x85
enum {
BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
Expand Down
4 changes: 2 additions & 2 deletions module/src/main/cpp/binder/stub_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace android {
#endif
BBinder::BBinder() {}

const String16& BBinder::getInterfaceDescriptor() const { return {}; }
const String16 &BBinder::getInterfaceDescriptor() const { __builtin_unreachable(); }
bool BBinder::isBinderAlive() const { return false; }
status_t BBinder::pingBinder() { return 0; }
status_t BBinder::dump(int fd, const Vector<String16>& args) { return 0; }
Expand Down Expand Up @@ -152,7 +152,7 @@ namespace android {

// IServiceManager.h
const String16 &IServiceManager::getInterfaceDescriptor() const {
return {};
__builtin_unreachable();
}

IServiceManager::IServiceManager() {}
Expand Down
5 changes: 1 addition & 4 deletions module/src/main/cpp/binder_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
#include "lsplt.hpp"
#include "elf_util.h"

#include "hook_util/hook_helper.hpp"

using namespace SandHook;
using namespace android;
using namespace hook_helper::literals;

class BinderInterceptor : public BBinder {
enum {
Expand Down Expand Up @@ -349,6 +346,6 @@ bool hookBinder() {
}

extern "C" [[gnu::visibility("default")]] [[gnu::used]] bool entry(void *handle) {
LOGI("my handle %p", handle);
LOGI("injected, my handle %p", handle);
return hookBinder();
}
246 changes: 0 additions & 246 deletions module/src/main/cpp/hook_util/hook_helper.hpp

This file was deleted.

16 changes: 0 additions & 16 deletions module/src/main/cpp/hook_util/type_traits.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions module/src/main/cpp/zygisk/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,4 @@ static void companion_handler(int fd) {

// Register our module class and the companion handler function
REGISTER_ZYGISK_MODULE(TrickyStore)

REGISTER_ZYGISK_COMPANION(companion_handler)
REGISTER_ZYGISK_COMPANION(companion_handler)

0 comments on commit 493c79b

Please # to comment.