kandi background
Explore Kits

DeepLinkDispatch | annotationbased library for making deep link handling better | Build Tool library

 by   airbnb Java Version: 6.1.0 License: No License

 by   airbnb Java Version: 6.1.0 License: No License

Download this library from

kandi X-RAY | DeepLinkDispatch Summary

DeepLinkDispatch is a Java library typically used in Utilities, Build Tool applications. DeepLinkDispatch has no bugs, it has no vulnerabilities, it has build file available and it has medium support. You can download it from GitHub.
DeepLinkDispatch provides a declarative, annotation-based API to define application deep links. You can register an Activity to handle specific deep links by annotating it with @DeepLink and a URI. DeepLinkDispatch will parse the URI and dispatch the deep link to the appropriate Activity, along with any parameters specified in the URI.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • DeepLinkDispatch has a medium active ecosystem.
  • It has 4142 star(s) with 403 fork(s). There are 125 watchers for this library.
  • There were 1 major release(s) in the last 6 months.
  • There are 48 open issues and 121 have been closed. On average issues are closed in 115 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of DeepLinkDispatch is 6.1.0
DeepLinkDispatch Support
Best in #Build Tool
Average in #Build Tool
DeepLinkDispatch Support
Best in #Build Tool
Average in #Build Tool

quality kandi Quality

  • DeepLinkDispatch has 0 bugs and 0 code smells.
DeepLinkDispatch Quality
Best in #Build Tool
Average in #Build Tool
DeepLinkDispatch Quality
Best in #Build Tool
Average in #Build Tool

securitySecurity

  • DeepLinkDispatch has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • DeepLinkDispatch code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
DeepLinkDispatch Security
Best in #Build Tool
Average in #Build Tool
DeepLinkDispatch Security
Best in #Build Tool
Average in #Build Tool

license License

  • DeepLinkDispatch does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
DeepLinkDispatch License
Best in #Build Tool
Average in #Build Tool
DeepLinkDispatch License
Best in #Build Tool
Average in #Build Tool

buildReuse

  • DeepLinkDispatch releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • DeepLinkDispatch saves you 6334 person hours of effort in developing the same functionality from scratch.
  • It has 18900 lines of code, 2535 functions and 105 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
DeepLinkDispatch Reuse
Best in #Build Tool
Average in #Build Tool
DeepLinkDispatch Reuse
Best in #Build Tool
Average in #Build Tool
Top functions reviewed by kandi - BETA

kandi has reviewed DeepLinkDispatch and discovered the below as its top functions. This is intended to give you an instant insight into DeepLinkDispatch implemented functionality, and help decide if they suit your requirements.

  • Creates a new DeepLinkResult from the given Intent .
  • Compares the value of a component parameter .
  • Matches the given urls with the given elements .
  • Override this method to set the default value of the Activity .
  • Finds an entry in the registry .
  • Canonicalizes a string .
  • Converts a query string to a list of names and values .
  • Gets a new TaskStackBuilder with the parent action .
  • Handler for receiving deep link events .
  • Override this method to show a deep link .

DeepLinkDispatch Key Features

A simple, annotation-based library for making deep link handling better on Android

Example

copy iconCopydownload iconDownload
@DeepLink("example://example.com/deepLink/{id}")
public class SampleActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    if (intent.getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) {
      Bundle parameters = intent.getExtras();
      String idString = parameters.getString("id");
      // Do something with idString
    }
  }
}

Multiple Deep Links

copy iconCopydownload iconDownload
@DeepLink({"foo://example.com/deepLink/{id}", "foo://example.com/anotherDeepLink"})
public class MainActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    if (intent.getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) {
      Bundle parameters = intent.getExtras();
      String idString = parameters.getString("id");
      // Do something with idString
    }
  }
}

DeepLinkHandler Annotations

copy iconCopydownload iconDownload
@DeepLink("foo://example.com/handlerDeepLink/{param1}?query1={queryParameter}")
object ProjectDeepLinkHandler : DeepLinkHandler<ProjectDeepLinkHandlerArgs>() {
    override fun handleDeepLink(parameters: ProjectDeepLinkHandlerArgs) {
        /**
         * From here any internal/3rd party navigation framework can be called the provided args.
         */
    }
}

