Java 类android.content.IIntentReceiver 实例源码

项目:prevent    文件:ActivityManagerService.java   
public final int broadcastIntent(IApplicationThread caller,
                                 Intent intent, String resolvedType, IIntentReceiver resultTo,
                                 int resultCode, String resultData, Bundle resultExtras,
                                 String[] requiredPermissions, int appOp, Bundle bOptions,
                                 boolean serialized, boolean sticky, int userId) {
    try {
        PreventRunningUtils.setSender(caller);
        int res = broadcastIntent$Pr(caller,
                intent, resolvedType, resultTo,
                resultCode, resultData, resultExtras,
                requiredPermissions, appOp, bOptions,
                serialized, sticky, userId);
        if (res == 0) {
            PreventRunningUtils.onBroadcastIntent(intent);
        }
        return res;
    } finally {
        PreventRunningUtils.clearSender();
    }
}
项目:prevent    文件:ActivityManagerService.java   
public final int broadcastIntent(IApplicationThread caller,
                                 Intent intent, String resolvedType, IIntentReceiver resultTo,
                                 int resultCode, String resultData, Bundle map,
                                 String requiredPermission, int appOp, boolean serialized, boolean sticky, int userId) {
    try {
        PreventRunningUtils.setSender(caller);
        int res = broadcastIntent$Pr(caller,
                intent, resolvedType, resultTo,
                resultCode, resultData, map,
                requiredPermission, appOp, serialized, sticky, userId);
        if (res == 0) {
            PreventRunningUtils.onBroadcastIntent(intent);
        }
        return res;
    } finally {
        PreventRunningUtils.clearSender();
    }
}
项目:TPlayer    文件:MethodProxies.java   
public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered,
                           boolean sticky, int sendingUser) throws RemoteException {
    if (!accept(intent)) {
        return;
    }
    if (intent.hasExtra("_VA_|_intent_")) {
        intent = intent.getParcelableExtra("_VA_|_intent_");
    }
    SpecialComponentList.unprotectIntent(intent);
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
        IIntentReceiverJB.performReceive.call(mOld, intent, resultCode, data, extras, ordered, sticky, sendingUser);
    } else {
        mirror.android.content.IIntentReceiver.performReceive.call(mOld, intent, resultCode, data, extras, ordered, sticky);
    }
}
项目:VirtualHook    文件:MethodProxies.java   
@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);
}
项目:VirtualHook    文件:MethodProxies.java   
public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered,
                           boolean sticky, int sendingUser) throws RemoteException {
    if (!accept(intent)) {
        return;
    }
    if (intent.hasExtra("_VA_|_intent_")) {
        intent = intent.getParcelableExtra("_VA_|_intent_");
    }
    SpecialComponentList.unprotectIntent(intent);
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
        IIntentReceiverJB.performReceive.call(mOld, intent, resultCode, data, extras, ordered, sticky, sendingUser);
    } else {
        mirror.android.content.IIntentReceiver.performReceive.call(mOld, intent, resultCode, data, extras, ordered, sticky);
    }
}
项目:Brevent    文件:IActivityManager.java   
/**
 * @deprecated since api-23
 */
@Deprecated
int broadcastIntent(IApplicationThread caller, Intent intent,
                    String resolvedType, IIntentReceiver resultTo, int resultCode,
                    String resultData, Bundle map, String requiredPermissions,
                    int appOp, boolean serialized, boolean sticky, int userId)
        throws RemoteException;
项目:Brevent    文件:IActivityManager.java   
/**
 * since api-23
 */
@RequiresApi(Build.VERSION_CODES.M)
int broadcastIntent(IApplicationThread caller, Intent intent,
                    String resolvedType, IIntentReceiver resultTo, int resultCode,
                    String resultData, Bundle map, String[] requiredPermissions,
                    int appOp, Bundle options, boolean serialized, boolean sticky, int userId)
        throws RemoteException;
项目:prevent    文件:ActivityManagerService.java   
public final int broadcastIntent$Pr(IApplicationThread caller,
                                    Intent intent, String resolvedType, IIntentReceiver resultTo,
                                    int resultCode, String resultData, Bundle resultExtras,
                                    String[] requiredPermissions, int appOp, Bundle bOptions,
                                    boolean serialized, boolean sticky, int userId) {
    throw new UnsupportedOperationException();
}
项目:TPlayer    文件:MethodProxies.java   
@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);
}
项目:container    文件:RegisterReceiver.java   
@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;
}
项目:container    文件:RegisterReceiver.java   
public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered,
                           boolean sticky, int sendingUser) throws RemoteException {
    if (!accept(intent)) {
        return;
    }
    if (intent.hasExtra("_VA_|_intent_")) {
        intent = intent.getParcelableExtra("_VA_|_intent_");
    }
    SpecialComponentList.unprotectIntent(intent);
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
        IIntentReceiverJB.performReceive.call(old, intent, resultCode, data, extras, ordered, sticky, sendingUser);
    } else {
        mirror.android.content.IIntentReceiver.performReceive.call(old, intent, resultCode, data, extras, ordered, sticky);
    }
}
项目:droidel    文件:ActivityThread.java   
public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
        int resultCode, String dataStr, Bundle extras, boolean ordered,
        boolean sticky, int sendingUser, int processState) throws RemoteException {
    updateProcessState(processState, false);
    receiver.performReceive(intent, resultCode, dataStr, extras, ordered,
            sticky, sendingUser);
}
项目:VirtualAPK    文件:LoadedApk.java   
public IIntentReceiver getReceiverDispatcher(final BroadcastReceiver r, final Context context, final Handler handler, final Instrumentation instrumentation, final boolean registered) {
    throw new RuntimeException("Stub!");
}
项目:VirtualAPK    文件:LoadedApk.java   
public IIntentReceiver forgetReceiverDispatcher(final Context context, final BroadcastReceiver r) {
    throw new RuntimeException("Stub!");
}
项目:prevent    文件:ActivityManagerService.java   
public final int broadcastIntent$Pr(IApplicationThread caller,
                                    Intent intent, String resolvedType, IIntentReceiver resultTo,
                                    int resultCode, String resultData, Bundle map,
                                    String requiredPermission, int appOp, boolean serialized, boolean sticky, int userId) {
    throw new UnsupportedOperationException();
}