Giter Site home page Giter Site logo

nsneruno / magisk_detector Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 156 KB

Flutter Support for integrating Magisk Detector for Android Application. Based from MagiskDetector.

License: Apache License 2.0

Kotlin 4.37% Dart 4.22% AIDL 0.06% Makefile 0.31% C 90.33% Java 0.71%
android android-library dart flutter magisk security c ndk flutter-library flutter-plugin root-detection root-detection-bypass

magisk_detector's Introduction

magisk_detector

Flutter Support for integrating Magisk Detector for Android Application. Based from MagiskDetector.

Warning

Currently Magisk has been updated further and the source I referenced to hardly has any updates, neither I have the time to research further for this project. Thank you for the understanding.

Features

This is a straight adaptation attempt at reproducing the logics from the original creator repository. Allows to perform a check on your Android device if it's currently using Magisk Root Bypassing module.

Getting started

Add to your project via pubspec.yaml

magisk_detector:
  git:
    url: https://github.com/nsNeruno/magisk_detector.git

Usage

Setup your Project

On your app's build.gradle file, add this line under android group, where you can see values like compileSdkVersion

android {
    compileSdkVersion 30
    // You need to have this version installed on your SDK Manager
    ndkVersion '25.0.8775105'
    // ...
}

Then on your AndroidManifest.xml (under android/app/src/main/), add this inside the tag:

<manifest ...>
    <!-- Add these 3 properties to your application tag -->
    <application ...
        android:extractNativeLibs="true"
        android:zygotePreloadName="lab.neruno.magisk_detector.AppZygote"
        tools:targetApi="q" >
        <!-- Your application manifest data here -->
    
        <!-- Add this to connect to Magisk Detector Remote Service -->
        <service
           android:name="lab.neruno.magisk_detector.RemoteService"
           android:isolatedProcess="true"
           android:useAppZygote="true" />
    </application>
</manifest>

Adding the Code

You can use it straight away by importing it first.

import 'package:magisk_detector/magisk_detector.dart';

APIs

// Future-then pattern
MagiskDetector.instance.detectMagisk().then(
  (isMagiskFound) {
    /// Do something  
  },
);
// or the async-await pattern
final isMagiskFound = await MagiskDetector.instance.detectMagisk();
if (isMagiskFound) {
  /// Do something
}

Known Issue

This API most likely doesn't work against latest DenyList feature of MagiskHide.

Additional information

Further references and tests are required. Feel free to raise an issue.

And big thanks to vvb2060 for showing the way.

magisk_detector's People

Contributors

nsneruno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

vaginessa

magisk_detector's Issues

Error When Run Example

I/flutter (19784): ----------------FIREBASE CRASHLYTICS----------------
I/flutter (19784): PlatformException(MAGISK_ERROR, Unable to determine SU state, null, null)
I/flutter (19784):
I/flutter (19784): #0 MagiskDetectorPlatform.haveSu (package:magisk_detector/src/platform.dart:58:5)
I/flutter (19784):
I/flutter (19784): #1 Future.wait. (dart:async/future.dart:522:21)
I/flutter (19784):
I/flutter (19784): #2 MagiskDetectorPlatform.detectMagisk. (package:magisk_detector/src/platform.dart:151:11)
I/flutter (19784):

Not able to launch the application.

D/FlutterLocationService(30279): Creating service.
D/FlutterLocationService(30279): Binding to location service.
W/libEGL (30279): EGLNativeWindowType 0x7c23847010 disconnect failed
I/ViewRootImpl@bca36dbMainActivity: dispatchDetachedFromWindow
D/InputTransport(30279): Input channel destroyed: '6108974', fd=93
I/Choreographer(30279): Skipped 37 frames! The application may be doing too much work on its main thread.
I/a.mysecurity_v(30279): Thread[6,tid=367,WaitingInMainSignalCatcherLoop,Thread*=0x7c2e880000,peer=0x138002d8,"Signal Catcher"]: reacting to signal 28
I/a.mysecurity_v(30279):
I/a.mysecurity_v(30279): SIGSAVEPRF profile save

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.