本文整理汇总了Java中android.os.IInterface.asBinder方法的典型用法代码示例。如果您正苦于以下问题:Java IInterface.asBinder方法的具体用法?Java IInterface.asBinder怎么用?Java IInterface.asBinder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.IInterface
的用法示例。
在下文中一共展示了IInterface.asBinder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import android.os.IInterface; //导入方法依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
IInterface sender = (IInterface) args[0];
if (sender != null) {
IBinder binder = sender.asBinder();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
PendingIntent pendingIntent = PendingIntentData.readPendingIntent(binder);
Intent intent = PendingIntentJBMR2.getIntent.call(pendingIntent);
if (intent != null) {
String creator = intent.getStringExtra("_VA_|_creator_");
if (creator != null) {
return creator;
}
}
} else {
PendingIntentData data = VActivityManager.get().getPendingIntent(binder);
if (data != null) {
return data.creator;
}
}
}
return super.call(who, method, args);
}
示例2: call
import android.os.IInterface; //导入方法依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
MethodParameterUtils.replaceFirstAppPkg(args);
args[IDX_RequiredPermission] = null;
IntentFilter filter = (IntentFilter) args[IDX_IntentFilter];
SpecialComponentList.protectIntentFilter(filter);
if (args.length > IDX_IIntentReceiver && IIntentReceiver.class.isInstance(args[IDX_IIntentReceiver])) {
final IInterface old = (IInterface) args[IDX_IIntentReceiver];
if (!IIntentReceiverProxy.class.isInstance(old)) {
final IBinder token = old.asBinder();
if (token != null) {
token.linkToDeath(new IBinder.DeathRecipient() {
@Override
public void binderDied() {
token.unlinkToDeath(this, 0);
mProxyIIntentReceivers.remove(token);
}
}, 0);
IIntentReceiver proxyIIntentReceiver = mProxyIIntentReceivers.get(token);
if (proxyIIntentReceiver == null) {
proxyIIntentReceiver = new IIntentReceiverProxy(old);
mProxyIIntentReceivers.put(token, proxyIIntentReceiver);
}
WeakReference mDispatcher = LoadedApk.ReceiverDispatcher.InnerReceiver.mDispatcher.get(old);
if (mDispatcher != null) {
LoadedApk.ReceiverDispatcher.mIIntentReceiver.set(mDispatcher.get(), proxyIIntentReceiver);
args[IDX_IIntentReceiver] = proxyIIntentReceiver;
}
}
}
}
return method.invoke(who, args);
}
示例3: call
import android.os.IInterface; //导入方法依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
HookUtils.replaceFirstAppPkg(args);
args[IDX_RequiredPermission] = null;
IntentFilter filter = (IntentFilter) args[IDX_IntentFilter];
IntentFilter backupFilter = new IntentFilter(filter);
protectIntentFilter(filter);
if (args.length > IDX_IIntentReceiver && IIntentReceiver.class.isInstance(args[IDX_IIntentReceiver])) {
final IInterface old = (IInterface) args[IDX_IIntentReceiver];
if (!IIntentReceiverProxy.class.isInstance(old)) {
final IBinder token = old.asBinder();
if (token != null) {
token.linkToDeath(new IBinder.DeathRecipient() {
@Override
public void binderDied() {
token.unlinkToDeath(this, 0);
mProxyIIntentReceivers.remove(token);
}
}, 0);
IIntentReceiver proxyIIntentReceiver = mProxyIIntentReceivers.get(token);
if (proxyIIntentReceiver == null) {
proxyIIntentReceiver = new IIntentReceiverProxy(old);
mProxyIIntentReceivers.put(token, proxyIIntentReceiver);
}
WeakReference mDispatcher = LoadedApk.ReceiverDispatcher.InnerReceiver.mDispatcher.get(old);
if (mDispatcher != null) {
LoadedApk.ReceiverDispatcher.mIIntentReceiver.set(mDispatcher.get(), proxyIIntentReceiver);
args[IDX_IIntentReceiver] = proxyIIntentReceiver;
}
}
}
}
Object res = method.invoke(who, args);
Intent intent = VActivityManager.get().dispatchStickyBroadcast(backupFilter);
if (intent != null) {
return intent;
}
return res;
}