YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API.

Related tags

Testing YASNAC
Overview

YASNAC

YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API.

YASNAC is written with Jetpack Compose.

Introduction

SafetyNet is developed by Google, it provides a set of services and APIs. SafetyNet Attestation API provides a cryptographically-signed attestation, assessing the device's integrity. The app developer can use SafetyNet Attestation API to check if the device is an emulator, bootloader unlocked, system integrity compromised (root for example), etc. Read the document from Google for more.

This app uses SafetyNet Attestation API and displays the result.

In the production environment, the response of the SafetyNet Attestation API should be transfer to a remote server for verification. As a simple demonstration project, it is impractical to provide a server, so the verification step runs locally.

Build

  1. Obtain an API key by following the guide from Google
  2. Write the key to local.properties in the form of apiKey=YOUR_API_KEY
  3. Build with Android Studio or command line gradlew :app:aR

Something else

Android's Key Attestation API is used by SafetyNet to check if the device is unlocked.

Key Attestation (vvb2060/KeyAttestation) is another demonstrate app for the Key Attestation API.

Comments
  • Error - Requires Googe Play Services v13.0

    Error - Requires Googe Play Services v13.0

    Hi, YASNAC was working fine until the recent update where I get "Requires Googe Play Services v13.0" error. Just wanting to confirm whether this is a bug or this is an issue on my end.

    YASNAC itself shows Google Play Services version = 22.09.20 Which is correct and it's the latest version available for my Galaxy S10 (Play Store shows it updated on 17 March 2022).

    Device details: Model - SM-G973F (beyond1lte) Android Version - 11 (API 30) Security Patch level - 2021-12-05

    opened by Sekt0rX 6
  • ⚠️ Crashed while running checker!

    ⚠️ Crashed while running checker!

    | System Env

    • Magisk: d7776f65-alpha:MAGISK:R
    • Android R (API 30) (SP: April 2022)
    • GMS: version 22.18.20 (100300-451484765)
    • Zygisk | MagiskHide enabled/disabled
    • YASNC: version v1.1.5.r65.15110ef310 (Play Store)

    | Crashed Log

    Process: rikka.safetynetchecker, PID: 17990
    java.lang.NullPointerException
    	at java.util.Objects.requireNonNull(Objects.java:220)
    	at l5.c(:1)
    	at l5.a(:1)
    	at Q4.n(:2)
    	at Vp.a(:3)
    	at XO.run(:4)
    	at android.os.Handler.handleCallback(Handler.java:938)
    	at android.os.Handler.dispatchMessage(Handler.java:99)
    	at android.os.Looper.loop(Looper.java:223)
    	at android.app.ActivityThread.main(ActivityThread.java:7669)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
    

    | Screen Record

    opened by MrCarb0n 3
  • Releasing the app on F-Droid

    Releasing the app on F-Droid

    Hello there!

    Since this app is now also released under MIT license, it would be great to have it on F-Droid as well. There is no Safetynet-Check on F-Droid at all and having a lightweight and open-source check like this one would be amazing.

    Cheers!

    opened by Jowat97 3
  • Google Play Services API error 13: ERROR

    Google Play Services API error 13: ERROR

    Hello, I installed YASNAC from Aurora Store, there was no error during installation.

    However, when I start YASNAC I get this message: Google Play Services API error 13: ERROR Screenshot_20220525-141457_Yet Another SafetyNet Attestation Checker

    Can you please advise how to fix this issue?

    opened by cmonty14 2
  • "Something went wrong: The version of the Google Play services installed on this device is not authentic"

    I'm getting this error with the latest release of YASNAC

    With YASNAC v1.1.3, I was getting "Requires Google Play Services v13.0 and above" error, even though my Google Play services is v22

    Device: Pixel 2 XL OS: Lineage OS 18.1 based on Android 11 (XDA)

    opened by DealsBeam 2
  • Google play services API error 13:error

    Google play services API error 13:error

    Hello. Running LineageOS 18.1 with Microg and magisk preflashed. Upon running YASNAC, the second box contains "Google Play Services API error 13:ERROR".

    What might be causing this?

    opened by coMango 2
  • 点击认证后闪退

    点击认证后闪退

    机型:小米11 系统:MIUI13.0.6 点击运行SafetyNet认证后 应用闪退 闪退日志: 2022-02-02 03:09:22.140 1138-1213/? E/ANDR-PERF-OPTSHANDLER: Can't process request: noroot_thread is not running 2022-02-02 03:09:22.140 1138-1213/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [7, 3] 2022-02-02 03:09:22.149 6153-6153/? D/BoundBrokerSvc: onBind: Intent { act=com.google.android.gms.safetynet.service.START pkg=com.google.android.gms } 2022-02-02 03:09:22.149 6153-6153/? D/BoundBrokerSvc: Loading bound service for intent: Intent { act=com.google.android.gms.safetynet.service.START pkg=com.google.android.gms } 2022-02-02 03:09:22.175 1549-4193/? W/ActivityManager: Unable to start service Intent { act=com.google.android.gms.droidguard.service.START pkg=com.google.android.gms } U=0: not found 2022-02-02 03:09:22.175 1549-4193/? W/ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@e2c0933 2022-02-02 03:09:22.176 6153-7544/? W/GmsClient: unable to connect to service: com.google.android.gms.droidguard.service.START on com.google.android.gms 2022-02-02 03:09:22.335 13030-13030/? D/AndroidRuntime: Shutting down VM

    --------- beginning of crash
    

    2022-02-02 03:09:22.335 13030-13030/? E/AndroidRuntime: FATAL EXCEPTION: main Process: rikka.safetynetchecker, PID: 13030 java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:220) at F5.e(:1) at G5.c(:1) at j5.o(Unknown Source:8) at es.f(:1) at ZS.run(Unknown Source:31) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8085) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045) 2022-02-02 03:09:22.336 13030-13030/? E/MQSEventManagerDelegate: failed to get MQSService. 2022-02-02 03:09:22.336 13030-13030/? D/OOMEventManagerFK: checkEventAndDumpForJE: 0 2022-02-02 03:09:22.336 13030-13030/? E/MQSEventManagerDelegate: failed to get MQSService. 2022-02-02 03:09:22.338 1549-2652/? E/Thanox-Core: onApplicationCrashing: crash rikka.safetynetchecker ProcessRecord{packageName='rikka.safetynetchecker', processName='rikka.safetynetchecker', pid=13030, uid=10026} java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:220) at F5.e(:1) at G5.c(:1) at j5.o(Unknown Source:8) at es.f(:1) at ZS.run(Unknown Source:31) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8085) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045) 2022-02-02 03:09:22.340 1549-13177/? I/DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 2022-02-02 03:09:22.341 1549-3791/? W/ActivityTaskManager: Force finishing activity rikka.safetynetchecker/.main.MainActivity

    opened by lamprose 2
  • ADD TRANSLATION FOR VIETNAMESE

    ADD TRANSLATION FOR VIETNAMESE

    Sorry for the inconvenience, this is not an issue. Cuz idk how to open pull requests on mobile. The translation is for Vietnamese (vi-vn): https://a.tmp.ninja/gdJlkwke.xml

    opened by ThePrimalPea 0
  • Add

    Add "deprecationInformation" field support

    SafetyNet now rolled out new "deprecationInformation" field in their responses (present randomly, not in all responses), which YASNAC can't handle correctly and crashed app.

    https://groups.google.com/g/safetynet-api-clients/c/tq4IusNWJus

    opened by Displax 0
  • Add Play Integrity support

    Add Play Integrity support

    Hi @RikkaW @vvb2060,

    As seen in this Google Forum post by the SafetyNet team, Google is set to phase out SafetyNet in the next 2 years, but will instruct developers to transition to Play Integrity starting from now.

    Would you be interested in integrating a PR to support Play Integrity as part of YASNAC? I know how to implement it, but I want to know your opinion before I write it.

    We will only need to discuss on a separate channel (Telegram?) how we can setup Play Integrity on your Google Play Console app details for Play Store releases/Cloud Console project for GitHub releases.

    Please let me know if you are interested!

    opened by linuxct 1
