Files
TEESimulator-RS/app/src/main/cpp/stub/stub_utils.cpp
T
JingMatrix 020a930a31 Add stub for AOSP Binder and utility components
The primary function of these stubs is to provide necessary interface definitions and that can be utilized by `binder_interceptor.cpp` during compilation (and runtime).

Crucially, `libTEESimulator.so` (which encapsulates these stubs) is dynamically loaded into the target process via `ptrace` after the system's official libraries, such as `/system/lib64/libbinder.so` and `/system/lib64/libutils.so`, have already been loaded and their symbols resolved by the dynamic linker.

Consequently, the dynamic linker will have already established bindings to the robust, canonical implementations within the system libraries for existing code paths. The dynamic linker does not automatically re-resolve or update these established symbol bindings when a new library with conflicting definitions is loaded later.

The AOSP files are downloaded via links:
1. https://android.googlesource.com/platform/frameworks/native/+/refs/heads/main/libs/binder/include/binder
2. https://android.googlesource.com/platform/system/core/+/refs/heads/main/libutils/binder/include/utils

The link for binder header in Android kernel is:
https://cs.android.com/android/kernel/superproject/+/common-android-mainline:common/include/uapi/linux/android/binder.h
2025-11-25 19:21:05 +01:00

63 lines
1.4 KiB
C++

#include "utils/RefBase.h"
#include "utils/String16.h"
#include "utils/String8.h"
#include "utils/StrongPointer.h"
namespace android {
void RefBase::incStrong(const void *id) const {}
void RefBase::incStrongRequireStrong(const void *id) const {}
void RefBase::decStrong(const void *id) const {}
void RefBase::forceIncStrong(const void *id) const {}
RefBase::weakref_type *RefBase::createWeak(const void *id) const {
return nullptr;
}
RefBase::weakref_type *RefBase::getWeakRefs() const {
return nullptr;
}
RefBase::RefBase() : mRefs(nullptr) {}
RefBase::~RefBase() {}
void RefBase::onFirstRef() {}
void RefBase::onLastStrongRef(const void *id) {}
bool RefBase::onIncStrongAttempted(uint32_t flags, const void *id) {
return false;
}
void RefBase::onLastWeakRef(const void *id) {}
RefBase *RefBase::weakref_type::refBase() const {
return nullptr;
}
void RefBase::weakref_type::incWeak(const void *id) {}
void RefBase::weakref_type::incWeakRequireWeak(const void *id) {}
void RefBase::weakref_type::decWeak(const void *id) {}
bool RefBase::weakref_type::attemptIncStrong(const void *id) {
return false;
}
bool RefBase::weakref_type::attemptIncWeak(const void *id) {
return false;
}
void sp_report_race() {}
String8::String8() {}
String16::String16() {}
String16::String16(const String16 &o) {}
String16::String16(String16 &&o) noexcept {}
String16::String16(const char *o) {}
String16::~String16() {}
} // namespace android