Java 类com.facebook.stetho.InspectorModulesProvider 实例源码

项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
private RealmInspectorModulesProvider(String packageName,
                                      InspectorModulesProvider baseProvider,
                                      File folder,
                                      boolean withMetaTables,
                                      Pattern databaseNamePattern,
                                      long limit,
                                      boolean ascendingOrder,
                                      byte[] defaultEncryptionKey,
                                      Map<String, byte[]> encryptionKeys) {
    this.packageName = packageName;
    this.baseProvider = baseProvider;
    this.folder = folder;
    this.withMetaTables = withMetaTables;
    if (databaseNamePattern == null) {
        this.databaseNamePattern = DEFAULT_DATABASE_NAME_PATTERN;
    } else {
        this.databaseNamePattern = databaseNamePattern;
    }
    this.limit = limit;
    this.ascendingOrder = ascendingOrder;
    this.defaultEncryptionKey = defaultEncryptionKey;
    this.encryptionKeys = encryptionKeys == null ? Collections.<String, byte[]>emptyMap() : encryptionKeys;
}
项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
public RealmInspectorModulesProvider build() {
    final InspectorModulesProvider baseProvider =
            (this.baseProvider != null)
                    ? this.baseProvider
                    : Stetho.defaultInspectorModulesProvider(applicationContext);

    //noinspection deprecation
    return new RealmInspectorModulesProvider(
            applicationContext.getPackageName(),
            baseProvider,
            folder,
            withMetaTables,
            databaseNamePattern,
            limit,
            ascendingOrder,
            defaultEncryptionKey,
            encryptionKeys);
}
项目:stetho-realm    文件:StethoRealmInspectorModulesProvider.java   
StethoRealmInspectorModulesProvider(Context applicationContext,
    InspectorModulesProvider baseProvider, File[] dirs, Pattern namePattern,
    Map<String, byte[]> encryptionKeys) {
    this.applicationContext = applicationContext;
    this.baseProvider = baseProvider;
    this.dirs = dirs;
    this.namePattern = namePattern;
    this.encryptionKeys = encryptionKeys;
}
项目:droidconde-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:devfestnantes-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:mobilization-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:droidconat-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
@Deprecated
public static RealmInspectorModulesProvider wrap(Context context,
                                                 InspectorModulesProvider provider,
                                                 boolean withMetaTables,
                                                 Pattern databaseNamePattern) {
    return new RealmInspectorModulesProvider(context.getPackageName(), provider, context.getFilesDir(), withMetaTables, databaseNamePattern, DEFAULT_LIMIT, DEFAULT_ASCENDING_ORDER, null, null);
}
项目:devoxxfr-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:droidcongr-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:droidcontn-2016    文件:StethoInitializer.java   
private InspectorModulesProvider createWebkitModulesProvider() {
    return () -> new Stetho.DefaultInspectorModulesBuilder(context).runtimeRepl(
            new JsRuntimeReplFactoryBuilder(context)
                    .addFunction("activity", new BaseFunction() {
                        @Override
                        public Object call(org.mozilla.javascript.Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
                            return activityProvider.getCurrentActivity();
                        }
                    }).build()
    ).finish();
}
项目:asstudydemo    文件:DemoApplication.java   
@Override
    public void onCreate() {
        super.onCreate();
        if (null == demoAppContext) {
            demoAppContext = getApplicationContext();
        }
//        queues = Volley.newRequestQueue(demoAppContext);
//        CrashHandler crashHandler = CrashHandler.getInstance();
//        crashHandler.init(getApplicationContext());
//        crashHandler.initActivityContainer(container);
        container = new ArrayList<>(5);

        if (Constants.IS_OPEN_UI_BLOCK_CANARY) {
            sContext = this;
            BlockCanary.install(this, new DemoBlockCanaryContext()).start();
        }
        if (Constants.IS_OPEN_LEAK_CANARY) {
            refWatcher = initLeakCanary();
        }

        if (Constants.IS_OPEN_STETHO) {
            // 查看 dumpapp 信息
//            Stetho.initialize(Stetho.newInitializerBuilder(this).enableDumpapp(new DumperPluginsProvider() {
//                @Override
//                public Iterable<DumperPlugin> get() {
//                    return new Stetho.DefaultDumperPluginsBuilder(DemoApplication.this).provide(new HelloWorldDumperPlugin()).provide(new APODDumperPlugin(DemoApplication.this.getContentResolver())).finish();
//                }
//            }).enableWebKitInspector(new ExtInspectorModulesProvider(DemoApplication.this)).build());
            // 调用 JS
            Stetho.initialize(Stetho.newInitializerBuilder(DemoApplication.this).enableWebKitInspector(new InspectorModulesProvider() {
                @Override
                public Iterable<ChromeDevtoolsDomain> get() {
                    return new Stetho.DefaultInspectorModulesBuilder(DemoApplication.this).runtimeRepl(new JsRuntimeReplFactoryBuilder(DemoApplication.this)
                            // Pass to JavaScript: var foo = "bar";
                            .addVariable("foo", "bar").build()).finish();
                }
            }).build());
        }

    }
项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
@SuppressWarnings("unused")
@Deprecated
public static RealmInspectorModulesProvider wrap(Context context, InspectorModulesProvider provider) {
    //noinspection deprecation
    return wrap(context, provider, false);
}
项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
@Deprecated
public static RealmInspectorModulesProvider wrap(Context context, InspectorModulesProvider provider, boolean withMetaTables) {
    //noinspection deprecation
    return wrap(context, provider, withMetaTables, null);
}
项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
public ProviderBuilder baseProvider(InspectorModulesProvider provider) {
    baseProvider = provider;
    return this;
}