title: Why SMS Retriever API don't work in release mode?
body: <p>I've implemented the <code>SMS Retriever API</code> like in the google tutorials and in my debug Build Variant work fine. I can read the sms and get the code to the user can do the login. </p>
  
  <p>My problem is when I run the app in release Build Variant the sms it doesn't work. I receive the sms but I can't read the code to do the login.</p>
  
  <p>I change the hash generated with <a href="https://github.com/googlesamples/android-credentials/blob/master/sms-verification/android/app/src/main/java/com/google/samples/smartlock/sms_verify/AppSignatureHelper.java" rel="noreferrer">AppSignatureHelper </a> in release mode that is differente than in the debug mode. In debug work and in release no.</p>
  
  <p>Some help will be appreciate</p>
  
  <p>The code:</p>
  
  <p><strong>Manifest:</strong></p>
  
  <pre><code>   &lt;receiver android:name=".app.receivers.SmsReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.gms.auth.api.phone.SMS_RETRIEVED"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>In my class: (In release and in debug mode the code go throw the onSucess method) This method is called in <strong>onCreate</strong>.</p>
  
  <pre><code>private void startSMSListening(){
      SmsRetrieverClient client = SmsRetriever.getClient(this);
      Task&lt;Void&gt; task = client.startSmsRetriever();
  
      task.addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
          @Override
          public void onSuccess(Void aVoid) {
              // Successfully started retriever, expect broadcast intent
              Log.e("startSMSListening", "listening sms");
              sendCode();
              showHideLoadingView(false);
          }
      });
  
      task.addOnFailureListener(new OnFailureListener() {
          @Override
          public void onFailure(@NonNull Exception e) {
              // Failed to start retriever, inspect Exception for more details
              Log.e("startSMSListening", "failure listening sms");
              showHideLoadingView(false);
          }
      });
  }
  </code></pre>
  
  <p><strong>My receiver:</strong></p>
  
  <pre><code>public class SmsReceiver extends BroadcastReceiver {
      //interface
      private static SmsListener mListener;
  
      @Override
      public void onReceive(Context context, Intent intent) {
          if (SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
              Bundle extras = intent.getExtras();
              if(extras != null) {
                  Status status = (Status) extras.get(SmsRetriever.EXTRA_STATUS);
  
                  if(status != null) {
                      switch (status.getStatusCode()) {
                          case CommonStatusCodes.SUCCESS:
                              // Get SMS message contents
                              String message = (String) extras.get(SmsRetriever.EXTRA_SMS_MESSAGE);
                              //Pass the message text to interface
                              if (mListener != null &amp;&amp; !StringUtil.isNull(message)) {
                                  mListener.messageReceived(message);
                              }
                              break;
                          case CommonStatusCodes.TIMEOUT:
                              Log.d("SMSReceiver", "timed out (5 minutes)");
                              break;
                      }
                  }
              }
          }
      }
  
      public static void bindListener(SmsListener listener) {
          mListener = listener;
      }
  }
  </code></pre>
  
  <p><strong>My smsReceiver method:</strong></p>
  
  <pre><code>private void smsReceiver(){
          SmsReceiver.bindListener(new SmsListener() {
              @Override
              public void messageReceived(String messageText) {
                  //From the received text string you may do string operations to get the required OTP
                  //It depends on your SMS format
                  Log.e("Message",messageText);
  
                  // If your OTP is six digits number, you may use the below code
                  Pattern pattern = Pattern.compile(OTP_REGEX);
                  Matcher matcher = pattern.matcher(messageText);
                  String otp = null;
  
                  while (matcher.find()) {
                      otp = matcher.group();
                  }
  
                  if(otp != null &amp;&amp; et_code != null) {
                      et_code.setText(otp);
                  }
              }
          });
      }
  </code></pre>