Skip to content

Commit

Permalink
Changed: Migrating to ChickenHook RestrictionBypass
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsunedFox committed Dec 17, 2023
1 parent 3b5018b commit b164895
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit b164895

Please sign in to comment.