Compare package name function

i’m searching for a function (so i can stop apktool on my app) that i can add to my app if something change in the app it will stop working for example if he change the package name then i want the app to stop.

for exemple my package name is test.test.test22

" this.appVersion.getPackageName(); == test.test.test10*2+2">
dont do any thing

" this.appVersion.getPackageName(); !== test.test.test10*2+2">

close the app

pardon me for my lack of experience im just a beginner .

This can give you the package name: https://github.com/danmichaelo/cordova-plugin-appinfo

If your general idea works or makes sense, no idea.

You can’t stick that outside of a function.

I’d probably place it in app.component.ts in the platform.ready block.