mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-04 20:42:02 +08:00
Fix make class inheritable
This commit is contained in:
parent
2bd7051841
commit
050561ac9a
@ -858,7 +858,7 @@ public:
|
||||
Iterator operator++(int) { return Iterator(e_++); }
|
||||
Iterator operator--(int) { return Iterator(e_--); }
|
||||
bool operator==(const Iterator &other) const { return other.e_ == e_; }
|
||||
bool operator!=(const Iterator &other) const { return other.e_ == e_; }
|
||||
bool operator!=(const Iterator &other) const { return other.e_ != e_; }
|
||||
};
|
||||
|
||||
class ConstIterator {
|
||||
@ -874,7 +874,7 @@ public:
|
||||
ConstIterator operator++(int) { return ConstIterator(e_++); }
|
||||
ConstIterator operator--(int) { return ConstIterator(e_--); }
|
||||
bool operator==(const ConstIterator &other) const { return other.e_ == e_; }
|
||||
bool operator!=(const ConstIterator &other) const { return other.e_ == e_; }
|
||||
bool operator!=(const ConstIterator &other) const { return other.e_ != e_; }
|
||||
};
|
||||
|
||||
auto begin() {
|
||||
|
@ -669,14 +669,14 @@ using ::lsplant::IsHooked;
|
||||
LOGE("target class is null");
|
||||
return false;
|
||||
}
|
||||
auto constructors =
|
||||
const auto constructors =
|
||||
JNI_Cast<jobjectArray>(JNI_CallObjectMethod(env, target, class_get_declared_constructors));
|
||||
uint8_t access_flags = JNI_GetIntField(env, target, class_access_flags);
|
||||
constexpr static uint32_t kAccFinal = 0x0010;
|
||||
JNI_SetIntField(env, target, class_access_flags, static_cast<jint>(access_flags & ~kAccFinal));
|
||||
for (auto &constructor : constructors) {
|
||||
auto *method = ArtMethod::FromReflectedMethod(env, constructor.get());
|
||||
if (method && (!method->IsPublic() || !method->IsProtected())) method->SetProtected();
|
||||
if (method && !method->IsPublic() && !method->IsProtected()) method->SetProtected();
|
||||
if (method && method->IsFinal()) method->SetNonFinal();
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user