data class ProjectDeepLinkHandlerArgs(
    @DeeplinkParam("param1", DeepLinkParamType.Path) val number: Int,
    @DeeplinkParam("query1", DeepLinkParamType.Query) val flag: Boolean?,
)

Method Annotations

copy iconCopydownload iconDownload
@DeepLink("foo://example.com/methodDeepLink/{param1}")
public static Intent intentForDeepLinkMethod(Context context) {
  return new Intent(context, MainActivity.class)
      .setAction(ACTION_DEEP_LINK_METHOD);
}

Query Parameters

copy iconCopydownload iconDownload
@DeepLink("foo://example.com/deepLink")
public class MainActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    if (intent.getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) {
      Bundle parameters = intent.getExtras();
      if (parameters != null && parameters.getString("qp") != null) {
        String queryParameter = parameters.getString("qp");
        // Do something with the query parameter...
      }
    }
  }
}

Configurable path segment placeholders

copy iconCopydownload iconDownload
@DeepLink("foo://cereal.com/<type_of_cereal>/nutritional_info")
public static Intent intentForNutritionalDeepLinkMethod(Context context) {
  return new Intent(context, MainActivity.class)
      .setAction(ACTION_DEEP_LINK_METHOD);
}

Callbacks

copy iconCopydownload iconDownload
public class DeepLinkReceiver extends BroadcastReceiver {
  private static final String TAG = "DeepLinkReceiver";

  @Override public void onReceive(Context context, Intent intent) {
    String deepLinkUri = intent.getStringExtra(DeepLinkHandler.EXTRA_URI);
    if (intent.getBooleanExtra(DeepLinkHandler.EXTRA_SUCCESSFUL, false)) {
      Log.i(TAG, "Success deep linking: " + deepLinkUri);
    } else {
      String errorMessage = intent.getStringExtra(DeepLinkHandler.EXTRA_ERROR_MESSAGE);
      Log.e(TAG, "Error deep linking: " + deepLinkUri + " with error message +" + errorMessage);
    }
  }
}

public class YourApplication extends Application {
  @Override public void onCreate() {
    super.onCreate();
    IntentFilter intentFilter = new IntentFilter(DeepLinkHandler.ACTION);
    LocalBroadcastManager.getInstance(this).registerReceiver(new DeepLinkReceiver(), intentFilter);
  }
}

Custom Annotations

copy iconCopydownload iconDownload
// Prefix all app deep link URIs with "app://airbnb"
@DeepLinkSpec(prefix = { "app://airbnb" })
// When using tools like Dexguard we require these annotations to still be inside the .dex files
// produced by D8 but because of this bug https://issuetracker.google.com/issues/168524920 they
// are not so we need to mark them as RetentionPolicy.RUNTIME.
@Retention(RetentionPolicy.RUNTIME)
public @interface AppDeepLink {
  String[] value();
}

Usage

copy iconCopydownload iconDownload
dependencies {
  implementation 'com.airbnb:deeplinkdispatch:x.x.x'
}

KSP

copy iconCopydownload iconDownload
buildscript {

    apply from: rootProject.file("dependencies.gradle")

    repositories {
        google()
        gradlePluginPortal()
    }
    dependencies {
        classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:<ksp-version>"
    }
}

Kapt

copy iconCopydownload iconDownload
plugins {
  id("kotlin-kapt")
}

Java annotation processor

copy iconCopydownload iconDownload
dependencies {
  implementation 'com.airbnb:deeplinkdispatch:x.x.x'
  annotationProcessor 'com.airbnb:deeplinkdispatch-processor:x.x.x'
}

Incremental annotation processing

copy iconCopydownload iconDownload
javaCompileOptions {
  annotationProcessorOptions {
    arguments = [
      'deepLink.incremental': 'true',
      'deepLink.customAnnotations': 'com.airbnb.AppDeepLink|com.airbnb.WebDeepLink'
    ]
  }
}

Performance

copy iconCopydownload iconDownload
Started running tests

