Repository: 1nikolas/play-integrity-checker-app
Branch: main
Commit: ee6316e906c7
Files: 49
Total size: 84.8 KB
Directory structure:
gitextract_9fpq23tj/
├── .gitignore
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── assets/
│ │ └── licenses/
│ │ ├── Appcompat
│ │ ├── Constraintlayout
│ │ ├── Material Components for Android
│ │ └── okhttp
│ ├── java/
│ │ └── gr/
│ │ └── nikolasspyr/
│ │ └── integritycheck/
│ │ ├── MainActivity.java
│ │ ├── Utils.java
│ │ └── dialogs/
│ │ ├── AboutDialog.java
│ │ └── licenses/
│ │ ├── License.java
│ │ ├── LicensesAdapter.java
│ │ ├── LicensesDialog.java
│ │ └── LicensesViewModel.java
│ └── res/
│ ├── drawable/
│ │ ├── ic_appicon.xml
│ │ ├── ic_fail.xml
│ │ ├── ic_gh.xml
│ │ ├── ic_help.xml
│ │ ├── ic_json.xml
│ │ ├── ic_launcher_foreground.xml
│ │ ├── ic_licenses.xml
│ │ ├── ic_pass.xml
│ │ └── ic_unknown.xml
│ ├── layout/
│ │ ├── activity_main.xml
│ │ ├── dialog_about.xml
│ │ ├── dialog_licenses.xml
│ │ ├── dialog_response.xml
│ │ └── item_license.xml
│ ├── menu/
│ │ └── menu.xml
│ ├── mipmap-anydpi-v26/
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ ├── values/
│ │ ├── colors.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ ├── values-night/
│ │ └── themes.xml
│ └── xml/
│ ├── backup_rules.xml
│ └── data_extraction_rules.xml
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Android Profiling
*.hprof
# Mac OS
.DS_Store
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2022 Nikolas Spiridakis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
<img src="https://github.com/1nikolas/play-integrity-checker-app/raw/main/app/src/main/ic_launcher-playstore.png" width="96" align="right" />
# Play Integrity API Checker
Get info about your Device Integrity through the Play Integrity API
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=gr.nikolasspyr.integritycheck)
> [!WARNING]
> If you don't install the app from Play Store and sideload it, you might not get the `MEETS_BASIC_INTEGRITY` and `MEETS_STRONG_INTEGRITY` results.
> [!WARNING]
> If you want to implement the Play Integrity API in your app you shouldn't do it this way. The API server should not send the whole JSON to the app, only a yes/no. Also ideally you should pair the integrity request with another one (for example login). That way your API won't let the user proceed without a valid Integrity token that passes integrity checks (even if your app is reverse engineered).
## Setup
In order to run this yourself you'll need:
1) The [Play Integrity Checker Server](https://github.com/1nikolas/play-integrity-checker-server)
2) Your server url specified in `local.properties` like this:
```
API_URL=https://my-awesome-server-url.com
```
3) The app to be on Play Store (otherwise you won't have access to `MEETS_BASIC_INTEGRITY` and `MEETS_STRONG_INTEGRITY`)
4) Play Integrity linked to a Google Cloud project through the Play Console with `MEETS_BASIC_INTEGRITY` and `MEETS_STRONG_INTEGRITY` enabled

