當前位置: 首頁>>代碼示例>>Java>>正文


Java ArrayUtils.indexOfFirst方法代碼示例

本文整理匯總了Java中com.lody.virtual.helper.utils.ArrayUtils.indexOfFirst方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayUtils.indexOfFirst方法的具體用法?Java ArrayUtils.indexOfFirst怎麽用?Java ArrayUtils.indexOfFirst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.lody.virtual.helper.utils.ArrayUtils的用法示例。


在下文中一共展示了ArrayUtils.indexOfFirst方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
        return method.invoke(who, args);
    }
    int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
    int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
    int id = (int) args[idIndex];
    id = VNotificationManager.get().dealNotificationId(id, pkg, null, getAppUserId());
    args[idIndex] = id;
    Notification notification = (Notification) args[notificationIndex];
    if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
        return 0;
    }
    VNotificationManager.get().addNotification(id, null, pkg, getAppUserId());
    args[0] = getHostPkg();
    return method.invoke(who, args);
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:20,代碼來源:MethodProxies.java

示例2: beforeCall

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
     public boolean beforeCall(Object who, Method method, Object... args) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && args[0] instanceof String) {
	args[0] = getHostPkg();
}
         int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
         if (index >= 0) {
             args[index] = null;
         }
         return true;
     }
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:12,代碼來源:AlarmManagerStub.java

示例3: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WindowManager.LayoutParams.class);
    if (index != -1) {
        WindowManager.LayoutParams attrs = (WindowManager.LayoutParams) args[index];
        if (attrs != null) {
            attrs.packageName = getHostPkg();
        }
    }
    return method.invoke(who, args);
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:12,代碼來源:BaseMethodProxy.java

示例4: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    if (noEditorInfo == null) {
        editorInfoIndex = ArrayUtils.indexOfFirst(args, EditorInfo.class);
        noEditorInfo = editorInfoIndex == -1;
    }
    if (!noEditorInfo) {
        EditorInfo attribute = (EditorInfo) args[editorInfoIndex];
        if (attribute != null) {
            attribute.packageName = getHostPkg();
        }
    }
    return method.invoke(who, args);
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:15,代碼來源:MethodProxies.java

示例5: replaceFirstAppPkg

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
public static String replaceFirstAppPkg(Object[] args) {
	if (args == null) {
		return null;
	}
	int index = ArrayUtils.indexOfFirst(args, String.class);
	if (index != -1) {
		String pkg = (String) args[index];
		args[index] = VirtualCore.get().getHostPkg();
		return pkg;
	}
	return null;
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:13,代碼來源:MethodParameterUtils.java

示例6: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
    if (index >= 0) {
        args[index] = null;
    }
    return super.call(who, method, args);
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:9,代碼來源:WifiManagerStub.java

示例7: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    int editorInfoIndex = ArrayUtils.indexOfFirst(args, EditorInfo.class);
    if (editorInfoIndex != -1) {
        EditorInfo attribute = (EditorInfo) args[editorInfoIndex];
        attribute.packageName = getHostPkg();
    }
    return method.invoke(who, args);
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:10,代碼來源:MethodProxies.java

示例8: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
    public Object call(Object who, Method method, Object... args) throws Throwable {
        //15 enqueueNotificationWithTag(pkg, tag, id, notification, idOut);
        //16 enqueueNotificationWithTag(pkg, tag, id, notification, idOut);
        //17 enqueueNotificationWithTag(pkg, tag, id, notification, idOut, UserHandle.myUserId());
        //18 enqueueNotificationWithTag(pkg, mContext.getBasePackageName(), tag, id, notification, idOut, UserHandle.myUserId());
        //19 enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id, notification, idOut, UserHandle.myUserId());
        //21 enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id, notification, idOut, UserHandle.myUserId());
        //22 enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id, notification, idOut, UserHandle.myUserId());
        //23 enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id, notification, idOut, UserHandle.myUserId());
        //24 enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id, notification, idOut, user.getIdentifier());
        //25 enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id, notification, idOut, user.getIdentifier());
        String pkg = (String) args[0];
        int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
        int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
        int tagIndex = (Build.VERSION.SDK_INT >= 18 ? 2 : 1);
        int id = (int) args[idIndex];
//        int user = (Build.VERSION.SDK_INT>=17?((int)args[args.length-1]):0);
        String tag = (String) args[tagIndex];
        //先處理id,再處理tag
        id = VNotificationManager.get().dealNotificationId(id, pkg, tag, getVUserId());
        tag = VNotificationManager.get().dealNotificationTag(id, pkg, tag, getVUserId());
        args[idIndex] = id;
        args[tagIndex] = tag;
        //tag和id確定一個通知欄是否重複
        Notification notification = (Notification) args[notificationIndex];
        if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
            return 0;
        }
        VNotificationManager.get().addNotification(id, tag, pkg, getVUserId());
        args[0] = getHostPkg();
        if (Build.VERSION.SDK_INT >= 18 && args[1] instanceof String) {
            args[1] = getHostPkg();
        }
        return method.invoke(who, args);
    }
 
開發者ID:codehz,項目名稱:container,代碼行數:37,代碼來源:EnqueueNotificationWithTag.java

示例9: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
        return method.invoke(who, args);
    }
    int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
    int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
    int tagIndex = (Build.VERSION.SDK_INT >= 18 ? 2 : 1);
    int id = (int) args[idIndex];
    String tag = (String) args[tagIndex];

    id = VNotificationManager.get().dealNotificationId(id, pkg, tag, getAppUserId());
    tag = VNotificationManager.get().dealNotificationTag(id, pkg, tag, getAppUserId());
    args[idIndex] = id;
    args[tagIndex] = tag;
    //key(tag,id)
    Notification notification = (Notification) args[notificationIndex];
    if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
        return 0;
    }
    VNotificationManager.get().addNotification(id, tag, pkg, getAppUserId());
    args[0] = getHostPkg();
    if (Build.VERSION.SDK_INT >= 18 && args[1] instanceof String) {
        args[1] = getHostPkg();
    }
    return method.invoke(who, args);
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:29,代碼來源:MethodProxies.java

示例10: getFirstParam

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
public static <T> T getFirstParam(Object[] args, Class<T> tClass) {
	if (args == null) {
		return null;
	}
	int index = ArrayUtils.indexOfFirst(args, tClass);
	if (index != -1) {
		return (T) args[index];
	}
	return null;
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:11,代碼來源:MethodParameterUtils.java

示例11: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
	if (cacheIndex == -1) {
		cacheIndex = ArrayUtils.indexOfFirst(args, WindowManager.LayoutParams.class);
	}
	if (cacheIndex != -1) {
		WindowManager.LayoutParams attrs = (WindowManager.LayoutParams) args[cacheIndex];
		if (attrs != null) {
			attrs.packageName = getHostPkg();
		}
	}
	return method.invoke(who, args);
}
 
開發者ID:codehz,項目名稱:container,代碼行數:14,代碼來源:BaseReplacePkgName.java

示例12: call

import com.lody.virtual.helper.utils.ArrayUtils; //導入方法依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
	String pkg = (String) args[0];
	int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
	boolean enable = (boolean) args[enableIndex];
	VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getVUserId());
	return 0;
}
 
開發者ID:codehz,項目名稱:container,代碼行數:9,代碼來源:SetNotificationsEnabledForPackage.java


注:本文中的com.lody.virtual.helper.utils.ArrayUtils.indexOfFirst方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。