benchmark:        11,716 ns DeeplinkBenchmarks.match1
benchmark:       139,375 ns DeeplinkBenchmarks.match500
benchmark:     2,163,907 ns DeeplinkBenchmarks.newRegistry
benchmark:        23,035 ns DeeplinkBenchmarks.match1000
benchmark:       152,969 ns DeeplinkBenchmarks.match1500
benchmark:       278,906 ns DeeplinkBenchmarks.match2000
benchmark:       162,604 ns DeeplinkBenchmarks.createResultDeeplink1
benchmark:        11,774 ns DeeplinkBenchmarks.parseDeeplinkUrl
Tests ran to completion.

Generated deep links Documentation

copy iconCopydownload iconDownload
tasks.withType(JavaCompile) {
  options.compilerArgs << "-AdeepLinkDoc.output=${buildDir}/doc/deeplinks.txt"
}

Proguard/R8 Rules

copy iconCopydownload iconDownload
-keep @interface your.package.path.deeplink.<annotation class name>
-keepclasseswithmembers class * {
    @your.package.path.deeplink.<annotation class name> <methods>;
}

License

copy iconCopydownload iconDownload
Copyright 2015-2020 Airbnb, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

API is not working when ProGuard is activated in my Android app

copy iconCopydownload iconDownload
-ignorewarnings
-keep class * {
    public private *;
}

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

-dontwarn org.xmlpull.v1.**
-dontnote org.xmlpull.v1.**
-keep class org.xmlpull.** { *; }

#retRofit
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}
# Orm
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }

# Fresco

-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.common.internal.DoNotStrip *;
}
-keepclassmembers class * {
    native <methods>;
}
-dontwarn okio.**
-dontwarn com.squareup.okhttp.**
-dontwarn okhttp3.**
-dontwarn javax.annotation.**
-dontwarn com.android.volley.toolbox.**

# com.github.siyamed:android-shape-imageview
-dontwarn android.support.v7.**
-keepattributes *Annotation,Signature
-dontwarn com.github.siyamed.**
-keep class com.github.siyamed.shapeimageview.**{ *; }
-dontwarn org.xmlpull.v1.**
-dontwarn uk.co.senab.photoview.**

#Image Cropper
-keep class androidx.appcompat.widget.** { *; }



# Keep source file names, line numbers, and Parse class/method names for easier debugging
 -keepattributes SourceFile,LineNumberTable
 -keepnames class com.parse.** { *; }


 # Required for Parse
 -keepattributes *Annotation*
 -keepattributes Signature
 -dontwarn com.squareup.**
 -dontwarn okio.**


