Skip to content

Commit

Permalink
Merge pull request #458 from shily/master
Browse files Browse the repository at this point in the history
fixed Hook BluetoothAdapter#getAddress failed >= JELLY_BEAN_MR1
  • Loading branch information
247321453 authored Jun 1, 2018
2 parents 2c593a5 + 31559f6 commit f3b0767
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.lang.reflect.Method;

import mirror.android.bluetooth.IBluetooth;
import mirror.android.bluetooth.IBluetoothManager;

/**
* @see android.bluetooth.BluetoothManager
Expand All @@ -19,7 +20,8 @@ public class BluetoothStub extends BinderInvocationProxy {
"bluetooth";

public BluetoothStub() {
super(IBluetooth.Stub.asInterface, SERVICE_NAME);
super(Build.VERSION.SDK_INT >= 17 ? IBluetoothManager.Stub.asInterface : IBluetooth.Stub.asInterface,
SERVICE_NAME);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package mirror.android.bluetooth;

import android.os.IBinder;
import android.os.IInterface;

import mirror.MethodParams;
import mirror.RefClass;
import mirror.RefStaticMethod;

public class IBluetoothManager {
/**
* @see android.bluetooth.IBluetoothManager
* */
public static Class<?> TYPE = RefClass.load(IBluetoothManager.class, "android.bluetooth.IBluetoothManager");
/**
* @see android.bluetooth.IBluetoothManager.Stub
* */
public static class Stub {
public static Class<?> TYPE = RefClass.load(Stub.class, "android.bluetooth.IBluetoothManager$Stub");
@MethodParams({IBinder.class})
public static RefStaticMethod<IInterface> asInterface;
}
}

0 comments on commit f3b0767

Please sign in to comment.