[GUIDE][IDEAS] Protecting your app from the main piracy circumvention methods

Search This thread

zelendel

Senior Member
Aug 11, 2008
23,360
20,609
OnePlus 6T
OnePlus 9
There is no argument that developers have the right to protect their work. But there are plenty of reasons to not spend time and effort on developing and testing anti-piracy solutions that will inevitably be cracked. The question really boils down to cost versus benefit. How much money are you really losing, and how valuable is your time? For some developers, investing in novel anti-piracy solutions is worth it. For others, it's time that could be better spent improving their app.


That is just one man's opinion. I personally don't think it's a great idea. The fact is, it's up to the individual developer to make that choice.


Deciding not to invest too much effort in protecting your app is ABSOLUTELY on topic, because it's another alternative. Many of the comments made in the discussion of this post (found here: http://www.xda-developers.com/android/preventing-app-piracy-join-the-discussion/) reiterate exactly what I said. I can only assume that my original response in this thread was removed for having a different opinion, which leads me to wonder what other legitimate comments have been censored because a moderator has a personal disagreement.


Most of them were removed do to being off topic which is [GUIDE][IDEAS] Protecting your app from the main piracy circumvention methods. And not doing anything is not an alternative. Also alot of the posts were people arguing back and forth. I respect everyone's opinion. Now I understand you are new here so I will let it slide. This once. XDA has a very strong stance on warez. We are against them all together. Posting warez, Posting how to crack apps, and such is a one way ticket out of here.
 

jpepin

Member
May 23, 2013
17
4
www.pepinonline.com
Most of them were removed do to being off topic which is [GUIDE][IDEAS] Protecting your app from the main piracy circumvention methods. And not doing anything is not an alternative.
While I disagree, I'll respect your decision.

Now I understand you are new here so I will let it slide. This once. XDA has a very strong stance on warez. We are against them all together. Posting warez, Posting how to crack apps, and such is a one way ticket out of here.
I think you may have my post confused with another. Not once did I ever mention warez or post how to crack apps, so I'm not sure what you're "letting slide." As a developer, I have great disdain for both of those topics, and completely agree with the XDA policy, regardless of the fact that I'm "new here."


To get back on topic...

For the OP (or any one else with insight): How much success have you seen through implementation of the methods you outlined? I think some actual empirical evidence woud help in deciding whether any of them (individually or combined) are actually worth the effort.
 
Last edited:

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,428
8,754
26
Salford, Greater Manchester, UK
quinny898.co.uk
While I disagree, I'll respect your decision.


I think you may have my post confused with another. Not once did I ever mention warez or post how to crack apps, so I'm not sure what you're "letting slide." As a developer, I have great disdain for both of those topics, and completely agree with the XDA policy, regardless of the fact that I'm "new here."


To get back on topic...

For the OP (or any one else with insight): How much success have you seen through implementation of the methods you outlined? I think some actual empirical evidence woud help in deciding whether any of them (individually or combined) are actually worth the effort.

It's dramatically decreased my refund rate of apps by introducing this after the licence verification, which made not much difference from none at all, unless that's just a total fluke

Sent from my GALAXY NEXUS using Tapatalk 4 (VIP)
 
  • Like
Reactions: LiquidSolstice

mateorod

Inactive Recognized Developer
Nov 16, 2011
1,981
3,503
New Orleans
www.gigmasters.com
I do not support piracy. And I will probably not return here to reengage the thread...for the most part I try and leave debate to others. So feel free to ignore.

But I am very surprised at the number of experienced developers that seem totally okay with force uninstalling packages from a users system, presumably without warning or documentation before hand.

A) I consider those to be the practices of malware.
B) I can almost guarantee you this violates the Play TOS, which bans interfering with other apps. Whether they would enforce them in this situation is another matter. The fact that Lucky Patcher also violates TOS is not lost on me...but two wrongs etc.etc.

I can support a developer disabling support for any system they choose, whether by hashing or LP detection...so be it. It is your program, you can provide or refuse service to whomever you choose.

