Skip to content

Commit

Permalink
Merge pull request #4 from capacitor-community/development
Browse files Browse the repository at this point in the history
Added checks for OTA certs and version rise up to 6.0.1
  • Loading branch information
andreimuha-ionic authored Dec 18, 2024
2 parents cf8085c + e30bde4 commit 524aab4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class DeviceSecurityDetect {
public boolean isDeviceRooted() {
return checkBuildTags() || checkSuBinary() || isSuBinaryAvailable();
return checkBuildTags() || checkSuBinary() || isSuBinaryAvailable() || areOtaCertsMissing();
}

private boolean checkBuildTags() {
Expand All @@ -34,6 +34,11 @@ private boolean checkSuBinary() {
return false;
}

private boolean areOtaCertsMissing() {
final String OTA_CERTS_PATH = "/etc/security/otacerts.zip";
return !new File(OTA_CERTS_PATH).exists();
}

private boolean isSuBinaryAvailable() {
Process process = null;
try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor-community/device-security-detect",
"version": "6.0.0",
"version": "6.0.1",
"description": "The Device Security Detect plugin is designed to provide comprehensive device security detection capabilities for Capacitor-based applications. It aims to detect the device has been rooted (Android) or jailbroken (iOS). By using this plugin, developers can enhance the security of their applications and take appropriate actions based on the detected security status.",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit 524aab4

Please sign in to comment.