Giter Club home page Giter Club logo

requestly-android-sdk's Introduction

Update: Requestly's Android Debugger has been sunset. This repository has been archived.

Requestly Logo

Chrome like developer tool for Android debug builds

GitHub release Maven Maven

Api Debugger

Requestly Android SDK lets you debug your android apps without needing you to setup any proxies or install any certificates everytime. It makes easy to identify & debug your Android Apps faster and save your time.

Try Now

↓ Click on Screenshots to try Apps ↓

Try Now Try Now Try Now

OR

Installation

The best way to install the Requestly Android SDK is with a build system like Gradle. This ensures you can easily upgrade to the latest versions.

RQInterceptor is distributed through Maven Central. To use it you need to add the following Gradle dependency to your build.gradle file of you android app module (NOT the root file)

dependencies {
    debugImplementation "io.requestly:requestly-android:2.4.9"
    releaseImplementation "io.requestly:requestly-android-noop:2.4.9"
    debugImplementation "io.requestly:requestly-android-okhttp:2.4.9"
    releaseImplementation "io.requestly:requestly-android-okhttp-noop:2.4.9"
}

SDK Initialization

Initialize the Requestly SDK in your Application class onCreate method.

class App : Application(){
    override fun onCreate() {
        super.onCreate()

        // Initialize Requestly SDK like this
        Requestly.Builder(this, [optional "<your-sdk-key>"])
            .build()
    }
}

sdk-key is optional. You can use local devtool features without sdk-key.
To get the sdk key, you need to create an app. Follow the steps here to create an app.

API Debugger Initialization

To configure the Interceptor, you need to initialize the RQCollector and then add rqInterceptor as the last interceptor to your okHttpClient

okHttp

val collector = RQCollector(context=appContext)

val rqInterceptor = RQInterceptor.Builder(appContext)
    .collector(collector)
    .build()

val client = OkHttpClient.Builder()
    .addInterceptor(rqInterceptor)
    .build()

Retrofit

Retrofit.Builder()
    .baseUrl(APIUtils.API_BASE_URI)
    .client(okHttpClient) // okHttpClient with RQInterceptor
    .build();

Features

API Debugger

Lets you view and modify HTTP traffic. It comes with these capabilities to:

  • InApp Inspector : Directly view your HTTP request from your phone.
  • Modify API: Modify Response, Redirect Request, Delay Request and many more.

Api Debugger

Analytics Event Debugger

Debug & Validate your Analytics Events directly from your App. The SDK provides a simple API to send your events.

RequestlyEvent.send(<eventName: String>, <eventData:Map<String, Any>>)

Events Debugger

Logs Debugger

Debug your Logs directly from your App. No need to connect your device to your computer to know what's happening inside your app.

Logs Debugger

Host Switcher

Switch between production and staging APIs easily in your Android debug builds. Eg. api.requestly.io → staging.requestly.io

Logs Debugger

Acknowledgments

Special Thanks to chuckerteam for maintaining such an awesome project Chucker because of which requestly-android-sdk was possible.

requestly-android-sdk's People

Contributors

sagarsoni7 avatar samanvay-arya avatar tushar-g avatar wrongsahil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

requestly-android-sdk's Issues

Developers should be able to securely share cURL requests from APIs Inspector Pane within app

Organizations have an internal Pastebin server primarily to exchange secrets/cURLs etc between developers. It takes a lot of effort from copying cURL from Mobile API Inspector and then sending it across somewhere and then using the PasteBin server to generate a unique link.

Idea is to simplify this entire workflow and when developers click on Copy cURL then directly provide a secure link that masks all the secret information (auth header values etc) and developers can easily share & collaborate on the cURLs.

Getting crash on API 21 and 22.

I am getting crash on API 21 and 22

i think these lines cause the crash:
Logcat.java(70)
process = Runtime.getRuntime().exec("logcat -v time");
Lynx.java(75)
Runtime.getRuntime().exec("logcat -c");
here is the stacktrace

