Free-RASP-Community icon indicating copy to clipboard operation
Free-RASP-Community copied to clipboard

Root detected on unrooted AVD system images

Open brycethorup opened this issue 3 years ago • 4 comments

I have added freeRASP to my app and I can confirm that root is detected on a rooted API 31 level system image using an android emulator. I can also confirm that android emulators using unrooted system images with API level 31 or higher do not get detected, as I would expect. The trouble is that any android emulator running an unrooted system image with API level 30 or lower (I've tested down to API level 27) always get detected as a rooted device.

Here is the main.dart I used for testing:

import 'package:flutter/material.dart';
import 'package:freerasp/talsec_app.dart';

void main() {
  runApp(const MyApp());
  initFreeRASP();
}

void initFreeRASP() {
  final callback = TalsecCallback(
    androidCallback: AndroidCallback(
      onRootDetected: () => print('ROOT DETECTED'),
    ),
    iosCallback: const IOSCallback(),
  );
  final app = TalsecApp(
    config: TalsecConfig(
      watcherMail: '[email protected]',
      androidConfig: AndroidConfig(
        expectedPackageName: 'abc',
        expectedSigningCertificateHash:
            'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE=',
      ),
      iosConfig: const IOSconfig(
        appBundleId: 'abc',
        appTeamId: 'abc123',
      ),
    ),
    callback: callback,
  );
  app.start();
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => Container();
}

Here are the android emulator configurations I have tested (all unrooted):

  • Pixel 5 API 30
  • Pixel 4a API 30
  • Pixel 3a XL API 29
  • Pixel 3 XL API 28
  • Pixel 3 XL API 27

brycethorup avatar Oct 25 '22 15:10 brycethorup