Ionic4/5 Detect Rooted and Jailbreak Device

I’m trying to use this cordova plugin but always return undefined.

and followed their answers here : angular - How to restrict Ionic 2 application installation if device is rooted or jail broken? - Stack Overflow

any help will be much appreciated.

You cannot access Cordova plugin in a Capacitor project directly, like IRoot, without a native wrapper. Usually you need to find the plugin in the window object, Cordova RootBeer for example:

export class XTZService {
 window: any = window;
 constructor( ) {}

 someFunction() {

   window["cdvRootBeer"].isRootedWithoutBusyBoxCheck(function (res) {
     console.log("cdvRootBeer Rooted", res)
   }, function (err) {
     console.log("cdvRootBeer Error", err)

or for Honeywell plugin:

window['plugins'].honeywell.listen(function (data) {