E/Lynx: IOException executing logcat command.
    java.io.IOException: Error running exec(). Command: [logcat, -c] Working Directory: null Environment: null
        at java.lang.ProcessManager.exec(ProcessManager.java:211)
        at java.lang.Runtime.exec(Runtime.java:173)
        at java.lang.Runtime.exec(Runtime.java:246)
        at java.lang.Runtime.exec(Runtime.java:189)
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Lynx.clearStream(Lynx.java:75)
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Lynx.<init>(Lynx.java:67)
        at io.requestly.android.core.Requestly$Builder.buildLogsModule(Requestly.kt:115)
        at io.requestly.android.core.Requestly$Builder.access$buildLogsModule(Requestly.kt:48)
        at io.requestly.android.core.Requestly$Builder$build$1.invokeSuspend(Requestly.kt:87)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
     Caused by: java.io.IOException: Permission denied
        at java.lang.ProcessManager.exec(Native Method)
        at java.lang.ProcessManager.exec(ProcessManager.java:209)
        at java.lang.Runtime.exec(Runtime.java:173) 
        at java.lang.Runtime.exec(Runtime.java:246) 
        at java.lang.Runtime.exec(Runtime.java:189) 
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Lynx.clearStream(Lynx.java:75) 
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Lynx.<init>(Lynx.java:67) 
        at io.requestly.android.core.Requestly$Builder.buildLogsModule(Requestly.kt:115) 
        at io.requestly.android.core.Requestly$Builder.access$buildLogsModule(Requestly.kt:48) 
        at io.requestly.android.core.Requestly$Builder$build$1.invokeSuspend(Requestly.kt:87) 
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 
        at android.os.Handler.handleCallback(Handler.java:739) 
        at android.os.Handler.dispatchMessage(Handler.java:95) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5254) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
D/requestly-android-sdk: Finish: Building Core
W/art: Verification of androidx.core.app.NotificationCompat$Action io.requestly.android.core.internal.support.MetadataNotificationHelper.createConnectionAction(boolean) took 2.515s
D/requestly-android-sdk: appToken: bk9fvxFXM5HNwaMc6gkZ
D/LeakCanary: Setting up flushing for Thread[LeakCanary-Heap-Dump,5,main]
E/Logcat: IOException executing logcat command.
    java.io.IOException: Error running exec(). Command: [logcat, -v, time] Working Directory: null Environment: null
        at java.lang.ProcessManager.exec(ProcessManager.java:211)
        at java.lang.Runtime.exec(Runtime.java:173)
        at java.lang.Runtime.exec(Runtime.java:246)
        at java.lang.Runtime.exec(Runtime.java:189)
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Logcat.run(Logcat.java:70)
     Caused by: java.io.IOException: Permission denied
        at java.lang.ProcessManager.exec(Native Method)
        at java.lang.ProcessManager.exec(ProcessManager.java:209)
        at java.lang.Runtime.exec(Runtime.java:173) 
        at java.lang.Runtime.exec(Runtime.java:246) 
        at java.lang.Runtime.exec(Runtime.java:189) 
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Logcat.run(Logcat.java:70) 
I/Choreographer: Skipped 152 frames!  The application may be doing too much work on its main thread.
E/AndroidRuntime: FATAL EXCEPTION: Thread-238
    Process: io.requestly.android.sample, PID: 7967
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.InputStream java.lang.Process.getInputStream()' on a null object reference
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Logcat.getBufferReader(Logcat.java:105)
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Logcat.readLogcat(Logcat.java:85)
        at io.requestly.android.core.modules.logs.lib.lynx.main.model.Logcat.run(Logcat.java:74)

Update Readme to cover need for Manifest.permission.POST_NOTIFICATIONS for targetSdk = 33

If you target SDK 33 you must request Manifest.permission.POST_NOTIFICATIONS or you will not see the notification as network traffic occurs. This is not required for older SDK version. You can do this only for debug builds if you don't need notification support otherwise in your app.

Please update the configuration steps in the readme.md to give users a heads up about this new requirement.

Unable to build a release app without commenting out Requestly

If I attempt to build a release build of my app I get an error on this line about a missing key

Requestly.Builder(this).build()

Even though I have it set this way in my build.gradle

debugImplementation "io.requestly:requestly-android:$requestlyVersion"
releaseImplementation "io.requestly:requestly-android-noop:$requestlyVersion"
debugImplementation "io.requestly:requestly-android-okhttp:$requestlyVersion"
releaseImplementation "io.requestly:requestly-android-okhttp-noop:$requestlyVersion"

I had to comment out any use of Requestly API usage in the app to get a release build to work.

Persistent Metadata Notification

Right now the notification with metadata (deviceId and sdkId) can be cleared. We should make this notification permanent so that user can access the metadata anytime.

  • Permanent Notification
  • Remove Notification when app closes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.