Codota Logo
io.sweers.blackmirror
Code IndexAdd Codota to your IDE (free)

How to use io.sweers.blackmirror

Best Java code snippets using io.sweers.blackmirror (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: hzsweers/blackmirror

@Override protected Class<?> loadClass(String name, boolean resolve)
  throws ClassNotFoundException {
 //Log.d("BlackMirror", "BlackMirror.loadClass - " + name + " " + resolve);
 ClassRequest request = ClassRequest.builder().name(name).build();
 return new InterceptorChain(interceptors, 0, request).proceed(request).clazz();
}
origin: hzsweers/blackmirror

 @Override public ClassResult intercept(Chain chain) throws ClassNotFoundException {
  return ClassResult.builder()
    .clazz(delegate.loadClass(chain.request().name()))
    .name(chain.request().name())
    .build();
 }
}
origin: hzsweers/blackmirror

@Override public ClassResult intercept(Chain chain) throws ClassNotFoundException {
 if (chain.request().name().equals("java.util.List")) {
  ClassResult result = chain.proceed(chain.request());
  return result.toBuilder().clazz(fakeClass(result.clazz())).build();
 }
 return chain.proceed(chain.request());
}
origin: hzsweers/blackmirror

 @Override public ClassResult intercept(Chain chain) throws ClassNotFoundException {
  if (chain.request().name().equals("android.widget.TextView")) {
   return chain.proceed(chain.request().toBuilder().name("android.widget.Button").build());
  }
  return chain.proceed(chain.request());
 }
}
origin: hzsweers/blackmirror

 @Override public ClassResult intercept(Chain chain) throws ClassNotFoundException {
  Timber.tag("BlackMirror").d("Loading \"%s\"", chain.request().name());
  return chain.proceed(chain.request());
 }
}
origin: hzsweers/blackmirror

@SuppressWarnings("ConstantConditions") @Override public boolean onCreate() {
 try {
  Log.d("BLAH", "InitProvider.static initializer - ");
  BlackMirror.install(getContext(), interceptors(getContext()));
  Log.d("BLAH", "InitProvider.static initializer - Success");
 } catch (Exception e) {
  e.printStackTrace();
 }
 return true;
}
origin: hzsweers/blackmirror

public static ClassLoader loadClassLoader(Context context) {
 try {
  ByteBuffer[] buffers = new ByteBuffer[1];
  // Read the dex file into memory as a bytebuffer
  InputStream is = context.getAssets().open("helloimpl.dex");
  buffers[0] = ByteBufferUtil.loadBuffer(is);
  return ByteBufferUtil.createClassLoaderFromDexFiles(context.getClassLoader(), buffers);
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}
origin: hzsweers/blackmirror

@SuppressWarnings("ConstantConditions") @Override public boolean onCreate() {
 try {
  Log.d("BLAH", "InitProvider.static initializer - ");
  BlackMirror.install(getContext());
  Log.d("BLAH", "InitProvider.static initializer - Success");
 } catch (Exception e) {
  e.printStackTrace();
 }
 return true;
}
origin: hzsweers/blackmirror

@Override public ClassResult proceed(ClassRequest request) throws ClassNotFoundException {
 if (index >= interceptors.size()) {
  throw new AssertionError("no interceptors added to the chain");
 }
 // Call the next interceptor in the chain.
 InterceptorChain next = new InterceptorChain(interceptors, index + 1, request);
 Interceptor interceptor = interceptors.get(index);
 ClassResult result = interceptor.intercept(next);
 // Confirm that the intercepted response isn't null.
 if (result == null) {
  throw new NullPointerException("interceptor " + interceptor + " returned null");
 }
 return result;
}
origin: hzsweers/blackmirror

 @Override public void onCreate() {
  super.onCreate();
  try {
   Timber.plant(new Timber.DebugTree());
   // Example of deferred classloading in application.
   // Can use BlackMirror.getInstance() directly or getClassLoader().
   // You're fine after this though
   Class<?> clazz = BlackMirror.getInstance().loadClass("io.sweers.blackmirror.app.AppDelegate");
   Method method = clazz.getDeclaredMethod("onCreate");
   method.setAccessible(true);
   method.invoke(null);
  } catch (Exception e) {
   throw new RuntimeException(e);
  }
 }
}
origin: hzsweers/blackmirror

public static Builder builder() {
 return new Builder();
}
origin: hzsweers/blackmirror

public Builder toBuilder() {
 return new Builder(this);
}
origin: hzsweers/blackmirror

 public ClassRequest build() {
  if (name == null) {
   throw new IllegalStateException("name == null");
  }
  return new ClassRequest(this);
 }
}
origin: hzsweers/blackmirror

private static synchronized void init(ClassLoader delegate, Context context,
  List<? extends Interceptor> interceptors) {
 instance = new BlackMirror(delegate, context.getApplicationInfo().sourceDir, interceptors);
}
origin: hzsweers/blackmirror

 public ClassResult build() {
  if (name == null) {
   throw new IllegalStateException("name == null");
  }
  if (clazz != null && !name.equals(clazz.getName())) {
   throw new IllegalStateException("name ("
     + name
     + ") "
     + "must be the class's fully qualified name ("
     + clazz.getName()
     + ")");
  }
  return new ClassResult(this);
 }
}
origin: hzsweers/blackmirror

 @Override public ClassResult intercept(Chain chain) throws ClassNotFoundException {
  if (chain.request().name().equals("android.widget.TextView")) {
   return ClassResult.builder().name(chain.request().name()).clazz(Button.class).build();
  }
  return chain.proceed(chain.request());
 }
}
origin: hzsweers/blackmirror

 @Override public ClassResult intercept(Chain chain) throws ClassNotFoundException {
  long start = SystemClock.elapsedRealtimeNanos();
  ClassResult result = chain.proceed(chain.request());
  Timber.tag("BlackMirror")
    .d("Loading \"%s\", took %dns", chain.request().name(),
      SystemClock.elapsedRealtimeNanos() - start);
  return result;
 }
}
origin: hzsweers/blackmirror

public static ClassLoader loadClassLoader(Context context) {
 try {
  ByteBuffer[] buffers = new ByteBuffer[1];
  // Read the dex file into memory as a bytebuffer
  InputStream is = context.getResources().openRawResource(R.raw.helloimpl);
  buffers[0] = ByteBufferUtil.loadBuffer(is);
  return ByteBufferUtil.createClassLoaderFromDexFiles(context.getClassLoader(), buffers);
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}
origin: hzsweers/blackmirror

public Builder toBuilder() {
 return new Builder(this);
}
origin: hzsweers/blackmirror

public static Builder builder() {
 return new Builder();
}
io.sweers.blackmirror

Most used classes

  • BlackMirror
    https://www.youtube.com/watch?v=kIvEu-XjZ40
  • ClassRequest
  • Interceptor$Chain
  • ByteBufferUtil
  • ClassRequest$Builder
  • ClassResult,
  • AssetsHelper,
  • ResourcesHelper,
  • Spies,
  • Interceptor,
  • InterceptorChain,
  • AssetsActivity,
  • BaseActivity,
  • BorrowServiceActivity,
  • LogcatActivity$ClassLoaderDisplayAdapter,
  • LogcatActivity$ItemView,
  • LogcatActivity,
  • MainActivity,
  • NeighborActivity
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