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.soloader:soloader:0.8.0'
|
||||
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:replace="android:name">
|
||||
|
||||
<meta-data android:name="com.niddler.icon" android:value="android"/>
|
||||
|
||||
<provider
|
||||
android:name="androidx.work.impl.WorkManagerInitializer"
|
||||
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.sharedpreferences.SharedPreferencesFlipperPlugin;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
import com.icapps.niddler.core.AndroidNiddler;
|
||||
import com.icapps.niddler.interceptor.okhttp.NiddlerOkHttpInterceptor;
|
||||
import com.readrops.readropslibrary.utils.HttpManager;
|
||||
|
||||
public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provider {
|
||||
|
@ -27,6 +29,7 @@ public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provi
|
|||
SoLoader.init(this, false);
|
||||
|
||||
initFlipper();
|
||||
initNiddler();
|
||||
}
|
||||
|
||||
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
|
||||
@Override
|
||||
public Configuration getWorkManagerConfiguration() {
|
||||
|
|
Loading…
Reference in New Issue