├── .gitignore ├── .idea └── codeStyles │ └── Project.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── wavetechstudio │ │ └── sms │ │ └── retriever │ │ └── apimaster │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── wavetechstudio │ │ │ └── sms │ │ │ └── retriever │ │ │ └── apimaster │ │ │ ├── AppSignatureHashHelper.java │ │ │ ├── MainActivity.java │ │ │ └── SMSReceiver.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── wavetechstudio │ └── sms │ └── retriever │ └── apimaster │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradlew ├── gradlew.bat ├── screens ├── app_view.png ├── googles_warning.png └── sms_retriever_api.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | /.idea/ 13 | /gradle/ 14 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | xmlns:android 11 | 12 | ^$ 13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | 21 | xmlns:.* 22 | 23 | ^$ 24 | 25 | 26 | BY_NAME 27 | 28 |
29 |
30 | 31 | 32 | 33 | .*:id 34 | 35 | http://schemas.android.com/apk/res/android 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | 44 | .*:name 45 | 46 | http://schemas.android.com/apk/res/android 47 | 48 | 49 | 50 |
51 |
52 | 53 | 54 | 55 | name 56 | 57 | ^$ 58 | 59 | 60 | 61 |
62 |
63 | 64 | 65 | 66 | style 67 | 68 | ^$ 69 | 70 | 71 | 72 |
73 |
74 | 75 | 76 | 77 | .* 78 | 79 | ^$ 80 | 81 | 82 | BY_NAME 83 | 84 |
85 |
86 | 87 | 88 | 89 | .* 90 | 91 | http://schemas.android.com/apk/res/android 92 | 93 | 94 | ANDROID_ATTRIBUTE_ORDER 95 | 96 |
97 |
98 | 99 | 100 | 101 | .* 102 | 103 | .* 104 | 105 | 106 | BY_NAME 107 | 108 |
109 |
110 |
111 |
112 |
113 |
-------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automatic SMS Verification with the SMS Retriever API 2 | This sample code is in JAVA, As per Google's new policy with the SMS Retriever API, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions. 3 | 4 | ## Warning as per the new policy 5 | - Google restricts which Android apps can request Call Log and SMS permissions 6 | - Only apps selected as the device's default app for making calls or sending text messages will be able to access call logs and SMS data from now on. 7 | 8 | ## Alert - this app will be impacted by a policy change. This app will be impacted by a change in the Google Play policy governing the use of SMS and CALL_LOG permissions. Apps that are not compliant may be removed from Google Play on Jan 9th, 2019. 9 | 10 | 11 | 12 | 13 | ## Solution 14 | 15 | 16 | 17 | ## Info 18 | 19 | 20 | 21 | ## Work flow 22 | 23 | - Enter or pick mobile number from smart lock hint selector and initiate SMS verification call to your server. 24 | - App request your server to verify the entered mobile number. 25 | - Your app calls the SMS Retriever API at the same time and listening for an SMS from your server. 26 | - Your server sends an SMS message that includes a verification code and a hash to identify your app. 27 | - When user's device receives the SMS message, SMS Retriever API reads the SMS in your app. 28 | - App extract verification code from SMS and sends to your server for code verification. 29 | - Your server receives the verification code and after validating it can return success response to proceed. 30 | 31 | ## Prerequisites 32 | The SMS Retriever API is available only on Android devices with Play services version 10.2 and newer. 33 | 34 | ## Important 35 | The standard SMS format is given blow. 36 | 37 | <#> Your ExampleApp code is: 123ABC78 38 | FA+9qCX9VSu 39 | 40 | SMS alwayse starts with <#> sign and have a hash key FA+9qCX9VSu to identify your app it is generated with your app's package id. You just need to get this has key from app and share with your server. 41 | In next few steps you will see how to create hash keys. 42 | 43 | ### Dependencies used 44 | // Add at app level gradle file 45 | implementation 'androidx.appcompat:appcompat:1.1.0' 46 | implementation 'com.google.android.gms:play-services-base:17.1.0' 47 | implementation 'com.google.android.gms:play-services-identity:17.0.0' 48 | implementation 'com.google.android.gms:play-services-auth:17.0.0' 49 | implementation 'com.google.android.gms:play-services-auth-api-phone:17.1.0' 50 | 51 | // Note: If you have migrated your code to AndroidX than add this for LocalBroadCastManager 52 | implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' 53 | 54 | 55 | // Add at project level gradle file 56 | classpath 'com.google.gms:google-services:4.2.0' 57 | 58 | 59 | 60 | ## Integration steps 61 | 1. AppSignatureHashHelper class is responsible to get Hash key associated with your app as per your packege id. This is only one time required to get your app's hash key it would always be same unless you are changing app's package id. 62 | 63 | // Inside Main Activity 64 | Log.d(TAG, "HashKey: " + appSignatureHashHelper.getAppSignatures().get(0)); 65 | // Inside log cat Apps Hash Key: qzwS5M4KQ5H 66 | 67 | 68 | 2. Declare this SMSReceiver in your app's manifest file in side application tag. 69 | 70 | 73 | 74 | 75 | 76 | 77 | 3. Create SMSReceiver class that will listen SMS and extract code and create OTPReceiveListener that will communicate with Activities/Fragments. 78 | 79 | public interface OTPReceiveListener { 80 | void onOTPReceived(String otp); 81 | void onOTPTimeOut(); 82 | void onOTPReceivedError(String error); 83 | } 84 | } 85 | 4. Create SMSReceiver listener and Initiate SmsRetrieverClient. 86 | 87 | private void startSMSListener() { 88 | try { 89 | smsReceiver = new SMSReceiver(); 90 | smsReceiver.setOTPListener(this); 91 | 92 | IntentFilter intentFilter = new IntentFilter(); 93 | intentFilter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION); 94 | this.registerReceiver(smsReceiver, intentFilter); 95 | 96 | SmsRetrieverClient client = SmsRetriever.getClient(this); 97 | Task task = client.startSmsRetriever(); 98 | task.addOnSuccessListener(new OnSuccessListener() { 99 | @Override 100 | public void onSuccess(Void aVoid) { 101 | // API successfully started 102 | } 103 | }); 104 | task.addOnFailureListener(new OnFailureListener() { 105 | @Override 106 | public void onFailure(@NonNull Exception e) { 107 | // Fail to start API 108 | } 109 | }); 110 | } catch (Exception e) { 111 | e.printStackTrace(); 112 | } 113 | } 114 | 5. You will receive OTP in call back methods implemented in you Activity/Fragment. 115 | 116 | @Override 117 | public void onOTPReceived(String otp) { 118 | } 119 | 120 | @Override 121 | public void onOTPTimeOut() { 122 | } 123 | 124 | @Override 125 | public void onOTPReceivedError(String error) { 126 | } 127 | 128 | ## Obtain User's Phone Number From Smart lock hint slector 129 | // Construct a request for phone numbers and show the picker 130 | private void requestHint() { 131 | HintRequest hintRequest = new HintRequest.Builder() 132 | .setPhoneNumberIdentifierSupported(true) 133 | .build(); 134 | 135 | PendingIntent intent = Auth.CredentialsApi.getHintPickerIntent( 136 | apiClient, hintRequest); 137 | startIntentSenderForResult(intent.getIntentSender(), 138 | RESOLVE_HINT, null, 0, 0, 0); 139 | } 140 | 141 | // Obtain the phone number from the result 142 | @Override 143 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 144 | super.onActivityResult(requestCode, resultCode, data); 145 | if (requestCode == RESOLVE_HINT) { 146 | if (resultCode == RESULT_OK) { 147 | Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY); 148 | // credential.getId(); <-- will need to process phone number string 149 | } 150 | } 151 | } 152 | 153 | ## How to run a sample 154 | Clone or download the project open it with Android Studio compile and run it will work. 155 | 156 | 157 | ### Server Side Implementation / SMS Guide 158 | [Google's official doc](https://developers.google.com/identity/sms-retriever/verify) 159 | 160 | ## Author 161 | [Waheed Nazir](https://www.linkedin.com/in/waheed-nazir-36521579/ "Waheed Nazir (WaveTechStudio)") 162 | 163 | 164 | ## Credits 165 | [Google's official doc](https://developers.google.com/identity/sms-retriever/overview) , 166 | [Chintan Desai's (Repo/Kotlin)](https://github.com/chintandesai49/SMSRetrieverAPIDemo) 167 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "wavetechstudio.sms.retriever.apimaster" 7 | minSdkVersion 16 8 | versionCode 1 9 | versionName "1.0" 10 | } 11 | buildTypes { 12 | release { 13 | minifyEnabled false 14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 15 | } 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation 'androidx.appcompat:appcompat:1.1.0' 22 | implementation 'com.google.android.gms:play-services-base:17.1.0' 23 | implementation 'com.google.android.gms:play-services-identity:17.0.0' 24 | implementation 'com.google.android.gms:play-services-auth:17.0.0' 25 | implementation 'com.google.android.gms:play-services-auth-api-phone:17.1.0' 26 | implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' 27 | } 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/wavetechstudio/sms/retriever/apimaster/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package wavetechstudio.sms.retriever.apimaster; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("wavetechstudio.sms.retriever.apimaster", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/wavetechstudio/sms/retriever/apimaster/AppSignatureHashHelper.java: -------------------------------------------------------------------------------- 1 | package wavetechstudio.sms.retriever.apimaster; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.content.ContextWrapper; 6 | import android.content.pm.PackageManager; 7 | import android.content.pm.Signature; 8 | import android.util.Base64; 9 | import android.util.Log; 10 | 11 | import java.nio.charset.StandardCharsets; 12 | import java.security.MessageDigest; 13 | import java.security.NoSuchAlgorithmException; 14 | import java.util.ArrayList; 15 | import java.util.Arrays; 16 | 17 | public class AppSignatureHashHelper extends ContextWrapper { 18 | public static final String TAG = AppSignatureHashHelper.class.getSimpleName(); 19 | 20 | private static final String HASH_TYPE = "SHA-256"; 21 | public static final int NUM_HASHED_BYTES = 9; 22 | public static final int NUM_BASE64_CHAR = 11; 23 | 24 | public AppSignatureHashHelper(Context context) { 25 | super(context); 26 | } 27 | 28 | /** 29 | * Get all the app signatures for the current package 30 | * 31 | * @return 32 | */ 33 | public ArrayList getAppSignatures() { 34 | ArrayList appSignaturesHashs = new ArrayList<>(); 35 | 36 | try { 37 | // Get all package details 38 | String packageName = getPackageName(); 39 | PackageManager packageManager = getPackageManager(); 40 | Signature[] signatures = packageManager.getPackageInfo(packageName, 41 | PackageManager.GET_SIGNATURES).signatures; 42 | 43 | for (Signature signature : signatures) { 44 | String hash = hash(packageName, signature.toCharsString()); 45 | if (hash != null) { 46 | appSignaturesHashs.add(String.format("%s", hash)); 47 | } 48 | } 49 | } catch (Exception e) { 50 | Log.e(TAG, "Package not found", e); 51 | } 52 | return appSignaturesHashs; 53 | } 54 | 55 | @TargetApi(19) 56 | private static String hash(String packageName, String signature) { 57 | String appInfo = packageName + " " + signature; 58 | try { 59 | MessageDigest messageDigest = MessageDigest.getInstance(HASH_TYPE); 60 | messageDigest.update(appInfo.getBytes(StandardCharsets.UTF_8)); 61 | byte[] hashSignature = messageDigest.digest(); 62 | 63 | // truncated into NUM_HASHED_BYTES 64 | hashSignature = Arrays.copyOfRange(hashSignature, 0, NUM_HASHED_BYTES); 65 | // encode into Base64 66 | String base64Hash = Base64.encodeToString(hashSignature, Base64.NO_PADDING | Base64.NO_WRAP); 67 | base64Hash = base64Hash.substring(0, NUM_BASE64_CHAR); 68 | 69 | return base64Hash; 70 | } catch (NoSuchAlgorithmException e) { 71 | Log.e(TAG, "No Such Algorithm Exception", e); 72 | } 73 | return null; 74 | } 75 | } -------------------------------------------------------------------------------- /app/src/main/java/wavetechstudio/sms/retriever/apimaster/MainActivity.java: -------------------------------------------------------------------------------- 1 | package wavetechstudio.sms.retriever.apimaster; 2 | 3 | import android.content.IntentFilter; 4 | import android.os.Bundle; 5 | import android.util.Log; 6 | import android.widget.Toast; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.appcompat.app.AppCompatActivity; 10 | import androidx.localbroadcastmanager.content.LocalBroadcastManager; 11 | 12 | import com.google.android.gms.auth.api.phone.SmsRetriever; 13 | import com.google.android.gms.auth.api.phone.SmsRetrieverClient; 14 | import com.google.android.gms.tasks.OnFailureListener; 15 | import com.google.android.gms.tasks.OnSuccessListener; 16 | import com.google.android.gms.tasks.Task; 17 | 18 | public class MainActivity extends AppCompatActivity implements 19 | SMSReceiver.OTPReceiveListener { 20 | 21 | public static final String TAG = MainActivity.class.getSimpleName(); 22 | 23 | private SMSReceiver smsReceiver; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_main); 29 | 30 | AppSignatureHashHelper appSignatureHashHelper = new AppSignatureHashHelper(this); 31 | 32 | // This code requires one time to get Hash keys do comment and share key 33 | Log.i(TAG, "HashKey: " + appSignatureHashHelper.getAppSignatures().get(0)); 34 | 35 | startSMSListener(); 36 | } 37 | 38 | 39 | /** 40 | * Starts SmsRetriever, which waits for ONE matching SMS message until timeout 41 | * (5 minutes). The matching SMS message will be sent via a Broadcast Intent with 42 | * action SmsRetriever#SMS_RETRIEVED_ACTION. 43 | */ 44 | private void startSMSListener() { 45 | try { 46 | smsReceiver = new SMSReceiver(); 47 | smsReceiver.setOTPListener(this); 48 | 49 | IntentFilter intentFilter = new IntentFilter(); 50 | intentFilter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION); 51 | this.registerReceiver(smsReceiver, intentFilter); 52 | 53 | SmsRetrieverClient client = SmsRetriever.getClient(this); 54 | 55 | Task task = client.startSmsRetriever(); 56 | task.addOnSuccessListener(new OnSuccessListener() { 57 | @Override 58 | public void onSuccess(Void aVoid) { 59 | // API successfully started 60 | } 61 | }); 62 | 63 | task.addOnFailureListener(new OnFailureListener() { 64 | @Override 65 | public void onFailure(@NonNull Exception e) { 66 | // Fail to start API 67 | } 68 | }); 69 | } catch (Exception e) { 70 | e.printStackTrace(); 71 | } 72 | } 73 | 74 | 75 | @Override 76 | public void onOTPReceived(String otp) { 77 | showToast("OTP Received: " + otp); 78 | 79 | if (smsReceiver != null) { 80 | unregisterReceiver(smsReceiver); 81 | smsReceiver = null; 82 | } 83 | } 84 | 85 | @Override 86 | public void onOTPTimeOut() { 87 | showToast("OTP Time out"); 88 | } 89 | 90 | @Override 91 | public void onOTPReceivedError(String error) { 92 | showToast(error); 93 | } 94 | 95 | 96 | @Override 97 | protected void onDestroy() { 98 | super.onDestroy(); 99 | if (smsReceiver != null) { 100 | unregisterReceiver(smsReceiver); 101 | } 102 | } 103 | 104 | 105 | private void showToast(String msg) { 106 | Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/wavetechstudio/sms/retriever/apimaster/SMSReceiver.java: -------------------------------------------------------------------------------- 1 | package wavetechstudio.sms.retriever.apimaster; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import com.google.android.gms.auth.api.phone.SmsRetriever; 9 | import com.google.android.gms.common.api.CommonStatusCodes; 10 | import com.google.android.gms.common.api.Status; 11 | 12 | public class SMSReceiver extends BroadcastReceiver { 13 | 14 | private OTPReceiveListener otpListener; 15 | 16 | /** 17 | * @param otpListener 18 | */ 19 | public void setOTPListener(OTPReceiveListener otpListener) { 20 | this.otpListener = otpListener; 21 | } 22 | 23 | 24 | /** 25 | * @param context 26 | * @param intent 27 | */ 28 | @Override 29 | public void onReceive(Context context, Intent intent) { 30 | if (SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) { 31 | Bundle extras = intent.getExtras(); 32 | Status status = (Status) extras.get(SmsRetriever.EXTRA_STATUS); 33 | switch (status.getStatusCode()) { 34 | case CommonStatusCodes.SUCCESS: 35 | 36 | //This is the full message 37 | String message = (String) extras.get(SmsRetriever.EXTRA_SMS_MESSAGE); 38 | 39 | /*<#> Your ExampleApp code is: 123ABC78 40 | FA+9qCX9VSu*/ 41 | 42 | //Extract the OTP code and send to the listener 43 | 44 | if (otpListener != null) { 45 | otpListener.onOTPReceived(message); 46 | } 47 | break; 48 | case CommonStatusCodes.TIMEOUT: 49 | // Waiting for SMS timed out (5 minutes) 50 | if (otpListener != null) { 51 | otpListener.onOTPTimeOut(); 52 | } 53 | break; 54 | 55 | case CommonStatusCodes.API_NOT_CONNECTED: 56 | 57 | if (otpListener != null) { 58 | otpListener.onOTPReceivedError("API NOT CONNECTED"); 59 | } 60 | 61 | break; 62 | 63 | case CommonStatusCodes.NETWORK_ERROR: 64 | 65 | if (otpListener != null) { 66 | otpListener.onOTPReceivedError("NETWORK ERROR"); 67 | } 68 | 69 | break; 70 | 71 | case CommonStatusCodes.ERROR: 72 | 73 | if (otpListener != null) { 74 | otpListener.onOTPReceivedError("SOME THING WENT WRONG"); 75 | } 76 | 77 | break; 78 | 79 | } 80 | } 81 | } 82 | 83 | /** 84 | * 85 | */ 86 | public interface OTPReceiveListener { 87 | 88 | void onOTPReceived(String otp); 89 | 90 | void onOTPTimeOut(); 91 | 92 | void onOTPReceivedError(String error); 93 | } 94 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SMSRetrieverAPIMaster 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/wavetechstudio/sms/retriever/apimaster/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package wavetechstudio.sms.retriever.apimaster; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.5.0' 11 | classpath 'com.google.gms:google-services:4.2.0' 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | android.enableJetifier=true 10 | android.useAndroidX=true 11 | org.gradle.jvmargs=-Xmx1536m 12 | # When configured, Gradle will run in incubating parallel mode. 13 | # This option should only be used with decoupled projects. More details, visit 14 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 15 | # org.gradle.parallel=true 16 | 17 | 18 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /screens/app_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/screens/app_view.png -------------------------------------------------------------------------------- /screens/googles_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/screens/googles_warning.png -------------------------------------------------------------------------------- /screens/sms_retriever_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WaveTechStudio/SMSRetrieverAPIMaster/1fbdc75dd2129a49d751c49c8fb5886c635c4984/screens/sms_retriever_api.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------