Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed: Migrating to ChickenHook RestrictionBypass #3744

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion termux-shared/build.gradle 100644 → 100755
Expand Up @@ -14,7 +14,7 @@ android {
implementation "io.noties.markwon:ext-strikethrough:$markwonVersion"
implementation "io.noties.markwon:linkify:$markwonVersion"
implementation "io.noties.markwon:recycler:$markwonVersion"
implementation "org.lsposed.hiddenapibypass:hiddenapibypass:2.0"
implementation "com.github.ChickenHook:RestrictionBypass:2.2"

// Do not increment version higher than 1.0.0-alpha09 since it will break ViewUtils and needs to be looked into
// noinspection GradleDependency
Expand Down
6 changes: 3 additions & 3 deletions termux-shared/src/main/java/com/termux/shared/reflection/ReflectionUtils.java 100644 → 100755
Expand Up @@ -7,7 +7,7 @@

import com.termux.shared.logger.Logger;

import org.lsposed.hiddenapibypass.HiddenApiBypass;
import org.chickenhook.restrictionbypass.Unseal;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
Expand All @@ -22,14 +22,14 @@ public class ReflectionUtils {

/**
* Bypass android hidden API reflection restrictions.
* https://github.com/LSPosed/AndroidHiddenApiBypass
* https://github.com/ChickenHook/RestrictionBypass
* https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces
*/
public static void bypassHiddenAPIReflectionRestrictions() {
if (!HIDDEN_API_REFLECTION_RESTRICTIONS_BYPASSED && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
Logger.logDebug(LOG_TAG, "Bypassing android hidden api reflection restrictions");
try {
HiddenApiBypass.addHiddenApiExemptions("");
Unseal.unseal();
} catch (Throwable t) {
Logger.logStackTraceWithMessage(LOG_TAG, "Failed to bypass hidden API reflection restrictions", t);
}
Expand Down