Skip to content

Commit

Permalink
update translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev4Mod committed Aug 2, 2024
1 parent 7b72a17 commit fbf9417
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public static void hook(XC_LoadPackage.LoadPackageParam lpparam) {
try {
if ("android".equals(lpparam.packageName) && "android".equals(lpparam.processName) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
hookService(lpparam);
} else if ("com.android.providers.settings".equals(lpparam.packageName) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
} else if ("com.android.providers.settings".equals(lpparam.packageName)) {
hookSettings(lpparam);
}
} catch (Exception e) {
XposedBridge.log(e);
}
}

Expand All @@ -52,14 +53,19 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Method mGetContext = param.thisObject.getClass().getMethod("getContext");
Context context = (Context) mGetContext.invoke(param.thisObject);
XposedBridge.log("Wa Enhancer: Trying to allow blocking ");
XposedHelpers.callStaticMethod(Binder.class, "allowBlockingForCurrentThread");
try {
XposedHelpers.callStaticMethod(Binder.class, "allowBlockingForCurrentThread");
} catch (Throwable ignored) {
}
var result = Utils.binderLocalScope(() -> {
var uri = Uri.parse("content://com.wmods.waenhancer.hookprovider");
return context.getContentResolver().call(uri, "getHookBinder", null, null);
});
XposedBridge.log(String.valueOf(result));
param.setResult(result);
XposedHelpers.callStaticMethod(Binder.class, "defaultBlockingForCurrentThread");
try {
XposedHelpers.callStaticMethod(Binder.class, "defaultBlockingForCurrentThread");
} catch (Throwable ignored) {
}
XposedBridge.log("Wa Enhancer: Bypass Scope using Provider Settings");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;

public class BridgeClient extends BaseClient implements ServiceConnection {
private final Context context;
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
Expand Down Expand Up @@ -71,11 +74,11 @@ public CompletableFuture<Boolean> connect() {
HandlerThread handlerThread = new HandlerThread("BridgeClient");
handlerThread.start();
Handler handler = new Handler(handlerThread.getLooper());
Class<?> contextClass = context.getClass();
contextClass.getMethod("bindServiceAsUser", Intent.class, ServiceConnection.class, int.class, Handler.class, android.os.Process.class)
.invoke(context, intent, this, Context.BIND_AUTO_CREATE, handler, android.os.Process.myUserHandle());
XposedHelpers.callMethod(context, "bindServiceAsUser", intent, this, Context.BIND_AUTO_CREATE,
handler, android.os.Process.myUserHandle());
}
} catch (Exception e) {
XposedBridge.log(e);
resumeContinuation(false);
}
return continuation.join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
hookAllMethods(XposedHelpers.findClass("com.android.server.pm.PackageManagerService", lpparam.classLoader), "checkDowngrade", new XC_MethodHook() {
public void beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
Object packageInfoLite = methodHookParam.args[0];
var packageName = XposedHelpers.getObjectField(packageInfoLite, "mPackageName");
var packageName = XposedHelpers.getObjectField(packageInfoLite, "packageName");
if (packageName == FeatureLoader.PACKAGE_WPP || packageName == FeatureLoader.PACKAGE_BUSINESS) {
Field field = packageClazz.getField("mVersionCode");
field.setAccessible(true);
Expand Down
8 changes: 3 additions & 5 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[WHATSAPP]
* Improved performance when browsing and opening the app

[WA ENHANCER]
* Improved compatibility for connecting to the bridge (If you are still having problems, select the System Framework in LSposed and restart, now there are two connection methods that are automatically selected)
* Update translations
* Fixed connection to the bridge in Android 9
* Fixed issue with downgrade feature on Android 9

0 comments on commit fbf9417

Please sign in to comment.