But what is the difference between you modifying someone's system without their consent (sure...you will be under your declared permissions, I know. If you plan on running a process they did not ask for...that's without consent in my book) and their attempts to undermine your license checks? They are both economics by way of force...I think there could be a better way.
 
  • Like
Reactions: CrashTestDroid
Jun 6, 2013
39
5
The best way is to stop sideloading itself. Google needs to block the manual apk installer , which would dramatically decrease piracy.

If you are a developer and want to test your own app, use adb. Simple.

Non play store apps banned.

:)
 

nikwen

Senior Member
Feb 1, 2013
3,142
1,597
Berlin, Germany
www.nikwen.de
The best way is to stop sideloading itself. Google needs to block the manual apk installer , which would dramatically decrease piracy.

If you are a developer and want to test your own app, use adb. Simple.

Non play store apps banned.

:)

I do not think that this is a good idea!

Android is open and we do not want Google to be as bossy as Apple is. That is one of the main ideas of Linux and therefore Android: Freedom!
I understand that this is a bad side-effect. However, I (as a dev) rather take this than a company restricting our OS.
Even if they did, ROM developers would remove this limitation.

I download from Google Play most times and do not think much of piracy, but I want free software to be free. That is why I dislike your idea.
 

m11kkaa

Recognized Dev / Inactive Recognized Contributor
Jan 20, 2011
1,259
2,147
The best way is to stop sideloading itself. Google needs to block the manual apk installer , which would dramatically decrease piracy.

If you are a developer and want to test your own app, use adb. Simple.

Non play store apps banned.

:)

Aside the fact that this would be completely against the sense of open source this would be totally useless because it wouldn't take much time to (re-)enable side loading apps.

You can compare this with windows. What would you think if you couldn't install your own Software you downloaded from the internet? Only installing things from the new Metro AppStore would be possible.
 
Last edited:
Jun 6, 2013
39
5
I don't think most users know about custom Roms.

As for testing is concerned ....u SHOULD know about adb already.
 
Last edited:

lambstone

Senior Member
Mar 27, 2008
1,695
300
Huawei P20 Pro
Redmi K20 Pro
Meh. Using root tools as an anti piracy measure?

I'm sure all of us abhor piracy whether it's genuinely so or simply pretence but deleting offending apps on the user's phone?

This should not be the way to go. This is dangerously close to malicious activity. If a prompt to uninstall the offending app instead of forcibly removing it, it might be acceptable.
But a forced uninstall? Doesn't this sound like malware?

I for one would delete any app that ask for root permissions if it's not supposed to. For example, if an app titled "AWESOME ICON SETS" asked me for root permissions, it raises red flags. I'll uninstall that app immediately and report it to google for suspicious activity.
 
Last edited:
  • Like
Reactions: Shahnewaz

ts1506

Inactive Recognized Developer
Sep 1, 2012
3,365
4,504
Kolkata
Personally, I think usage of a method to detect if the app itself has been patched or not, instead of detecting Lucky Patcher/something like that is a better approach.

Maybe, if possible (I have no idea), you could verify the app license with a separate server everytime the app opens ?

Sorry if I dont make sense, as I dont really have much idea about app development.

Lastly, I use Play Store and F-Droid to get my apps, and for the most part, it has served me just fine. I cannot buy apps, since my card is not accepted in Play Store, but in the end, there are always alternative free apps, which IMHO is better than pirating a paid app.
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,428
8,754
26
Salford, Greater Manchester, UK
quinny898.co.uk
Personally, I think usage of a method to detect if the app itself has been patched or not, instead of detecting Lucky Patcher/something like that is a better approach.

Maybe, if possible (I have no idea), you could verify the app license with a separate server everytime the app opens ?

Sorry if I dont make sense, as I dont really have much idea about app development.

Lastly, I use Play Store and F-Droid to get my apps, and for the most part, it has served me just fine. I cannot buy apps, since my card is not accepted in Play Store, but in the end, there are always alternative free apps, which IMHO is better than pirating a paid app.
I suspect there's a way to verify the signature hash, that might be why it tells you it when exporting, which would solve a lot of issues. However, Lucky Patcher does not have to patch the APK, it can use odex files, and you'd need more than that