-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-dontwarn com.parse.**
-dontwarn com.squareup.picasso.**
-keepclasseswithmembernames class * {
    native <methods>;
}
```

Community Discussions

Trending Discussions on DeepLinkDispatch
  • API is not working when ProGuard is activated in my Android app
Trending Discussions on DeepLinkDispatch

QUESTION

API is not working when ProGuard is activated in my Android app

Asked 2020-Dec-11 at 09:18

After enabling minifyEnabled=true API is not sending data to server. When I checked in the server, I am getting all the inputs are null. However, if I add -dontobfuscate in "proguard-rules.pro" file then the app is working fine. I am using retrofit2. I tried almost all the ProGuard rules regarding the retrofit2. Nothing worked!.

My build.gradle file:

def lifecycleExtensionVersion = '2.2.0'
def butterknifeVersion = '10.1.0'
def supportVersion = '29.0.0'
def retrofitVersion = '2.3.0'
def glideVersion = '4.9.0'
def rxJavaVersion = '2.1.1'
def daggerVersion = '2.14.1'
def mockitoVersion = '2.11.0'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
    implementation 'com.google.firebase:firebase-messaging:20.2.4'
    implementation 'com.google.firebase:firebase-analytics:17.5.0'
    implementation 'com.google.firebase:firebase-auth:19.3.0'

    implementation "com.android.support:design:$supportVersion"
    implementation "android.arch.lifecycle:extensions:$lifecycleExtensionVersion"

    implementation "com.jakewharton:butterknife:$butterknifeVersion"
    implementation 'androidx.work:work-runtime:2.2.0'
    annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"

    implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
    implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
    implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"

    implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
    implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"

    implementation "com.github.bumptech.glide:glide:$glideVersion"

    implementation "com.google.dagger:dagger:$daggerVersion"
    implementation "com.google.dagger:dagger-android-support:$daggerVersion"
    implementation "androidx.legacy:legacy-support-v4:1.0.0"
    annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
    annotationProcessor "com.google.dagger:dagger-android-processor:$daggerVersion"

    implementation 'com.airbnb:deeplinkdispatch:4.1.0'
    annotationProcessor 'com.airbnb:deeplinkdispatch-processor:4.1.0'

    testImplementation "org.mockito:mockito-inline:$mockitoVersion"
    testImplementation "android.arch.core:core-testing:1.1.1"

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

}

Also, when minifyEnabled=true, the following "getLoginResult" function is not reaching when I debug. But when I add -dontobfuscate then it reaches.

LoginViewModel.Java

import android.util.Log;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import io.reactivex.disposables.CompositeDisposable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;


public class LoginViewModel extends ViewModel {

    public MutableLiveData<LoginUser> loginUser = new MutableLiveData<>();
    public MutableLiveData<Boolean> loginUserLoadError = new MutableLiveData<>();
    public MutableLiveData<Boolean> loading = new MutableLiveData<>();

    private CompositeDisposable disposable = new CompositeDisposable();

    public LiveData<ResponseBody> getLoginResult(String getEmail, String getPassword, String device_ip){
        loading.setValue(true);

        final MutableLiveData<ResponseBody> outputReponse = new MutableLiveData<>();

        LoginUser loginUser = new LoginUser(getEmail, getPassword, device_ip);

        Call<ResponseBody> call = LoginService
                .getInstance()
                .getLoginAPI()
                .loginUser(loginUser);

        call.enqueue(new Callback<ResponseBody>() {
            @Override
            public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                outputReponse.setValue(response.body());
            }

            @Override
            public void onFailure(Call<ResponseBody> call, Throwable t) {
                Log.d("Login Failed", t.getLocalizedMessage());
            }
        });

        return outputReponse;
    }

What I am missing or doing wrong here? How can I get it work.

ANSWER

Answered 2020-Dec-11 at 09:18

Two way you can fix this:

  1. Insert Annotation Keep for all response and request DTO Class.

  2. Fix to keep all class do you need in proguard-rules.pro file like this :

-ignorewarnings
-keep class * {
    public private *;
}

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

-dontwarn org.xmlpull.v1.**
-dontnote org.xmlpull.v1.**
-keep class org.xmlpull.** { *; }

#retRofit
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}
# Orm
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }

# Fresco

-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.common.internal.DoNotStrip *;
}
-keepclassmembers class * {
    native <methods>;
}
-dontwarn okio.**
-dontwarn com.squareup.okhttp.**
-dontwarn okhttp3.**
-dontwarn javax.annotation.**
-dontwarn com.android.volley.toolbox.**

# com.github.siyamed:android-shape-imageview
-dontwarn android.support.v7.**
-keepattributes *Annotation,Signature
-dontwarn com.github.siyamed.**
-keep class com.github.siyamed.shapeimageview.**{ *; }
-dontwarn org.xmlpull.v1.**
-dontwarn uk.co.senab.photoview.**

#Image Cropper
-keep class androidx.appcompat.widget.** { *; }



# Keep source file names, line numbers, and Parse class/method names for easier debugging
 -keepattributes SourceFile,LineNumberTable
 -keepnames class com.parse.** { *; }


 # Required for Parse
 -keepattributes *Annotation*
 -keepattributes Signature
 -dontwarn com.squareup.**
 -dontwarn okio.**


-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-dontwarn com.parse.**
-dontwarn com.squareup.picasso.**
-keepclasseswithmembernames class * {
    native <methods>;
}
```

Source https://stackoverflow.com/questions/65247657

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install DeepLinkDispatch

You can download it from GitHub.
You can use DeepLinkDispatch like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the DeepLinkDispatch component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

Sometimes you'll have an Activity that handles several kinds of deep links:.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Compare Build Tool Libraries with Highest Support
Compare Build Tool Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.