To set up your Google Cloud project see [here](https://github.com/1nikolas/play-integrity-checker-server#how-to-set-up-google-cloud)
## License
MIT License
```
Copyright (c) 2022 Nikolas Spiridakis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: app/.gitignore
================================================
/build
/release
================================================
FILE: app/build.gradle
================================================
plugins {
id 'com.android.application'
}
android {
defaultConfig {
applicationId "gr.nikolasspyr.integritycheck"
minSdkVersion 21
targetSdkVersion 36
compileSdk = 36
versionCode 22
versionName "2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//Get variables from local.properties
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
buildConfigField "String", "API_URL", "\"${properties.getProperty('API_URL')}\""
}
buildFeatures {
dataBinding = true
buildConfig = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources = true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
namespace = 'gr.nikolasspyr.integritycheck'
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
implementation 'com.google.android.play:integrity:1.4.0'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
}
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PlayIntegrityAPIChecker"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:label="@string/app_name_short"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
================================================
FILE: app/src/main/assets/licenses/Appcompat
================================================
Copyright (C) 2014 The Android Open Source Project
https://developer.android.com/jetpack/androidx/releases/appcompat
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: app/src/main/assets/licenses/Constraintlayout
================================================
Copyright (C) 2015 The Android Open Source Project
https://developer.android.com/jetpack/androidx/releases/constraintlayout
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: app/src/main/assets/licenses/Material Components for Android
================================================
Copyright 2018 Google LLC
https://github.com/material-components/material-components-android
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: app/src/main/assets/licenses/okhttp
================================================
Copyright 2019 Square, Inc.
https://github.com/square/okhttp
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/MainActivity.java
================================================
package gr.nikolasspyr.integritycheck;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.android.gms.tasks.Task;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.color.MaterialColors;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.google.android.play.core.integrity.IntegrityManager;
import com.google.android.play.core.integrity.IntegrityManagerFactory;
import com.google.android.play.core.integrity.IntegrityServiceException;
import com.google.android.play.core.integrity.IntegrityTokenRequest;
import com.google.android.play.core.integrity.IntegrityTokenResponse;
import com.google.android.play.core.integrity.model.IntegrityErrorCode;
import org.json.JSONObject;
import java.io.IOException;
import java.util.Locale;
import gr.nikolasspyr.integritycheck.dialogs.AboutDialog;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
public class MainActivity extends AppCompatActivity {
private MaterialButton btn;
private ImageView deviceIntegrityIcon;
private ImageView basicIntegrityIcon;
private ImageView strongIntegrityIcon;
private ImageView virtualIntegrityIcon;
private Group virtualIntegrity;
private String jsonResponse;
private Integer[] integrityState = {-1, -1, -1, -1};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(R.string.app_name);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
ViewCompat.setOnApplyWindowInsetsListener(
findViewById(android.R.id.content),
(view, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
view.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
}
);
}
btn = findViewById(R.id.check_btn);
basicIntegrityIcon = findViewById(R.id.basic_integrity_icon);
deviceIntegrityIcon = findViewById(R.id.device_integrity_icon);
strongIntegrityIcon = findViewById(R.id.strong_integrity_icon);
virtualIntegrityIcon = findViewById(R.id.virtual_integrity_icon);
virtualIntegrity = findViewById(R.id.virtual_integrity);
btn.setOnClickListener(view -> {
toggleButtonLoading(true);
jsonResponse = null;
integrityState = new Integer[]{-1, -1, -1, -1};
setIcons(integrityState);
getToken();
});
}
private void getToken() {
String nonce = generateNonce();
// Create an instance of a manager.
IntegrityManager integrityManager = IntegrityManagerFactory.create(getApplicationContext());
// Request the integrity token by providing a nonce.
Task<IntegrityTokenResponse> integrityTokenResponseTask = integrityManager.requestIntegrityToken(
IntegrityTokenRequest.builder()
.setNonce(nonce)
.build());
integrityTokenResponseTask.addOnSuccessListener(integrityTokenResponse -> sendTokenRequest(integrityTokenResponse.token()));
integrityTokenResponseTask.addOnFailureListener(e -> {
toggleButtonLoading(false);
String errorMessage;
if (e instanceof IntegrityServiceException) {
errorMessage = getErrorMessageText((IntegrityServiceException) e);
} else {
errorMessage = e.getMessage();
}
showErrorDialog(getString(R.string.token_error_title), errorMessage);
});
}
private void sendTokenRequest(String token) {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.get()
.url(BuildConfig.API_URL + "/api/check?token=" + token)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
onRequestError(e.getMessage());
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
if (!response.isSuccessful()) {
onRequestError(String.format(Locale.US, getString(R.string.server_api_error_status_code), response.code()));
return;
}
ResponseBody responseBody = response.body();
if (responseBody == null) {
onRequestError(getString(R.string.server_api_error_empty_res));
return;
}
String responseBodyString = responseBody.string();
try {
parseResponseJSON(responseBodyString);
} catch (Exception e) {
onRequestError(e.getMessage());
}
}
});
}
private void onRequestError(String error) {
runOnUiThread(() -> {
showErrorDialog(getString(R.string.server_api_error_title), error);
toggleButtonLoading(false);
});
}
private void parseResponseJSON(String apiResponseJson) throws Exception {
JSONObject json = new JSONObject(apiResponseJson);
if (json.has("error")) {
throw new Exception(json.getString("error"));
}
JSONObject result;
if (json.has("deviceIntegrity")) {
result = json.getJSONObject("deviceIntegrity");
jsonResponse = json.toString(4);
} else {
result = new JSONObject();
}
if (result.has("deviceRecognitionVerdict")) {
integrityState = parseValues(result.get("deviceRecognitionVerdict").toString());
} else {
integrityState = parseValues("");
}
runOnUiThread(() -> setIcons(integrityState));
runOnUiThread(() -> toggleButtonLoading(false));
}
private void toggleButtonLoading(boolean isLoading) {
setButtonLoading(btn, isLoading);
btn.setEnabled(!isLoading);
}
private Drawable getProgressBarDrawable(Context context) {
CircularProgressIndicator drawable = new CircularProgressIndicator(context);
drawable.setIndicatorSize(48);
drawable.setTrackThickness(5);
drawable.setIndicatorColor(MaterialColors.getColor(context, com.google.android.material.R.attr.colorSecondary, Color.BLUE));
drawable.setIndeterminate(true);
return drawable.getIndeterminateDrawable();
}
private void setButtonLoading(MaterialButton button, boolean loading) {
button.setMaxLines(1);
button.setEllipsize(TextUtils.TruncateAt.END);
button.setIconGravity(MaterialButton.ICON_GRAVITY_START);
if (loading) {
Drawable drawable = button.getIcon();
if (!(drawable instanceof Animatable)) {
drawable = getProgressBarDrawable(button.getContext());
if (drawable instanceof Animatable) {
button.setIcon(drawable);
((Animatable) drawable).start();
}
}
} else {
button.setIcon(null);
}
}
private String generateNonce() {
int length = 50;
String nonce = "";
String allowed = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (int i = 0; i < length; i++) {
nonce = nonce.concat(String.valueOf(allowed.charAt((int) Math.floor(Math.random() * allowed.length()))));
}
return nonce;
}
private void showErrorDialog(String title, String message) {
new MaterialAlertDialogBuilder(MainActivity.this, R.style.Theme_PlayIntegrityAPIChecker_Dialogs)
.setTitle(title)
.setCancelable(true)
.setPositiveButton(R.string.ok, (dialogInterface, i) -> {
})
.setMessage(message)
.show();
}
private Integer[] parseValues(String integrity) {
return new Integer[]{integrity.contains("MEETS_BASIC_INTEGRITY") ? 1 : 0, integrity.contains("MEETS_DEVICE_INTEGRITY") ? 1 : 0, integrity.contains("MEETS_STRONG_INTEGRITY") ? 1 : 0, integrity.contains("MEETS_VIRTUAL_INTEGRITY") ? 1 : -1};
}
private void setIcons(Integer[] integrityState) {
setIcon(basicIntegrityIcon, integrityState[0]);
setIcon(deviceIntegrityIcon, integrityState[1]);
setIcon(strongIntegrityIcon, integrityState[2]);
setIcon(virtualIntegrityIcon, integrityState[3]);
if (integrityState[3] != -1) {
virtualIntegrity.setVisibility(View.VISIBLE);
} else {
virtualIntegrity.setVisibility(View.GONE);
}
}
private void setIcon(ImageView img, int state) {
if (state == -1) {
img.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_unknown));
img.setContentDescription(getString(R.string.status_unknown));
} else if (state == 0) {
img.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fail));
img.setContentDescription(getString(R.string.status_fail));
} else {
img.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_pass));
img.setContentDescription(getString(R.string.status_pass));
}
}
private String getErrorCodeName(int errorCode) {
return switch (errorCode) {
case IntegrityErrorCode.NO_ERROR -> "NO_ERROR";
case IntegrityErrorCode.API_NOT_AVAILABLE -> "API_NOT_AVAILABLE";
case IntegrityErrorCode.PLAY_STORE_NOT_FOUND -> "PLAY_STORE_NOT_FOUND";
case IntegrityErrorCode.NETWORK_ERROR -> "NETWORK_ERROR";
case IntegrityErrorCode.PLAY_STORE_ACCOUNT_NOT_FOUND -> "PLAY_STORE_ACCOUNT_NOT_FOUND";
case IntegrityErrorCode.APP_NOT_INSTALLED -> "APP_NOT_INSTALLED";
case IntegrityErrorCode.PLAY_SERVICES_NOT_FOUND -> "PLAY_SERVICES_NOT_FOUND";
case IntegrityErrorCode.APP_UID_MISMATCH -> "APP_UID_MISMATCH";
case IntegrityErrorCode.TOO_MANY_REQUESTS -> "TOO_MANY_REQUESTS";
case IntegrityErrorCode.CANNOT_BIND_TO_SERVICE -> "CANNOT_BIND_TO_SERVICE";
case IntegrityErrorCode.NONCE_TOO_SHORT -> "NONCE_TOO_SHORT";
case IntegrityErrorCode.NONCE_TOO_LONG -> "NONCE_TOO_LONG";
case IntegrityErrorCode.GOOGLE_SERVER_UNAVAILABLE -> "GOOGLE_SERVER_UNAVAILABLE";
case IntegrityErrorCode.NONCE_IS_NOT_BASE64 -> "NONCE_IS_NOT_BASE64";
case IntegrityErrorCode.PLAY_STORE_VERSION_OUTDATED -> "PLAY_STORE_VERSION_OUTDATED";
case IntegrityErrorCode.PLAY_SERVICES_VERSION_OUTDATED ->
"PLAY_SERVICES_VERSION_OUTDATED";
case IntegrityErrorCode.CLOUD_PROJECT_NUMBER_IS_INVALID ->
"CLOUD_PROJECT_NUMBER_IS_INVALID";
case IntegrityErrorCode.CLIENT_TRANSIENT_ERROR -> "CLIENT_TRANSIENT_ERROR";
case IntegrityErrorCode.INTERNAL_ERROR -> "INTERNAL_ERROR";
default -> "UNKNOWN_ERROR_CODE";
};
}
private String getErrorReason(int errorCode) {
return switch (errorCode) {
case IntegrityErrorCode.API_NOT_AVAILABLE ->
getString(R.string.error_reason_api_not_available);
case IntegrityErrorCode.APP_NOT_INSTALLED ->
getString(R.string.error_reason_app_not_installed);
case IntegrityErrorCode.APP_UID_MISMATCH ->
getString(R.string.error_reason_app_uid_mismatch);
case IntegrityErrorCode.CANNOT_BIND_TO_SERVICE ->
getString(R.string.error_reason_cannot_bind_to_service);
case IntegrityErrorCode.CLIENT_TRANSIENT_ERROR ->
getString(R.string.error_reason_client_transient_error);
case IntegrityErrorCode.CLOUD_PROJECT_NUMBER_IS_INVALID ->
getString(R.string.error_reason_cloud_project_number_is_invalid);
case IntegrityErrorCode.GOOGLE_SERVER_UNAVAILABLE ->
getString(R.string.error_reason_google_server_unavailable);
case IntegrityErrorCode.INTERNAL_ERROR ->
getString(R.string.error_reason_internal_error);
case IntegrityErrorCode.NETWORK_ERROR -> getString(R.string.error_reason_network_error);
case IntegrityErrorCode.NONCE_IS_NOT_BASE64 ->
getString(R.string.error_reason_nonce_is_not_base64);
case IntegrityErrorCode.NONCE_TOO_LONG ->
getString(R.string.error_reason_nonce_too_long);
case IntegrityErrorCode.NONCE_TOO_SHORT ->
getString(R.string.error_reason_nonce_too_short);
case IntegrityErrorCode.NO_ERROR -> "";
case IntegrityErrorCode.PLAY_SERVICES_NOT_FOUND ->
getString(R.string.error_reason_play_services_not_found);
case IntegrityErrorCode.PLAY_SERVICES_VERSION_OUTDATED ->
getString(R.string.error_reason_play_services_outdated);
case IntegrityErrorCode.PLAY_STORE_ACCOUNT_NOT_FOUND ->
getString(R.string.error_reason_play_store_account_not_found);
case IntegrityErrorCode.PLAY_STORE_NOT_FOUND ->
getString(R.string.error_reason_play_store_not_found);
case IntegrityErrorCode.PLAY_STORE_VERSION_OUTDATED ->
getString(R.string.error_reason_play_store_version_outdated);
case IntegrityErrorCode.TOO_MANY_REQUESTS ->
getString(R.string.error_reason_too_many_requests);
default -> getString(R.string.error_reason_unknown);
};
}
private String getErrorSolution(int errorCode) {
return switch (errorCode) {
case IntegrityErrorCode.API_NOT_AVAILABLE, IntegrityErrorCode.CANNOT_BIND_TO_SERVICE,
IntegrityErrorCode.PLAY_STORE_VERSION_OUTDATED ->
getString(R.string.error_solution_update_play_store);
case IntegrityErrorCode.APP_NOT_INSTALLED, IntegrityErrorCode.APP_UID_MISMATCH ->
getString(R.string.error_solution_something_wrong_attack);
case IntegrityErrorCode.CLIENT_TRANSIENT_ERROR,
IntegrityErrorCode.GOOGLE_SERVER_UNAVAILABLE, IntegrityErrorCode.INTERNAL_ERROR ->
getString(R.string.error_solution_try_again);
case IntegrityErrorCode.CLOUD_PROJECT_NUMBER_IS_INVALID,
IntegrityErrorCode.NONCE_IS_NOT_BASE64, IntegrityErrorCode.NONCE_TOO_LONG,
IntegrityErrorCode.NONCE_TOO_SHORT, IntegrityErrorCode.NO_ERROR ->
getString(R.string.error_solution_open_issue);
case IntegrityErrorCode.NETWORK_ERROR ->
getString(R.string.error_solution_check_connection);
case IntegrityErrorCode.PLAY_SERVICES_NOT_FOUND ->
getString(R.string.error_solution_install_update_play_services);
case IntegrityErrorCode.PLAY_SERVICES_VERSION_OUTDATED ->
getString(R.string.error_solution_update_play_services);
case IntegrityErrorCode.PLAY_STORE_ACCOUNT_NOT_FOUND ->
getString(R.string.error_solution_login);
case IntegrityErrorCode.PLAY_STORE_NOT_FOUND ->
getString(R.string.error_solution_install_official_play_store);
case IntegrityErrorCode.TOO_MANY_REQUESTS ->
getString(R.string.error_solution_try_again_later);
default -> "";
};
}
private String getErrorMessageText(IntegrityServiceException integrityServiceException) {
int errorCode = integrityServiceException.getErrorCode();
StringBuilder errorMessageBuilder = new StringBuilder();
errorMessageBuilder.append(String.format(Locale.US, "%s (%d)", getErrorCodeName(errorCode), errorCode));
String errorReason = getErrorReason(errorCode);
if (!errorReason.isEmpty()) {
errorMessageBuilder.append("\n");
errorMessageBuilder.append(errorReason);
}
String errorSolution = getErrorSolution(errorCode);
if (!errorSolution.isEmpty()) {
errorMessageBuilder.append("\n\n");
errorMessageBuilder.append(errorSolution);
}
return errorMessageBuilder.toString();
}
// Menu stuff
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.about) {
new AboutDialog(MainActivity.this).show();
return true;
} else if (id == R.id.json_response) {
if (jsonResponse == null) {
Toast.makeText(this, R.string.check_first, Toast.LENGTH_SHORT).show();
} else {
AlertDialog dialog = new MaterialAlertDialogBuilder(MainActivity.this, R.style.Theme_PlayIntegrityAPIChecker_Dialogs)
.setTitle(R.string.json_response)
.setCancelable(true)
.setPositiveButton(R.string.ok, null)
.setNeutralButton(R.string.copy_json, (dialogInterface, i) -> {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("", jsonResponse);
clipboard.setPrimaryClip(clip);
dialogInterface.dismiss();
Toast.makeText(MainActivity.this, getString(R.string.copied), Toast.LENGTH_SHORT).show();
})
.setView(R.layout.dialog_response)
.show();
TextView text = dialog.findViewById(R.id.message);
if (text == null) {
dialog.dismiss();
return true;
}
text.setText(jsonResponse);
}
return true;
} else if (id == R.id.documentation) {
Utils.openLink(getString(R.string.docs_link), this);
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
}
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/Utils.java
================================================
package gr.nikolasspyr.integritycheck;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;
public class Utils {
public static void openLink(String url, Context context) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
try {
context.startActivity(i);
} catch (ActivityNotFoundException e) { //For devices that have no browsers
Toast.makeText(context, R.string.no_browser_found, Toast.LENGTH_LONG).show();
}
}
}
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/AboutDialog.java
================================================
package gr.nikolasspyr.integritycheck.dialogs;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import java.util.Locale;
import gr.nikolasspyr.integritycheck.BuildConfig;
import gr.nikolasspyr.integritycheck.R;
import gr.nikolasspyr.integritycheck.Utils;
import gr.nikolasspyr.integritycheck.dialogs.licenses.LicensesDialog;
public class AboutDialog {
private final AlertDialog dialog;
public AboutDialog(Context context) {
dialog = new MaterialAlertDialogBuilder(context, R.style.Theme_PlayIntegrityAPIChecker_Dialogs)
.setPositiveButton(R.string.ok, (dialog, which) -> {
})
.create();
View dialogView = View.inflate(context, R.layout.dialog_about, null);
dialog.setView(dialogView);
TextView aboutText = dialogView.findViewById(R.id.about_text);
aboutText.setText(String.format(Locale.US, context.getResources().getString(R.string.about_text), BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE));
MaterialButton githubBtn = dialogView.findViewById(R.id.about_github);
MaterialButton licensesBtn = dialogView.findViewById(R.id.about_licenses);
githubBtn.setOnClickListener(v -> {
Utils.openLink(context.getString(R.string.about_github_link), context);
dialog.dismiss();
});
licensesBtn.setOnClickListener(v -> {
new LicensesDialog(context).show();
dialog.dismiss();
});
}
public void show() {
dialog.show();
}
}
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/License.java
================================================
package gr.nikolasspyr.integritycheck.dialogs.licenses;
public class License {
public String subject;
public String text;
public License(String subject, String text) {
this.subject = subject;
this.text = text;
}
}
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesAdapter.java
================================================
package gr.nikolasspyr.integritycheck.dialogs.licenses;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import gr.nikolasspyr.integritycheck.R;
public class LicensesAdapter extends RecyclerView.Adapter<LicensesAdapter.ViewHolder> {
private final LayoutInflater mInflater;
private List<License> mLicenses;
public LicensesAdapter(Context c) {
mInflater = LayoutInflater.from(c);
}
public void setLicenses(List<License> licenses) {
mLicenses = licenses;
notifyItemRangeInserted(0, licenses.size());
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(mInflater.inflate(R.layout.item_license, parent, false));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.bind(mLicenses.get(position));
}
@Override
public int getItemCount() {
return mLicenses == null ? 0 : mLicenses.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
private final TextView title;
private final TextView text;
private ViewHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.license_title);
text = itemView.findViewById(R.id.license_text);
}
private void bind(License license) {
title.setText(license.subject);
text.setText(license.text);
}
}
}
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesDialog.java
================================================
package gr.nikolasspyr.integritycheck.dialogs.licenses;
import android.content.Context;
import android.view.View;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import gr.nikolasspyr.integritycheck.R;
public class LicensesDialog {
private final AlertDialog dialog;
private final Context context;
public LicensesDialog(Context context) {
this.context = context;
dialog = new MaterialAlertDialogBuilder(context, R.style.Theme_PlayIntegrityAPIChecker_Dialogs)
.setTitle(R.string.licenses)
.setPositiveButton(R.string.ok, (dialog, which) -> {
})
.create();
View dialogView = View.inflate(context, R.layout.dialog_licenses, null);
dialog.setView(dialogView);
RecyclerView recyclerView = dialogView.findViewById(R.id.licenses_recycler);
recyclerView.setLayoutManager(new LinearLayoutManager(context));
recyclerView.getRecycledViewPool().setMaxRecycledViews(0, 16);
LicensesAdapter adapter = new LicensesAdapter(context);
recyclerView.setAdapter(adapter);
AppCompatActivity activity = (AppCompatActivity) context;
LicensesViewModel viewModel = new LicensesViewModel(activity.getApplication());
viewModel.getLicenses().observe(activity, adapter::setLicenses);
}
public void show() {
dialog.show();
MaterialButton button = (MaterialButton) dialog.getButton(AlertDialog.BUTTON_POSITIVE);
button.setTextColor(context.getResources().getColor(R.color.blueSecondary));
button.setRippleColorResource(R.color.blueSecondary);
}
}
================================================
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesViewModel.java
================================================
package gr.nikolasspyr.integritycheck.dialogs.licenses;
import android.app.Application;
import android.content.res.AssetManager;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class LicensesViewModel extends AndroidViewModel {
private final MutableLiveData<List<License>> mLicenses = new MutableLiveData<>();
private final MutableLiveData<Boolean> mAreLicensesLoading = new MutableLiveData<>();
public LicensesViewModel(@NonNull Application application) {
super(application);
mLicenses.setValue(Collections.emptyList());
mAreLicensesLoading.setValue(false);
loadLicences();
}
public LiveData<List<License>> getLicenses() {
return mLicenses;
}
private void loadLicences() {
if (Boolean.TRUE.equals(mAreLicensesLoading.getValue()))
return;
mAreLicensesLoading.setValue(true);
new Thread(() -> {
try {
AssetManager assetManager = getApplication().getAssets();
String licensesDir = "licenses";
String[] rawLicenses = assetManager.list(licensesDir);
assert rawLicenses != null;
ArrayList<License> licenses = new ArrayList<>(rawLicenses.length);
for (String rawLicense : rawLicenses)
licenses.add(new License(rawLicense, readStream(assetManager.open(licensesDir + "/" + rawLicense), "UTF-8")));
Collections.sort(licenses, (license1, license2) -> license1.subject.compareToIgnoreCase(license2.subject));
mLicenses.postValue(licenses);
mAreLicensesLoading.postValue(false);
} catch (Exception e) {
mAreLicensesLoading.postValue(false);
}
}).start();
}
public static void copyStream(InputStream from, OutputStream to) throws IOException {
byte[] buf = new byte[1024 * 1024];
int len;
while ((len = from.read(buf)) > 0) {
to.write(buf, 0, len);
}
}
public static byte[] readStream(InputStream inputStream) throws IOException {
try (InputStream in = inputStream) {
return readStreamNoClose(in);
}
}
public static String readStream(InputStream inputStream, String charset) throws IOException {
return new String(readStream(inputStream), charset);
}
public static byte[] readStreamNoClose(InputStream inputStream) throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
copyStream(inputStream, buffer);
return buffer.toByteArray();
}
}
================================================
FILE: app/src/main/res/drawable/ic_appicon.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="70dp"
android:height="70dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M24,28.3q1.85,0 3.15,-1.275 1.3,-1.275 1.3,-3.125 0,-1.9 -1.3,-3.2 -1.3,-1.3 -3.15,-1.3 -1.85,0 -3.15,1.3 -1.3,1.3 -1.3,3.2 0,1.85 1.3,3.125T24,28.3ZM24,44q-7,-1.75 -11.5,-8.125T8,21.9V10l16,-6 16,6v11.9q0,3.25 -0.9,6.375T36.6,34.1l-6.4,-6.2q0.65,-0.85 0.95,-1.9 0.3,-1.05 0.3,-2.1 0,-3.15 -2.175,-5.325Q27.1,16.4 24,16.4q-3.1,0 -5.275,2.175Q16.55,20.75 16.55,23.9q0,3.1 2.175,5.25T24,31.3q1.1,0 2.15,-0.35 1.05,-0.35 2,-0.9l6.75,6.55q-2.1,2.7 -4.85,4.625Q27.3,43.15 24,44Z"
android:fillColor="#008000"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_fail.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/red"
android:pathData="m16.5,33.6 l7.5,-7.5 7.5,7.5 2.1,-2.1 -7.5,-7.5 7.5,-7.5 -2.1,-2.1 -7.5,7.5 -7.5,-7.5 -2.1,2.1 7.5,7.5 -7.5,7.5ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_gh.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="12.7"
android:viewportHeight="12.7">
<path
android:pathData="m6.35,0.788c-3.149,0 -5.702,2.553 -5.702,5.702 0,2.519 1.634,4.657 3.9,5.411 0.285,0.053 0.39,-0.124 0.39,-0.274 0,-0.136 -0.005,-0.585 -0.008,-1.062C3.343,10.911 3.008,9.893 3.008,9.893 2.749,9.234 2.375,9.059 2.375,9.059 1.857,8.705 2.414,8.712 2.414,8.712 2.986,8.752 3.288,9.3 3.288,9.3 3.797,10.171 4.622,9.919 4.947,9.774 4.999,9.405 5.146,9.153 5.309,9.011 4.043,8.867 2.711,8.378 2.711,6.193c0,-0.622 0.223,-1.131 0.588,-1.531 -0.059,-0.144 -0.254,-0.724 0.055,-1.509 0,0 0.479,-0.153 1.568,0.585 0.455,-0.126 0.943,-0.19 1.427,-0.192 0.485,0.002 0.973,0.066 1.429,0.192 1.088,-0.738 1.567,-0.585 1.567,-0.585 0.31,0.785 0.115,1.365 0.056,1.509 0.366,0.399 0.587,0.908 0.587,1.531 0,2.19 -1.334,2.672 -2.604,2.814 0.205,0.177 0.387,0.524 0.387,1.056 0,0.763 -0.007,1.377 -0.007,1.565 0,0.152 0.103,0.33 0.392,0.274C10.421,11.146 12.052,9.009 12.052,6.491c0,-3.149 -2.553,-5.702 -5.702,-5.702"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="m2.807,8.976c-0.013,0.028 -0.057,0.037 -0.098,0.017 -0.041,-0.019 -0.065,-0.057 -0.051,-0.086 0.012,-0.029 0.057,-0.037 0.098,-0.018 0.041,0.019 0.065,0.058 0.051,0.086"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m3.038,9.233c-0.027,0.025 -0.08,0.014 -0.116,-0.026 -0.037,-0.04 -0.044,-0.093 -0.017,-0.119 0.028,-0.025 0.08,-0.013 0.117,0.026 0.037,0.04 0.045,0.093 0.016,0.119"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m3.263,9.562c-0.035,0.024 -0.092,0.002 -0.127,-0.049 -0.035,-0.051 -0.035,-0.112 0.001,-0.136 0.035,-0.024 0.092,-0.002 0.127,0.048 0.035,0.052 0.035,0.112 -0.001,0.137"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m3.571,9.879c-0.031,0.034 -0.098,0.025 -0.147,-0.022 -0.05,-0.046 -0.064,-0.111 -0.032,-0.146 0.032,-0.035 0.099,-0.025 0.148,0.022 0.049,0.046 0.064,0.112 0.031,0.146"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m3.996,10.063c-0.014,0.045 -0.078,0.065 -0.142,0.046 -0.064,-0.02 -0.107,-0.072 -0.094,-0.117 0.013,-0.045 0.078,-0.066 0.143,-0.046 0.064,0.019 0.107,0.071 0.093,0.117"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m4.463,10.097c0.002,0.047 -0.053,0.086 -0.121,0.087 -0.068,0.002 -0.123,-0.037 -0.124,-0.083 0,-0.047 0.054,-0.086 0.122,-0.087 0.068,-0.001 0.123,0.037 0.123,0.083"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m4.897,10.024c0.008,0.046 -0.039,0.093 -0.106,0.105 -0.066,0.012 -0.127,-0.016 -0.136,-0.062 -0.008,-0.047 0.04,-0.094 0.106,-0.106 0.067,-0.012 0.128,0.016 0.136,0.063"
android:strokeWidth="0.0944291"
android:fillColor="#1b1817"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_help.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"
android:fillColor="?colorOnPrimary"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_json.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="?colorOnPrimary"
android:pathData="m16,35.9 l-12,-12 12.1,-12.1 2.15,2.15L8.3,23.9l9.85,9.85ZM31.9,36 L29.75,33.85 39.7,23.9 29.85,14.05L32,11.9l12,12Z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="1.17"
android:scaleY="1.17"
android:translateX="25.92"
android:translateY="25.92">
<path
android:pathData="M24,28.3q1.85,0 3.15,-1.275 1.3,-1.275 1.3,-3.125 0,-1.9 -1.3,-3.2 -1.3,-1.3 -3.15,-1.3 -1.85,0 -3.15,1.3 -1.3,1.3 -1.3,3.2 0,1.85 1.3,3.125T24,28.3ZM24,44q-7,-1.75 -11.5,-8.125T8,21.9V10l16,-6 16,6v11.9q0,3.25 -0.9,6.375T36.6,34.1l-6.4,-6.2q0.65,-0.85 0.95,-1.9 0.3,-1.05 0.3,-2.1 0,-3.15 -2.175,-5.325Q27.1,16.4 24,16.4q-3.1,0 -5.275,2.175Q16.55,20.75 16.55,23.9q0,3.1 2.175,5.25T24,31.3q1.1,0 2.15,-0.35 1.05,-0.35 2,-0.9l6.75,6.55q-2.1,2.7 -4.85,4.625Q27.3,43.15 24,44Z"
android:fillColor="#008000"/>
</group>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_licenses.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M14,2L6,2c-1.1,0 -1.99,0.9 -1.99,2L4,20c0,1.1 0.89,2 1.99,2L18,22c1.1,0 2,-0.9 2,-2L20,8l-6,-6zM16,18L8,18v-2h8v2zM16,14L8,14v-2h8v2zM13,9L13,3.5L18.5,9L13,9z"
android:fillColor="?attr/colorOnPrimary"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_pass.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/green"
android:pathData="M21.05,33.1 L35.2,18.95l-2.3,-2.25 -11.85,11.85 -6,-6 -2.25,2.25ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_unknown.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/yellow"
android:pathData="M24.2,35.65q0.8,0 1.35,-0.55t0.55,-1.35q0,-0.8 -0.55,-1.35t-1.35,-0.55q-0.8,0 -1.35,0.55t-0.55,1.35q0,0.8 0.55,1.35t1.35,0.55ZM22.45,28.35h2.95q0,-1.3 0.325,-2.375T27.75,23.5q1.55,-1.3 2.2,-2.55 0.65,-1.25 0.65,-2.75 0,-2.65 -1.725,-4.25t-4.575,-1.6q-2.45,0 -4.325,1.225T17.25,16.95l2.65,1q0.55,-1.4 1.65,-2.175 1.1,-0.775 2.6,-0.775 1.7,0 2.75,0.925t1.05,2.375q0,1.1 -0.65,2.075 -0.65,0.975 -1.9,2.025 -1.5,1.3 -2.225,2.575 -0.725,1.275 -0.725,3.375ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z"/>
</vector>
================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/Theme.PlayIntegrityAPIChecker" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:alpha="0.12"
android:background="?colorOnSurface" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Space
android:id="@+id/top_space"
android:layout_width="0dp"
android:layout_height="15dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/flow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="basic_integrity_icon,basic_integrity_text,device_integrity_icon,device_integrity_text,strong_integrity_icon,strong_integrity_text,virtual_integrity_icon,virtual_integrity_text"
app:flow_horizontalGap="15dp"
app:flow_verticalGap="15dp"
app:flow_wrapMode="aligned"
app:flow_maxElementsWrap="2"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toBottomOf="@id/top_space"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/check_btn" />
<ImageView
android:id="@+id/basic_integrity_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="10dp"
android:contentDescription="@string/status_unknown"
android:src="@drawable/ic_unknown" />
<ImageView
android:id="@+id/device_integrity_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="10dp"
android:contentDescription="@string/status_unknown"
android:src="@drawable/ic_unknown" />
<ImageView
android:id="@+id/strong_integrity_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="10dp"
android:contentDescription="@string/status_unknown"
android:src="@drawable/ic_unknown" />
<ImageView
android:id="@+id/virtual_integrity_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="10dp"
android:contentDescription="@string/status_unknown"
android:src="@drawable/ic_unknown" />
<TextView
android:id="@+id/basic_integrity_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="MEETS_BASIC_INTEGRITY"
android:textColor="?colorOnPrimary"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/device_integrity_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="MEETS_DEVICE_INTEGRITY"
android:textColor="?colorOnPrimary"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/strong_integrity_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="MEETS_STRONG_INTEGRITY"
android:textColor="?colorOnPrimary"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/virtual_integrity_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="MEETS_VIRTUAL_INTEGRITY"
android:textColor="?colorOnPrimary"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<androidx.constraintlayout.widget.Group
android:id="@+id/virtual_integrity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="virtual_integrity_text,virtual_integrity_icon"
tools:visibility="visible" />
<com.google.android.material.button.MaterialButton
android:id="@+id/check_btn"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/check"
android:textColor="?colorOnPrimary"
app:iconTint="?colorSecondary"
app:layout_constraintBottom_toTopOf="@id/bottom_space"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/flow"
app:rippleColor="?colorSecondary" />
<Space
android:id="@+id/bottom_space"
android:layout_width="0dp"
android:layout_height="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/dialog_about.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/about_top_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_appicon" />
<TextView
android:id="@+id/about_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_text"
android:textColor="?attr/colorOnPrimary"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:textAlignment="center"
android:lineSpacingExtra="5sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/about_top_img"/>
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/about_buttons"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
app:constraint_referenced_ids="about_github,about_licenses"
app:flow_horizontalGap="10dp"
app:flow_horizontalStyle="spread"
app:flow_wrapMode="chain"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/about_text" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/about_buttons" />
<com.google.android.material.button.MaterialButton
android:id="@+id/about_github"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/github"
android:textColor="?attr/colorSecondary"
app:icon="@drawable/ic_gh"
app:iconTint="?attr/colorSecondary"
app:rippleColor="@color/blueSecondary"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/about_licenses"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/licenses"
android:textColor="?attr/colorSecondary"
app:icon="@drawable/ic_licenses"
app:iconTint="?attr/colorSecondary"
app:rippleColor="@color/blueSecondary"/>
</androidx.constraintlayout.widget.ConstraintLayout>
================================================
FILE: app/src/main/res/layout/dialog_licenses.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/licenses_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"/>
</RelativeLayout>
================================================
FILE: app/src/main/res/layout/dialog_response.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipToPadding="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/message"
style="?attr/materialAlertDialogBodyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:scrollHorizontally="true"
android:padding="?attr/dialogPreferredPadding"/>
</HorizontalScrollView>
</androidx.core.widget.NestedScrollView>
================================================
FILE: app/src/main/res/layout/item_license.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp">
<TextView
android:id="@+id/license_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
android:textColor="?attr/colorOnPrimary"
tools:text="Test program"/>
<TextView
android:id="@+id/license_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:textColor="?attr/colorOnPrimary"
android:alpha="0.66"
tools:text="License text"/>
</LinearLayout>
================================================
FILE: app/src/main/res/menu/menu.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/json_response"
android:title="@string/show_json_response"
android:icon="@drawable/ic_json"
app:showAsAction="ifRoom" />
<item android:id="@+id/documentation"
android:title="@string/show_documentation"
app:showAsAction="never" />
<item android:id="@+id/about"
android:title="@string/about"
app:showAsAction="never" />
</menu>
================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#000000</color>
<color name="white">#ffffff</color>
<color name="blackAlpha">#DE000000</color>
<color name="whiteAlpha">#DEFFFFFF</color>
<color name="blueSecondary">#4285f4</color>
<color name="blueSecondaryAlpha">#ECF3FE</color>
<color name="blueSecondaryAlphaDark">#171E29</color>
<color name="blueSecondaryDark">#0059c1</color>
<color name="darkPrimary">#121212</color>
<color name="green">#3ec714</color>
<color name="red">#c91818</color>
<color name="yellow">#FFDA1A</color>
</resources>
================================================
FILE: app/src/main/res/values/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#353937</color>
</resources>
================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
<string name="app_name" translatable="false">Play Integrity API Checker</string>
<string name="error">Error</string>
<string name="ok">OK</string>
<string name="check">Check</string>
<string name="app_name_short" translatable="false">Integrity Checker</string>
<string name="licenses">Licenses</string>
<string name="github" translatable="false">Github</string>
<string name="about_text">Made by Nikolas Spiridakis\nVersion: %s (%d)</string>
<string name="about">About</string>
<string name="about_github_link" translatable="false">https://github.com/1nikolas/play-integrity-checker-app</string>
<string name="no_browser_found">No browser found!</string>
<string name="status_unknown">Unknown</string>
<string name="status_pass">Pass</string>
<string name="status_fail">Fail</string>
<string name="show_json_response">Show JSON response</string>
<string name="json_response">Raw JSON response</string>
<string name="check_first">Please run a check first!</string>
<string name="show_documentation">Learn what the results mean</string>
<string name="docs_link">https://developer.android.com/google/play/integrity/verdicts#optional-device-labels</string>
<string name="copy_json">Copy JSON</string>
<string name="copied">Copied to clipboard!</string>
<string name="token_error_title">Integrity API Error</string>
<string name="server_api_error_title">Server API Request Error</string>
<string name="server_api_error_status_code">API returned: %d</string>
<string name="server_api_error_empty_res">Empty Response</string>
<!-- ERROR REASONS (from Google's docs) -->
<string name="error_reason_api_not_available">Integrity API is not available.</string>
<string name="error_reason_app_not_installed">The calling app is not installed.</string>
<string name="error_reason_app_uid_mismatch">The calling app UID (user id) does not match the one from Package Manager.</string>
<string name="error_reason_cannot_bind_to_service">Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device.</string>
<string name="error_reason_client_transient_error">There was a transient error in the client device.</string>
<string name="error_reason_cloud_project_number_is_invalid">The provided cloud project number is invalid.</string>
<string name="error_reason_google_server_unavailable">Unknown internal Google server error.</string>
<string name="error_reason_internal_error">Unknown internal error.</string>
<string name="error_reason_network_error">No available network is found.</string>
<string name="error_reason_nonce_is_not_base64">Nonce is not encoded as a base64 web-safe no-wrap string.</string>
<string name="error_reason_nonce_too_long">Nonce length is too long. The nonce must be less than 500 bytes before base64 encoding.</string>
<string name="error_reason_nonce_too_short"> Nonce length is too short. The nonce must be a minimum of 16 bytes (before base64 encoding) to allow for a better security.</string>
<string name="error_reason_play_services_not_found">Play Services is not available or version is too old.</string>
<string name="error_reason_play_services_outdated">Play Services needs to be updated.</string>
<string name="error_reason_play_store_account_not_found">No Play Store account is found on device.</string>
<string name="error_reason_play_store_not_found">No Play Store app is found on device or not official version is installed.</string>
<string name="error_reason_play_store_version_outdated">The Play Store needs to be updated.</string>
<string name="error_reason_too_many_requests">The calling app is making too many requests to the API and hence is throttled.</string>
<string name="error_reason_unknown">Unknown error.</string>
<!-- ERROR SOLUTIONS (based on Google's docs -->
<string name="error_solution_update_play_store">Try updating Play Store.</string>
<string name="error_solution_something_wrong_attack">Something is wrong (possibly an attack).</string>
<string name="error_solution_try_again">Try again.</string>
<string name="error_solution_open_issue">If this happens consistently, open an issue on Github.</string>
<string name="error_solution_check_connection">Check your connection.</string>
<string name="error_solution_install_update_play_services">Try installing/updating Google Play Services.</string>
<string name="error_solution_update_play_services">Try updating Google Play Services.</string>
<string name="error_solution_login">Try logging in to Play Store.</string>
<string name="error_solution_install_official_play_store">Try installing an official and recent version of Play Store.</string>
<string name="error_solution_try_again_later">Try again later.</string>
</resources>
================================================
FILE: app/src/main/res/values/themes.xml
================================================
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.PlayIntegrityAPIChecker" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryVariant">@color/white</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/blueSecondary</item>
<item name="colorSecondaryVariant">@color/blueSecondaryAlpha</item>
<item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" >?attr/colorPrimaryVariant</item>
<item name="android:navigationBarColor" >?attr/colorPrimaryVariant</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
<!-- 3dot -->
<item name="actionOverflowButtonStyle">@style/Theme.PlayIntegrityAPIChecker.actionButtonOverflow</item>
<!-- Toolbar -->
<item name="actionBarTheme">@style/Theme.PlayIntegrityAPIChecker.actionBarTheme</item>
</style>
<style name="Theme.PlayIntegrityAPIChecker.Dialogs" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="colorAccent">@color/blueSecondary</item>
<item name="colorPrimary">@color/blueSecondary</item>
</style>
<style name="Theme.PlayIntegrityAPIChecker.actionButtonOverflow" parent="Widget.AppCompat.Light.ActionButton.Overflow">
<item name="android:tint">@color/black</item>
<item name="android:color">@color/black</item>
</style>
<style name="Theme.PlayIntegrityAPIChecker.actionBarTheme" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:textColorPrimary">@color/black</item>
</style>
</resources>
================================================
FILE: app/src/main/res/values-night/themes.xml
================================================
<resources>
<!-- Base application theme. -->
<style name="Theme.PlayIntegrityAPIChecker" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/darkPrimary</item>
<item name="colorPrimaryVariant">@color/darkPrimary</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/blueSecondary</item>
<item name="colorSecondaryVariant">@color/blueSecondaryAlphaDark</item>
<item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" >?attr/colorPrimaryVariant</item>
<item name="android:navigationBarColor" >?attr/colorPrimaryVariant</item>
<!-- 3dot color -->
<item name="actionOverflowButtonStyle">@style/Theme.PlayIntegrityAPIChecker.actionButtonOverflow</item>
</style>
<style name="Theme.PlayIntegrityAPIChecker.Dialogs" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="colorAccent">@color/blueSecondary</item>
<item name="colorPrimary">@color/blueSecondary</item>
</style>
<style name="Theme.PlayIntegrityAPIChecker.actionButtonOverflow" parent="Widget.AppCompat.Light.ActionButton.Overflow">
<item name="android:tint">@color/white</item>
<item name="android:color">@color/white</item>
</style>
</resources>
================================================
FILE: app/src/main/res/xml/backup_rules.xml
================================================
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
================================================
FILE: app/src/main/res/xml/data_extraction_rules.xml
================================================
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.12.0' apply false
id 'com.android.library' version '8.12.0' apply false
}
tasks.register('clean', Delete) {
delete layout.buildDirectory
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Thu Jan 16 16:08:38 EET 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonFinalResIds=false
================================================
FILE: gradlew
================================================
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: settings.gradle
================================================
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Play Integrity API Checker"
include ':app'
gitextract_9fpq23tj/ ├── .gitignore ├── LICENSE ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ └── main/ │ ├── AndroidManifest.xml │ ├── assets/ │ │ └── licenses/ │ │ ├── Appcompat │ │ ├── Constraintlayout │ │ ├── Material Components for Android │ │ └── okhttp │ ├── java/ │ │ └── gr/ │ │ └── nikolasspyr/ │ │ └── integritycheck/ │ │ ├── MainActivity.java │ │ ├── Utils.java │ │ └── dialogs/ │ │ ├── AboutDialog.java │ │ └── licenses/ │ │ ├── License.java │ │ ├── LicensesAdapter.java │ │ ├── LicensesDialog.java │ │ └── LicensesViewModel.java │ └── res/ │ ├── drawable/ │ │ ├── ic_appicon.xml │ │ ├── ic_fail.xml │ │ ├── ic_gh.xml │ │ ├── ic_help.xml │ │ ├── ic_json.xml │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_licenses.xml │ │ ├── ic_pass.xml │ │ └── ic_unknown.xml │ ├── layout/ │ │ ├── activity_main.xml │ │ ├── dialog_about.xml │ │ ├── dialog_licenses.xml │ │ ├── dialog_response.xml │ │ └── item_license.xml │ ├── menu/ │ │ └── menu.xml │ ├── mipmap-anydpi-v26/ │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ ├── values/ │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml │ ├── values-night/ │ │ └── themes.xml │ └── xml/ │ ├── backup_rules.xml │ └── data_extraction_rules.xml ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle
SYMBOL INDEX (47 symbols across 7 files)
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/MainActivity.java
class MainActivity (line 54) | public class MainActivity extends AppCompatActivity {
method onCreate (line 67) | @Override
method getToken (line 110) | private void getToken() {
method sendTokenRequest (line 138) | private void sendTokenRequest(String token) {
method onRequestError (line 177) | private void onRequestError(String error) {
method parseResponseJSON (line 184) | private void parseResponseJSON(String apiResponseJson) throws Exception {
method toggleButtonLoading (line 213) | private void toggleButtonLoading(boolean isLoading) {
method getProgressBarDrawable (line 218) | private Drawable getProgressBarDrawable(Context context) {
method setButtonLoading (line 227) | private void setButtonLoading(MaterialButton button, boolean loading) {
method generateNonce (line 246) | private String generateNonce() {
method showErrorDialog (line 256) | private void showErrorDialog(String title, String message) {
method parseValues (line 267) | private Integer[] parseValues(String integrity) {
method setIcons (line 272) | private void setIcons(Integer[] integrityState) {
method setIcon (line 285) | private void setIcon(ImageView img, int state) {
method getErrorCodeName (line 298) | private String getErrorCodeName(int errorCode) {
method getErrorReason (line 325) | private String getErrorReason(int errorCode) {
method getErrorSolution (line 368) | private String getErrorSolution(int errorCode) {
method getErrorMessageText (line 399) | private String getErrorMessageText(IntegrityServiceException integrity...
method onCreateOptionsMenu (line 421) | @Override
method onOptionsItemSelected (line 428) | @Override
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/Utils.java
class Utils (line 9) | public class Utils {
method openLink (line 10) | public static void openLink(String url, Context context) {
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/AboutDialog.java
class AboutDialog (line 20) | public class AboutDialog {
method AboutDialog (line 24) | public AboutDialog(Context context) {
method show (line 57) | public void show() {
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/License.java
class License (line 3) | public class License {
method License (line 8) | public License(String subject, String text) {
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesAdapter.java
class LicensesAdapter (line 17) | public class LicensesAdapter extends RecyclerView.Adapter<LicensesAdapte...
method LicensesAdapter (line 22) | public LicensesAdapter(Context c) {
method setLicenses (line 26) | public void setLicenses(List<License> licenses) {
method onCreateViewHolder (line 31) | @NonNull
method onBindViewHolder (line 37) | @Override
method getItemCount (line 42) | @Override
class ViewHolder (line 47) | static class ViewHolder extends RecyclerView.ViewHolder {
method ViewHolder (line 52) | private ViewHolder(@NonNull View itemView) {
method bind (line 59) | private void bind(License license) {
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesDialog.java
class LicensesDialog (line 17) | public class LicensesDialog {
method LicensesDialog (line 22) | public LicensesDialog(Context context) {
method show (line 51) | public void show() {
FILE: app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesViewModel.java
class LicensesViewModel (line 19) | public class LicensesViewModel extends AndroidViewModel {
method LicensesViewModel (line 24) | public LicensesViewModel(@NonNull Application application) {
method getLicenses (line 33) | public LiveData<List<License>> getLicenses() {
method loadLicences (line 37) | private void loadLicences() {
method copyStream (line 65) | public static void copyStream(InputStream from, OutputStream to) throw...
method readStream (line 73) | public static byte[] readStream(InputStream inputStream) throws IOExce...
method readStream (line 79) | public static String readStream(InputStream inputStream, String charse...
method readStreamNoClose (line 83) | public static byte[] readStreamNoClose(InputStream inputStream) throws...
Condensed preview — 49 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (94K chars).
[
{
"path": ".gitignore",
"chars": 386,
"preview": "# Gradle files\n.gradle/\nbuild/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Log/OS Files\n*.log\n\n# And"
},
{
"path": "LICENSE",
"chars": 1075,
"preview": "MIT License\n\nCopyright (c) 2022 Nikolas Spiridakis\n\nPermission is hereby granted, free of charge, to any person obtainin"
},
{
"path": "README.md",
"chars": 2905,
"preview": "<img src=\"https://github.com/1nikolas/play-integrity-checker-app/raw/main/app/src/main/ic_launcher-playstore.png\" width="
},
{
"path": "app/.gitignore",
"chars": 16,
"preview": "/build\n/release\n"
},
{
"path": "app/build.gradle",
"chars": 1430,
"preview": "plugins {\n id 'com.android.application'\n}\n\nandroid {\n\n defaultConfig {\n applicationId \"gr.nikolasspyr.integ"
},
{
"path": "app/proguard-rules.pro",
"chars": 750,
"preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 1065,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:to"
},
{
"path": "app/src/main/assets/licenses/Appcompat",
"chars": 652,
"preview": "Copyright (C) 2014 The Android Open Source Project\r\n\r\nhttps://developer.android.com/jetpack/androidx/releases/appcompat\r"
},
{
"path": "app/src/main/assets/licenses/Constraintlayout",
"chars": 659,
"preview": "Copyright (C) 2015 The Android Open Source Project\r\n\r\nhttps://developer.android.com/jetpack/androidx/releases/constraint"
},
{
"path": "app/src/main/assets/licenses/Material Components for Android",
"chars": 628,
"preview": "Copyright 2018 Google LLC\r\n\r\nhttps://github.com/material-components/material-components-android\r\n\r\nLicensed under the Ap"
},
{
"path": "app/src/main/assets/licenses/okhttp",
"chars": 596,
"preview": "Copyright 2019 Square, Inc.\r\n\r\nhttps://github.com/square/okhttp\r\n\r\nLicensed under the Apache License, Version 2.0 (the \""
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/MainActivity.java",
"chars": 20100,
"preview": "package gr.nikolasspyr.integritycheck;\n\nimport android.content.ClipData;\nimport android.content.ClipboardManager;\nimport"
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/Utils.java",
"chars": 621,
"preview": "package gr.nikolasspyr.integritycheck;\n\nimport android.content.ActivityNotFoundException;\nimport android.content.Context"
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/AboutDialog.java",
"chars": 1760,
"preview": "package gr.nikolasspyr.integritycheck.dialogs;\n\nimport android.content.Context;\nimport android.view.View;\nimport android"
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/License.java",
"chars": 250,
"preview": "package gr.nikolasspyr.integritycheck.dialogs.licenses;\n\npublic class License {\n\n public String subject;\n public S"
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesAdapter.java",
"chars": 1740,
"preview": "package gr.nikolasspyr.integritycheck.dialogs.licenses;\n\nimport android.content.Context;\nimport android.view.LayoutInfla"
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesDialog.java",
"chars": 1931,
"preview": "package gr.nikolasspyr.integritycheck.dialogs.licenses;\n\nimport android.content.Context;\nimport android.view.View;\n\nimpo"
},
{
"path": "app/src/main/java/gr/nikolasspyr/integritycheck/dialogs/licenses/LicensesViewModel.java",
"chars": 2962,
"preview": "package gr.nikolasspyr.integritycheck.dialogs.licenses;\n\nimport android.app.Application;\nimport android.content.res.Asse"
},
{
"path": "app/src/main/res/drawable/ic_appicon.xml",
"chars": 735,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"70dp\"\n android:height=\"70dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_fail.xml",
"chars": 685,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"48dp\"\n android:height=\"48dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_gh.xml",
"chars": 3694,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_help.xml",
"chars": 542,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_json.xml",
"chars": 386,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"48dp\"\n android:height=\"48dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_launcher_foreground.xml",
"chars": 882,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"108dp\"\n android:height=\"108dp\"\n"
},
{
"path": "app/src/main/res/drawable/ic_licenses.xml",
"chars": 442,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n android:width=\"24dp\"\r\n android:height=\"24dp\"\r"
},
{
"path": "app/src/main/res/drawable/ic_pass.xml",
"chars": 640,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"48dp\"\n android:height=\"48dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_unknown.xml",
"chars": 1027,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"48dp\"\n android:height=\"48dp\"\n "
},
{
"path": "app/src/main/res/layout/activity_main.xml",
"chars": 7672,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/dialog_about.xml",
"chars": 3061,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/dialog_licenses.xml",
"chars": 445,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n "
},
{
"path": "app/src/main/res/layout/dialog_response.xml",
"chars": 835,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.core.widget.NestedScrollView\n android:id=\"@+id/scrollView\"\n andro"
},
{
"path": "app/src/main/res/layout/item_license.xml",
"chars": 1045,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout\r\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n "
},
{
"path": "app/src/main/res/menu/menu.xml",
"chars": 580,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"h"
},
{
"path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
"chars": 337,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
"chars": 337,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 612,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"black\">#000000</color>\n <color name=\"white\">#ffff"
},
{
"path": "app/src/main/res/values/ic_launcher_background.xml",
"chars": 120,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"ic_launcher_background\">#353937</color>\n</resources>"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 4935,
"preview": "<resources>\n <string name=\"app_name\" translatable=\"false\">Play Integrity API Checker</string>\n <string name=\"error"
},
{
"path": "app/src/main/res/values/themes.xml",
"chars": 1979,
"preview": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n <!-- Base application theme. -->\n <style name=\"Theme.P"
},
{
"path": "app/src/main/res/values-night/themes.xml",
"chars": 1478,
"preview": "<resources>\n <!-- Base application theme. -->\n <style name=\"Theme.PlayIntegrityAPIChecker\" parent=\"Theme.MaterialC"
},
{
"path": "app/src/main/res/xml/backup_rules.xml",
"chars": 478,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?><!--\n Sample backup rules file; uncomment and customize as necessary.\n See htt"
},
{
"path": "app/src/main/res/xml/data_extraction_rules.xml",
"chars": 551,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?><!--\n Sample data extraction rules file; uncomment and customize as necessary.\n "
},
{
"path": "build.gradle",
"chars": 301,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nplugins {\n id 'co"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 231,
"preview": "#Thu Jan 16 16:08:38 EET 2025\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://"
},
{
"path": "gradle.properties",
"chars": 1296,
"preview": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will ov"
},
{
"path": "gradlew",
"chars": 8739,
"preview": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "gradlew.bat",
"chars": 2872,
"preview": "@rem\n@rem Copyright 2015 the original author or authors.\n@rem\n@rem Licensed under the Apache License, Version 2.0 (the \""
},
{
"path": "settings.gradle",
"chars": 343,
"preview": "pluginManagement {\n repositories {\n gradlePluginPortal()\n google()\n mavenCentral()\n }\n}\ndepen"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the 1nikolas/play-integrity-checker-app GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 49 files (84.8 KB), approximately 23.2k tokens, and a symbol index with 47 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.