EDIT: Sure enough: http://android-know-how-to.blogspot.co.uk/2013/08/android-apk-signature-check.html
 
  • Like
Reactions: ts1506

ts1506

Inactive Recognized Developer
Sep 1, 2012
3,365
4,504
Kolkata
I suspect there's a way to verify the signature hash, that might be why it tells you it when exporting, which would solve a lot of issues. However, Lucky Patcher does not have to patch the APK, it can use odex files, and you'd need more than that

EDIT: Sure enough: http://android-know-how-to.blogspot.co.uk/2013/08/android-apk-signature-check.html

Hmm, lets see. It was a nice read.

I am hoping that Google Play starts Operator billing though. I came from Symbian, and there, you could buy apps using your mobile bill/balance. It was a really good thing for people like me without working cards.

I know lots of people in my school using pirated apps/games, tried convincing many to buy apps and support the devs, but they just turn a blind eye. Ultimately, you can do only so much to prevent piracy. People need to change their mindset too.
 

m11kkaa

Recognized Dev / Inactive Recognized Contributor
Jan 20, 2011
1,259
2,147
in times of the xposed framework it is very hard if not impossible to protect ur app against changes.
It's a hard truth but u should really try to use ur hackers for advertising instead of blocking them.
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,428
8,754
26
Salford, Greater Manchester, UK
quinny898.co.uk
Hmm, lets see. It was a nice read.

I am hoping that Google Play starts Operator billing though. I came from Symbian, and there, you could buy apps using your mobile bill/balance. It was a really good thing for people like me without working cards.

I know lots of people in my school using pirated apps/games, tried convincing many to buy apps and support the devs, but they just turn a blind eye. Ultimately, you can do only so much to prevent piracy. People need to change their mindset too.
You can in some places, I think another thing they need to allow is alternative methods of IAPs. I know people who would happily buy with PayPal but if it means setting up Wallet and adding a card, nope. That and you can easily add support for mobile payments there
 

TheBasterd

Senior Member
Jan 10, 2014
240
59
Hell
Thanks a lot. Needed this.

As far as ad removal is concerned, there are two options we have : 1)AdAway 2)Ad-Block Add-on
Both are free, open source and do their jobs real good.

As far as piracy is concerned, for people who don't know how to much work is put into app making, go to the google developer section on the official android website and see the amount of code required to make just a simple app with a textbox and a button, to print on the screen any text that you entered. Blew by brain clean off, I thought I could learn android in a day(like HTML5/CSS), but I guess it will take some weeks now.

So, again, really helpful code, thanks for sharing. I will implement it for sure.
 

giuliomvr

Senior Member
May 16, 2013
189
235
Cologne
in times of the xposed framework it is very hard if not impossible to protect ur app against changes.
It's a hard truth but u should really try to use ur hackers for advertising instead of blocking them.

But for this, you need to have SOME kind of developing skill. And if you obfuscate your app, they need to dig through your whole code. I think the best idea, If you are using in app purchases is the following: Before starting the purchase, check whether freedom is installed(or running) and show a dialog telling that piracy is bad for the developer, then offering the function to either uninstall the app(and pay) or proceed(possibly cracking it). From my point of view thats a pretty good idea, as there are countries where you can't pay in the play store.
 

m11kkaa

Recognized Dev / Inactive Recognized Contributor
Jan 20, 2011
1,259
2,147
But for this, you need to have SOME kind of developing skill. And if you obfuscate your app, they need to dig through your whole code. I think the best idea, If you are using in app purchases is the following: Before starting the purchase, check whether freedom is installed(or running) and show a dialog telling that piracy is bad for the developer, then offering the function to either uninstall the app(and pay) or proceed(possibly cracking it). From my point of view thats a pretty good idea, as there are countries where you can't pay in the play store.

for developers it doesn't matter if he uses xposed or if he decompiles your app. he'll always have to work with your obfuscated code.
The difference is that with xposed you can't prevent these hacks anymore.
And the devs are very good and obfuscation doesn't irritate them. Look at the GEL launcher xposed module or at all the assembly hackers who are hacking bootloaders etc. And believe me: it's not that hard.

