MCPcopy Index your code
hub / github.com/SimonMarquis/Android-UrlSchemeInterceptor

github.com/SimonMarquis/Android-UrlSchemeInterceptor @1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.0 ↗ · + Follow
45 symbols 121 edges 10 files 7 documented · 16% updated 3y ago1.0.0 · 2015-10-11★ 38
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Android-UrlScheme Interceptor

Test it

What's gonna happen?
✘ App not installed → Redirect to Play Store
✔ App installed → Start the application or the interceptor

Click here to trigger the url scheme!

Integration

In your build.gradle file:

dependencies {
    compile 'fr.smarquis.usi:usi:1.0.0'
}

In your Application class:

public class YourApplication extends Application {

    @Override public void onCreate() {
        super.onCreate();
        Usi.intercept(this);
    }

}

If you want to intercept a custom scheme, simply override the usi_scheme string resource:

<resources>
    <string name="usi_scheme">your-custom-scheme</string>
</resources>

That's it! UrlSchemeInterceptor will automatically intercept the corresponding scheme.

Manual trigger

This demo application can be launched without any modification.
Use this adb command to trigger the default url scheme with some parameters:

adb shell am start \
    -a android.intent.action.VIEW \
    -d 'usi://example.com:8042/over/there/index.html?query=something#refresh' \
    --es extra-string abc \
    --ez extra-boolean true \
    --ei extra-int 123 \
    --el extra-long 123456 \
    --ef extra-float 123.456 \
    --eu extra-uri http://www.google.com \
    --esa extra-stringArray a,b,c

Chrome Intents

The default Chrome implementation is done through intents.
Simply wrap the following intent into an <a href="https://github.com/SimonMarquis/Android-UrlSchemeInterceptor/raw/1.0.0/"> tag.

intent://example.com:8042/over/there/index.html?query=something#refresh#Intent;scheme=usi;package=fr.smarquis.usi.sample;action=android.intent.action.VIEW;S.string=abc;B.boolean=true;i.int=123;l.long=123456;f.float=123.456;end

The package=x.y.z; is mandatory to prompt the user to install the app if it is not already on the device.

Core symbols most depended-on inside this repo

Shape

Method 34
Class 11

Languages

Java100%

Modules by API surface

usi/src/main/java/fr/smarquis/usi/Printer.java9 symbols
usi/src/main/java/fr/smarquis/usi/Truss.java8 symbols
usi/src/main/java/fr/smarquis/usi/InterceptorActivity.java8 symbols
sample/src/main/java/fr/smarquis/usi/sample/MainActivity.java5 symbols
usi/src/main/java/fr/smarquis/usi/Usi.java4 symbols
sample/src/main/java/fr/smarquis/usi/sample/ResultActivity.java3 symbols
usi/src/main/java/fr/smarquis/usi/Flags.java2 symbols
usi/src/androidTest/java/fr/smarquis/usi/ApplicationTest.java2 symbols
sample/src/main/java/fr/smarquis/usi/sample/App.java2 symbols
sample/src/androidTest/java/fr/smarquis/usi/sample/ApplicationTest.java2 symbols

For agents

$ claude mcp add Android-UrlSchemeInterceptor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page