code: public static boolean isDebuggable() {
          boolean debuggable = false;
          Context ctx = QuickUtils.getContext();
  
          try {
              PackageInfo pinfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), PackageManager.GET_SIGNATURES);
              Signature signatures[] = pinfo.signatures;
  
              CertificateFactory cf = CertificateFactory.getInstance("X.509");
  
              for (int i = 0; i < signatures.length; i++) {
                  ByteArrayInputStream stream = new ByteArrayInputStream(signatures[i].toByteArray());
                  X509Certificate cert = (X509Certificate) cf.generateCertificate(stream);
                  debuggable = cert.getSubjectX500Principal().equals(DEBUG_DN);
                  if (debuggable)
                      break;
              }
          } catch (NameNotFoundException | CertificateException ignored) {
          }
          return debuggable;
      }
docs: Is this APK signed or is it a Debug build?
  
  @return true if it is not signed