All that desn't mean that you should remove all protection from your app. But just don't invest too much time into it.
It's faster to crack apps then developing the security protections.
 

giuliomvr

Senior Member
May 16, 2013
189
235
Cologne
for developers it doesn't matter if he uses xposed or if he decompiles your app. he'll always have to work with your obfuscated code.
The difference is that with xposed you can't prevent these hacks anymore.
And the devs are very good and obfuscation doesn't irritate them. Look at the GEL launcher xposed module or at all the assembly hackers who are hacking bootloaders etc. And believe me: it's not that hard.

All that desn't mean that you should remove all protection from your app. But just don't invest too much time into it.
It's faster to crack apps then developing the security protections.

But there are not that many developers in comparison to the people that would crack it with lp or freedom. And i think that the devs understand it better, as they encounter the issue as well. Of course, you only need to findAndHook the method in the most cases, but xposed isn't fully documented, which makes it harder to learn.

Gesendet von meinem SM-N9005 mit Tapatalk
 

m11kkaa

Recognized Dev / Inactive Recognized Contributor
Jan 20, 2011
1,259
2,147
But there are not that many developers in comparison to the people that would crack it with lp or freedom. And i think that the devs understand it better, as they encounter the issue as well. Of course, you only need to findAndHook the method in the most cases, but xposed isn't fully documented, which makes it harder to learn.

Gesendet von meinem SM-N9005 mit Tapatalk

that would be worth further research because personally I think xposed is pretty good documented and easy to learn.
The question is how the target group thinks about this.
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,428
8,754
26
Salford, Greater Manchester, UK
quinny898.co.uk
that would be worth further research because personally I think xposed is pretty good documented and easy to learn.
The question is how the target group thinks about this.
The thing is, this isn't really targeting the Xposed usergroup.
What this prevents is people who don't want to buy x, so just google "x apk". They won't be rooted, so unless someone has decompiled and smali hacked or lucky patched the app, they'll give up. Some will then buy, some won't.
If they are rooted, chances are they will search more anyway
 
  • Like
