Skip to content

Instantly share code, notes, and snippets.

View pratheepchowdhary's full-sized avatar

Pratheep Kanati pratheepchowdhary

View GitHub Profile
dependencies {
implementation 'in.androidhunt.otp:AutoDetectOTPAndroid:1.0.0'
}
keytool -exportcert -alias YOUR_KEYSTORE_ALIAS -keystore YOUR_KEYSTORE_FILE | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
<#>Your AndroidHunt OTP is: 8686. ynfd/rIwy/+
// used For Auto OTP Detection
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'
//Used For Phone Number Hint Promt
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
// Used For OTP View In OtpActivity
implementation 'com.github.aabhasr1:OtpView:1.0.5'
//Used For Phone No Country Code Picker
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "in.androidhunt.otpdemo"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.androidhunt.otpdemo">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
package in.androidhunt.otp;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Build;
import android.util.Base64;
import android.util.Log;
package in.androidhunt.otp;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentSender;
import android.os.Bundle;
import android.support.annotation.NonNull;
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
tools:context=".MainActivity">
<TextView
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".OtpActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"