Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49229

Cordova Anti Tampering

$
0
0

@ng22792 wrote:

Has anyone implemented this plugin in their project?
I have implemented the plugin but and called this function:

window.cordova.plugins.AntiTampering.verify(
function (success) {
console.info(success);
// {“assets”: {“count”: x}} - where x is the number of assets checked
},
function (error) {
console.error(error);
// gives you the file on which tampering was detected
}
);

The problem is, the function goes in the success block but the count is 0, which means the plugin doesn’t actually scan any files. I want to know what’s wrong.

Mentioning the steps that I have followed:

Step One: Installation using cmd.
command was:
cordova plugin add cordova-plugin-antitampering --variable ENABLE_CORDOVA_CALLBACK=true --save

Step two: Invoke method in app.component.ts using this code:

constructor(){
this.checkTampering();
}

checkTampering( ) {
alert(“Inside Check Tampering”);
try {
alert("Inside Try: ");
window.cordova.plugins.AntiTampering.verify(
function (success) {
alert(JSON.stringify(success));
// {“assets”: {“count”: x}} - where x is the number of assets checked
},
function (error) {
alert(JSON.stringify(error));
// gives you the file on which tampering was detected
}
);

} catch (e) {
  alert("Caught some exception when implementing Integrity check: " + JSON.stringify(e));
}

}

Step 3 : Run it on the device using command: ionic cordova run android

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>