Releases(v1.1.5)
Owner
Rikka
Rikka
MyTaxi - App consuming myTaxi api to show taxi vehicles or otherwise on a map

MyTaxi App App consuming myTaxi api to show taxi vehicles list on google maps. T

Kakashi 28 Aug 26, 2022
This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5

Kotlin-RestAssured Test Automation This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5 Introduction All the Test Cases kept

Dilshan Fernando 0 Dec 9, 2021
FinnAds - A sample project to fetch advertisements from a mock api

FinnAds ?? FinnAds is a sample project to fetch advertisements from a mock api.

Fatih Giriş 2 Jan 27, 2022
Lbc-test-app - Test Android Senior Leboncoin

Test Android Senior Leboncoin ?? Mathieu EDET Overview Min API version : 24 This

null 0 Feb 7, 2022
Simple, lightweight, modular components to help conjure your app architecture

Magic Simple, lightweight, modular components and utilities to help conjure your app architecture. Built with Kotlin coroutines to provide flexible as

TeraThought 0 Jan 9, 2022
Android library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests.

Green Coffee Green Coffee is a library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests using the

Mauricio Togneri 227 Nov 21, 2022
null 866 Dec 27, 2022
Linkester is an Android library that aims to help Android developers test their deep links implementation.

Linkester Linkester is an Android library that aims to help Android developers test their deep links implementation. The idea is to have a new launche