Reactions: m11kkaa

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    Wow, some of you guys...

    God forbid a developer expect that you compensate him/her for hard work on an application.

    If it's worth it for you to go through the trouble of getting outside of the Play Store, cracking it, and sideloading it, clearly it's worth it to you enough to actually pay for it.

    As usual with so many Android users, the self-entitlement complex is through the goddamn roof. I get it, being on a forum where you get such amazing aftermarket firmwares and modifications at no cost to you has really gone to your head; it makes you believe that all things Android should be cheap and free but that's really not how it works.

    I don't buy the "I use Lucky Patcher to block ads" BS. If you want to block ads, there's a million different ways you can use a hosts file or an app that manages the host file to do that (especially if you're concerned with traffic, that's the ideal solution).

    I get the criticism with the idea of removing another app, but I don't buy for even one second that anyone thinks they are justified in pirating the app; this is the mentality that spreads and becomes a huge problem. Many of you just don't see anything wrong in circumventing a payment/compensation system, citing all sorts of reasons that range from potentially/weakly relevant to stupidly shameless.

    3 years ago when I first got my HTC Hero, I pirated an app called Slide Screen because it looked really cool but I didn't want to pay for it. On the forum where I got the apk, there was a post from the developer of the app pleading with people to consider actually buying the app because he had put in a ton of effort in to it and was just trying to earn back a little extra income from all his research and self-taught Java lessons.

    After that, I completely stopped using pirated apps because I understood; the Play Store is a vicious cesspool that is FULL to the brim of absolute utter crap, especially the "My First Android App"-type applications. It's very hard to gain exposure and with reverse engineering, it's even harder to maintain a unique app because of how easy it is to just turn around and modify someone else's apk and then resell it. It doesn't help that (and this only seems to happen with Android users) Android users are incredibly ignorant of the platform and downrate an *free* app for not having an extravagantly complex addition as though they are entitled to it.

    Many of you spend between $300 and $600 on these devices, and many of you pay $50+ a month for a plan to go with them. Is it really so much for you to consider to spend what many call "a cheap fastfood lunch" on an app that you enjoy using, find useful, and get lifetime updates for?


    Sadly, XDA users of today are completely unaware of what the "free" in "Freedom of linux" means. Gratis != libre. The freedom that linux brings to the masses is not as in free beer but free speech.

    You all need to check your self-entitlement complex, it's clearly outgrown your sense of morality and logic.
    23
    There's a few easy methods anyone could use to crack the protection of your app that you worked very hard on, and in the same way there's methods to stop this from happening as well

    The first one, the big one, there's the app "Lucky Patcher". What this app does is patches the dalvik files to tell the app that it's activated, even if the Play Store disagrees. There's two ways of protecting from this:

    Implement a simple piece of code to check if Lucky Patcher is installed, and if it is, force the user to uninstall it (But by then it might be too late!)
    Here's a sample piece of code that stops the user from opening the app if Lucky Patcher is installed and prompts them to uninstall it
    Code:
    public void checkLP(){
        android.content.pm.PackageManager mPm = getPackageManager();
        try {
            PackageInfo info = mPm.getPackageInfo("com.chelpus.lackypatch", 0);
            if(info != null){
                AlertDialog.Builder ad3 = new AlertDialog.Builder(this);
    
                ad3.setCancelable(false);
                ad3.setTitle("Lucky Patcher");
                ad3.setMessage("I have detected the presense of the app 'Lucky Patcher', which could be used maliciously within this app. You need to uninstall it to continue");
                ad3.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    
                    [user=439709]@override[/user]
                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        startActivity(new Intent(MainActivity.this, LpUninstallActivity.class));
                        finish();
                }});
                
                AlertDialog alertDialog3 = ad3.create();
                alertDialog3.show();
            }
        } catch (NameNotFoundException e) {
            // TODO Auto-generated catch block
            return;
        }
        
    }

    Once you've implemented this code, call checkLP(); in your code where you need it, and add a UninstallLpActivity.class to respond to the user pressing OK, which uninstalls it (automatically if you have root, manually if you don't) and then returns the user to the main activity, at which point it checks again

    However, this will not always work. What happens if the user patches it and then uninstalls Lucky Patcher? What then? What about if they patched the apk itself?

    That's where method 2 comes in.

    For method 2, the alternative is to download an unpatched version of your app from the internet and install it on top, either automatically if you have root (Which is recommended where possible) or manually, which could lead to you hitting issues with signatures

    I don't have the code for this one, but the best way is with RootTools to call a download normally and then use "pm install -r" to overwrite it. Note that Lucky Patcher also has a method that adds ODEX files to /data/app/ which you will want to remove also



    But I don't have a paid version, only IAPs and people are using Freedom! :crying:
    Freedom is a complex app that circumvents the Play Store and makes the app think it's been bought when it hasn't. There's two very similar and simple ways to stop Freedom working though, both of which need root (which is fine, because Freedom needs root anyway)

    1.) Just stop freedom, kill its service and hopefully stop it from working
    Again, I recommend RootTools to make this easier.
    When your activity with IAPs starts, call a command that runs the following:
    Code:
    pkill cc.cz.madkite.freedom
    This will stop the freedom app from running and hopefully stop the user from using it to crack purchases

    2.) The better, more permanent method, forcibly uninstall freedom
    Again, I recommend RootTools to make this easier.
    In your class with IAPs, add the following code:
    Code:
    public void checkFreedom(){
        android.content.pm.PackageManager mPm = getPackageManager();
        try {
            PackageInfo info = mPm.getPackageInfo("cc.cz.madkite.freedom", 0);
            if(info != null){
                AlertDialog.Builder ad3 = new AlertDialog.Builder(this);
    
                ad3.setCancelable(false);
                ad3.setTitle("Freedom");
                ad3.setMessage("I have detected the presense of the app 'Freedom', which could be used maliciously within this section of the app. You need to uninstall it to continue");
                ad3.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    
                    [user=439709]@override[/user]
                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        startActivity(new Intent(IapActivity.this, FreedomUninstallActivity.class));
                        finish();
                }});
                
                AlertDialog alertDialog3 = ad3.create();
                alertDialog3.show();
            }
        } catch (NameNotFoundException e) {
            // TODO Auto-generated catch block
            return;
        }
        
    }
    And then call it where you want to with checkFreedom();
    Similar to the Lucky Patcher one, you need a second class that uninstalls it. Mine is as simple as follows:

    Code:
    import java.io.IOException;
    import java.util.concurrent.TimeoutException;
    
    import android.app.Activity;
    import android.app.ProgressDialog;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuInflater;
    import android.view.MenuItem;
    import android.view.View;
    import android.widget.CheckBox;
    import android.widget.Toast;
    
    import com.stericson.RootTools.*;
    import com.stericson.RootTools.exceptions.RootDeniedException;
    import com.stericson.RootTools.execution.CommandCapture;
    
    public class FreedomUninstallActivity extends Activity{
    CheckBox RootCheckBox;
    CheckBox BusyboxCheckBox; 
    
    
        [user=439709]@override[/user]
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            ProgressDialog dialog =
            ProgressDialog.show(FreedomUninstallActivity.this, "", "Uninstalling Freedom...", true);
            dialog.setCancelable(false);
            dialog.show();
            dialog.setMessage("Uninstalling Freedom..."); 
            CommandCapture command = new CommandCapture(0, "pm uninstall cc.cz.madkite.freedom");
            
    
            try {
                RootTools.getShell(true).add(command).waitForFinish();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (TimeoutException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (RootDeniedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            
            
            startActivity(new Intent(this, IapActivity.class));
            finish();
            
            
        }
        
    
    }
    This uses root to uninstall it, which is easiest because the user cannot press cancel, then loops back around to check again to make sure it worked

    Finally, and most importantly, obfuscate.
    Even the biggest pirates I've seen haven't ever tried to crack apps that use other methods and are obfuscated. Therefore, best practice where possible is to obfuscate, or even just run it from a remote server on a secure connection. ProGuard instructions are available here

    Help! They still get past it
    Use the good old methods of reporting then, try and keep the amount of people who are able to download it illegitimately to a minimum

    Further ideas:
    Improve the reinstall because of Lucky Patcher by just re-building the dex file - Looking into it

    Further reading:
    Android Developers site on best practices for in app billing
    10

    I use Lucky Patcher. To get rid of the ADVERTISEMENTS, not to remove the licensing service. YOU EVER thought of that?



    if i see one of your apps, i'll uninstall it and rate it badly. Why are you on a forum that offers you to root your phone, etc? And you want to restrict this freedom?






    If you want this crap, buy an IPHONE OR A WINDOWS Phone and develop for it.



    You ever heard of ethics? I've never seen much worse ethics for programming.


    you do not have to care about other apps on a system.

    Isn't Freedom what linux is about.?



    *for all devs who want to use OP's "solution".

    ---------- Post added at 06:36 PM ---------- Previous post was at 06:28 PM ----------



    Same here.
    If you have root, use a system wide thing, don't support an app that incorporates piracy methods

    And "why are you on a forum which allows freedom"
    Read the goddamn rules, we don't allow that kind of stuff, it's warez and illegal

    Also, I don't think you understand what I'm doing by uninstalling it here. I'm protecting my rights, not 'uninstalling a competitor' as you compare it to.

    Meanwhile, I'm about to have a mod clean out this thread, including this post
    5
    Ok guys CALM down. Now I know this is a heated subject it is plain and simple. If you cant buy the app then dont. It doesnt matter what the reason is, Developers have the right to protect themselves and their apps. While I agree it will never be stopped why not make it a huge PITA for it to be cracked?


    I agree with the OP. More Developers should add things like this and the LP remover is a great idea. If you dont like it then too bad. Feel free not to use it.

    Now Get this thread back on topic and that is idea to help protect their apps.
    3
    If your app is a game and it's completely native(unity3d, cocos2dx,...) you could do the following:
    1) do license checks from within native code(.so file)
    2) check signature of apk file from within native code and kill app if it's not valid
    3) sign your native libraries and do self checks before execution to prevent people from editing asm code.