mirror of https://github.com/readrops/Readrops.git
Setup Niddler
This commit is contained in:
parent
489051b67f
commit
e39c16d635
|
@ -96,4 +96,7 @@ dependencies {
|
||||||
debugImplementation 'com.facebook.flipper:flipper:0.30.1'
|
debugImplementation 'com.facebook.flipper:flipper:0.30.1'
|
||||||
debugImplementation 'com.facebook.soloader:soloader:0.8.0'
|
debugImplementation 'com.facebook.soloader:soloader:0.8.0'
|
||||||
debugImplementation 'com.facebook.flipper:flipper-network-plugin:0.30.1'
|
debugImplementation 'com.facebook.flipper:flipper-network-plugin:0.30.1'
|
||||||
|
|
||||||
|
debugImplementation 'com.icapps.niddler:niddler:1.2.0'
|
||||||
|
releaseImplementation 'com.icapps.niddler:niddler-noop:1.2.0'
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
tools:ignore="AllowBackup,GoogleAppIndexingWarning"
|
tools:ignore="AllowBackup,GoogleAppIndexingWarning"
|
||||||
tools:replace="android:name">
|
tools:replace="android:name">
|
||||||
|
|
||||||
|
<meta-data android:name="com.niddler.icon" android:value="android"/>
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.work.impl.WorkManagerInitializer"
|
android:name="androidx.work.impl.WorkManagerInitializer"
|
||||||
android:authorities="${applicationId}.workmanager-init"
|
android:authorities="${applicationId}.workmanager-init"
|
||||||
|
|
|
@ -17,6 +17,8 @@ import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
||||||
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
||||||
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
||||||
import com.facebook.soloader.SoLoader;
|
import com.facebook.soloader.SoLoader;
|
||||||
|
import com.icapps.niddler.core.AndroidNiddler;
|
||||||
|
import com.icapps.niddler.interceptor.okhttp.NiddlerOkHttpInterceptor;
|
||||||
import com.readrops.readropslibrary.utils.HttpManager;
|
import com.readrops.readropslibrary.utils.HttpManager;
|
||||||
|
|
||||||
public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provider {
|
public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provider {
|
||||||
|
@ -27,6 +29,7 @@ public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provi
|
||||||
SoLoader.init(this, false);
|
SoLoader.init(this, false);
|
||||||
|
|
||||||
initFlipper();
|
initFlipper();
|
||||||
|
initNiddler();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initFlipper() {
|
private void initFlipper() {
|
||||||
|
@ -53,6 +56,24 @@ public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initNiddler() {
|
||||||
|
AndroidNiddler niddler = new AndroidNiddler.Builder()
|
||||||
|
.setNiddlerInformation(AndroidNiddler.fromApplication(this))
|
||||||
|
.setPort(0)
|
||||||
|
.setMaxStackTraceSize(10)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
niddler.attachToApplication(this);
|
||||||
|
|
||||||
|
HttpManager.setInstance(HttpManager.getInstance().
|
||||||
|
getOkHttpClient().
|
||||||
|
newBuilder().
|
||||||
|
addInterceptor(new NiddlerOkHttpInterceptor(niddler, "default"))
|
||||||
|
.build());
|
||||||
|
|
||||||
|
niddler.start();
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Configuration getWorkManagerConfiguration() {
|
public Configuration getWorkManagerConfiguration() {
|
||||||
|
|
Loading…
Reference in New Issue