Codota Logo
com.lody.virtual.helper.compat
Code IndexAdd Codota to your IDE (free)

How to use com.lody.virtual.helper.compat

Best Java code snippets using com.lody.virtual.helper.compat (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: android-hacker/VirtualXposed

public static int copyNativeBinaries(File apkFile, File sharedLibraryDir) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    return copyNativeBinariesAfterL(apkFile, sharedLibraryDir);
  } else {
    return copyNativeBinariesBeforeL(apkFile, sharedLibraryDir);
  }
}
origin: android-hacker/VirtualXposed

  private static RefStaticMethod<IInterface> getInterfaceMethod() {
    if (BuildCompat.isOreo()) {
      return IStorageManager.Stub.asInterface;
    } else {
      return IMountService.Stub.asInterface;
    }
  }
}
origin: android-hacker/VirtualXposed

/**
 * Return first index of {@code value} in {@code array}, or {@code -1} if
 * not found.
 */
public static <T> int indexOf(T[] array, T value) {
  if (array == null) return -1;
  for (int i = 0; i < array.length; i++) {
    if (ObjectsCompat.equals(array[i], value)) return i;
  }
  return -1;
}
origin: android-hacker/VirtualXposed

@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
  String processName = (String) args[0];
  int uid = (int) args[1];
  int flags = (int) args[2];
  List<ProviderInfo> infos = VPackageManager.get().queryContentProviders(processName, uid, flags);
  if (ParceledListSliceCompat.isReturnParceledListSlice(method)) {
    return ParceledListSliceCompat.create(infos);
  }
  return infos;
}
origin: android-hacker/VirtualXposed

public static ContentProviderClient crazyAcquireContentProvider(Context context, String name) {
  ContentProviderClient client = acquireContentProviderClient(context, name);
  if (client == null) {
    int retry = 0;
    while (retry < 5 && client == null) {
      SystemClock.sleep(100);
      retry++;
      client = acquireContentProviderClient(context, name);
    }
  }
  return client;
}
origin: android-hacker/VirtualXposed

@Override
public Bundle call(String method, String arg, Bundle extras) {
  if ("@".equals(method)) {
    Bundle bundle = new Bundle();
    BundleCompat.putBinder(bundle, "_VA_|_binder_", mServiceFetcher);
    return bundle;
  }
  return null;
}
origin: android-hacker/VirtualXposed

public static boolean isOreo() {
  return (Build.VERSION.SDK_INT == 25 && getPreviewSDKInt() > 0)
      || Build.VERSION.SDK_INT > 25;
}
origin: android-hacker/VirtualXposed

public static String get(String key, String defaultValue) {
  try {
    return getInner(key, defaultValue);
  } catch (Exception var3) {
    var3.printStackTrace();
    return defaultValue;
  }
}
origin: android-hacker/VirtualXposed

public static Bundle call(String authority, Context context, String method, String arg, Bundle bundle) {
  Uri uri = Uri.parse("content://" + authority);
  return ContentProviderCompat.call(context, uri, method, arg, bundle);
}
origin: android-hacker/VirtualXposed

@Override
public void callActivityOnCreate(Activity activity, Bundle icicle, PersistableBundle persistentState) {
  if (icicle != null) {
    BundleCompat.clearParcelledData(icicle);
  }
  super.callActivityOnCreate(activity, icicle, persistentState);
}
origin: android-hacker/VirtualXposed

private static String getInner(String key, String defaultValue)
    throws NoSuchMethodException, IllegalAccessException,
    InvocationTargetException, ClassNotFoundException {
  Class clazz = getSystemPropertiesClass();
  return (String) Reflect.on(clazz).call("get", key, defaultValue).get();
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int flags = (Integer) args[0];
    int userId = VUserHandle.myUserId();
    List<ApplicationInfo> appInfos = VPackageManager.get().getInstalledApplications(flags, userId);
    if (ParceledListSliceCompat.isReturnParceledListSlice(method)) {
      return ParceledListSliceCompat.create(appInfos);
    }
    return appInfos;
  }
}
origin: android-hacker/VirtualXposed

  private static boolean isOreo() {
    return BuildCompat.isOreo() &&
        !DeviceUtil.isSamsung()
        || ClipboardManager.getService == null;
  }
}
origin: android-hacker/VirtualXposed