Ahmad Melegy 79 Dec 9, 2022
Android UI Testing

User scenario testing for Android Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium

null 2.8k Dec 14, 2022
A set of AssertJ helpers geared toward testing Android.

AssertJ Android A set of AssertJ assertions geared toward testing Android. Deprecated The support libraries and play services are developing at a rate

Square 1.6k Jan 3, 2023
Control and manage Android devices from your browser.

Warning This project along with other ones in OpenSTF organisation is provided as is for community, without active development. You can check any othe

STF 12.7k Jan 6, 2023
Android Unit Testing Framework

Robolectric is the industry-standard unit testing framework for Android. With Robolectric, your tests run in a simulated Android environment inside a

Robolectric 5.6k Jan 3, 2023
Android UI Testing

User scenario testing for Android Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium

null 2.7k Apr 8, 2021
A powerful test framework for Android

Cafe A powerful test framework for Android named Case Automated Framework for Everyone. Home Page http://baiduqa.github.com/Cafe/ How to make Cafe dow

Baidu 367 Nov 22, 2022
A custom instrumentation test runner for Android that generates XML reports for integration with other tools.

Android JUnit Report Test Runner Introduction The Android JUnit report test runner is a custom instrumentation test runner for Android that creates XM

Jason Sankey 148 Nov 25, 2022
Macaca Android driver

macaca-android Macaca Android driver Contributors xudafeng ziczhu SamuelZhaoY kobe990 CodeToSurvive1 kyowang qichuan brucejcw yaniswang This project f

Macaca 51 Apr 25, 2022
A powerful test framework for Android

Cafe A powerful test framework for Android named Case Automated Framework for Everyone. Home Page http://baiduqa.github.com/Cafe/ How to make Cafe dow

Baidu 367 Nov 22, 2022
3 types of Tests in Android (Unit - instrumentation - UI)

UnitTestingPractice 3 types of Tests in Android Unit instrumentation (Integration) UI Unit Testing benefits confirm code work like a charm simulate Ap

Ahmed Tawfiq 8 Mar 23, 2022
Selenium WebDriver and Appium based Web, Mobile (Android, iOS) and Windows desktop Automation Framework with BDD & Non-BDD implementation support

Selenium WebDriver and Appium based Web, Mobile (Android, iOS) and Windows desktop Automation Framework with BDD & Non-BDD implementation support

null 10 Dec 5, 2022