@Override
protected boolean allowFilterResult(VPackage.ActivityIntentInfo filter, List<ResolveInfo> dest) {
  ActivityInfo filterAi = filter.activity.info;
  for (int i = dest.size() - 1; i >= 0; i--) {
    ActivityInfo destAi = dest.get(i).activityInfo;
    if (ObjectsCompat.equals(destAi.name, filterAi.name) && ObjectsCompat.equals(destAi.packageName, filterAi.packageName)) {
      return false;
    }
  }
  return true;
}
origin: android-hacker/VirtualXposed

public static ContentProviderClient crazyAcquireContentProvider(Context context, Uri uri) {
  ContentProviderClient client = acquireContentProviderClient(context, uri);
  if (client == null) {
    int retry = 0;
    while (retry < 5 && client == null) {
      SystemClock.sleep(100);
      retry++;
      client = acquireContentProviderClient(context, uri);
    }
  }
  return client;
}
origin: android-hacker/VirtualXposed

public void setUiCallback(Intent intent, IUiCallback callback) {
  if (callback != null) {
    Bundle bundle = new Bundle();
    BundleCompat.putBinder(bundle, "_VA_|_ui_callback_", callback.asBinder());
    intent.putExtra("_VA_|_sender_", bundle);
  }
}
origin: android-hacker/VirtualXposed

  public static IInterface asInterface(IBinder binder) {
    if (BuildCompat.isOreo()) {
      return IApplicationThreadOreo.Stub.asInterface.call(binder);
    }
    return ApplicationThreadNative.asInterface.call(binder);
  }
}
origin: android-hacker/VirtualXposed

@Override
protected boolean allowFilterResult(VPackage.ServiceIntentInfo filter, List<ResolveInfo> dest) {
  ServiceInfo filterSi = filter.service.info;
  for (int i = dest.size() - 1; i >= 0; i--) {
    ServiceInfo destAi = dest.get(i).serviceInfo;
    if (ObjectsCompat.equals(destAi.name, filterSi.name)
        && ObjectsCompat.equals(destAi.packageName, filterSi.packageName)) {
      return false;
    }
  }
  return true;
}
origin: android-hacker/VirtualXposed

private static void clearContentProvider(Object cache) {
  if (BuildCompat.isOreo()) {
    Object holder = Settings.NameValueCacheOreo.mProviderHolder.get(cache);
    if (holder != null) {
      Settings.ContentProviderHolder.mContentProvider.set(holder, null);
    }
  } else {
    Settings.NameValueCache.mContentProvider.set(cache, null);
  }
}
origin: android-hacker/VirtualXposed

@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
protected boolean allowFilterResult(VPackage.ProviderIntentInfo filter, List<ResolveInfo> dest) {
  ProviderInfo filterPi = filter.provider.info;
  for (int i = dest.size() - 1; i >= 0; i--) {
    ProviderInfo destPi = dest.get(i).providerInfo;
    if (ObjectsCompat.equals(destPi.name, filterPi.name)
        && ObjectsCompat.equals(destPi.packageName, filterPi.packageName)) {
      return false;
    }
  }
  return true;
}
com.lody.virtual.helper.compat

Most used classes

  • ActivityManagerCompat
  • ApplicationThreadCompat
  • BuildCompat
  • BundleCompat
  • ContentProviderCompat
  • NativeLibraryHelperCompat,
  • ObjectsCompat,
  • PackageParserCompat,
  • ParceledListSliceCompat,
  • StorageManagerCompat,
  • SystemPropertiesCompat
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now