Lucky patcher how can I protect from it

0 votes

Despite this topic being a common area of interest and discussion among coders, there is yet a problem I’m coming across which I need assistance on. On using LVL with Obfuscation, the default LVL ALOT was changed by me in order to ensure that anti-LVL would not break it. However, Lucky Patcher breaks this with a single click. I even checked the new broken APK and yet, it just called it “allow method”. Is there anyone who can suggest a manner in which Lucky Patcher cannot break it. There are limitations but I do not want it to break for a one click software. 

Feb 8 in Others by Soham
• 8,730 points
48 views

1 answer to this question.

0 votes
public void checkSignature(final Context context) { 
try { 
      Signature[] signatures = context.getPackageManager().getPackageInfo(context.getPackageName(),     PackageManager.GET_SIGNATURES).signatures;
  if (signatures[0].toCharsString() != <YOUR CERTIFICATE STRING GOES HERE>) { 
// Kill the process without warning. If someone changed the certificate 
// is better not to give a hint about why the app stopped working android.os.Process.killProcess(android.os.Process.myPid()); 
} 
} 

catch (NameNotFoundException ex) { 
// Must never fail, so if it does, means someone played with the apk, so kill the process android.os.Process.killProcess(android.os.Process.myPid()); 
      }
}

Once this code is written, one needs to find out which one is their certificate. In order to do so, you must create or produce an APK in the release mode. This is because the release certificate is different from the debug certificate. Following which, please output your certificate into your Logcat:
 

signatures[0].toCharsString();

Always note, that once you go back to the debug mode, the certificate also changes and to avoid this, use the following line in order to ignore the verification process.
 

if ((context.getApplicationContext().getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE) != 0) return;

After this, in order to check the lucky patcher checker, one can decompile all the Lucky Patcher versions and the creator utilized the double package names between the releases. Please note, that you must be aware of the new versions and the addition of the including future package names.

private boolean checkLuckyPatcher() {
if (packageExists("com.dimonvideo.luckypatcher")) return true;

if (packageExists("com.chelpus.lackypatch")) return true; 

if (packageExists("com.android.vending.billing.InAppBillingService.LACK")) return true; return false;

} 

private boolean packageExists(final String packageName) { 
try { 
ApplicationInfo info = this.getPackageManager().getApplicationInfo(packageName, 0); 
if (info == null) { 
// No need really to test for null, if the package does not 
// exist it will really rise an exception. but in case Google 
// changes the API in the future lets be safe and test it 
return false;
}

    return true; 
} 
catch (Exception ex) { 
          // If we get here only means the Package does not exist 
} 
    return false; 
}
answered Feb 8 by Rahul
• 8,980 points

Related Questions In Others

0 votes
2 answers

What is white box testing and how is it different from black box testing?

Black Box Testing is a software testing method in ...READ MORE

answered Feb 20, 2019 in Others by preetiagarwal
• 170 points
695 views
0 votes
0 answers

How can i solve NoClassdeffoundError on my mobile?

Oct 15, 2019 in Others by SolomonTS
• 120 points
165 views
+2 votes
0 answers

how can i download and install setookit?

Nov 30, 2019 in Others by anonymous
• 140 points
483 views
0 votes
1 answer
0 votes
0 answers

how can I deploy a test in pytest framework to airflow using DAG?

I have established an automative testing framework ...READ MORE

Oct 4, 2021 in Others by Yuan
• 120 points
25 views
0 votes
1 answer

How Appium works in Andriod?

Appium is an open source test automation tool ...READ MORE

answered Jan 18, 2019 in Selenium by Frankie
• 9,830 points
248 views
0 votes
1 answer

Andriod app crash

Hello Abhishek! (If you have created the app) ...READ MORE

answered May 9, 2020 in Others by Anadya
162 views
0 votes
1 answer

How to open the Google Play Store directly from my Android application?

By using developer.andriod.com, one can solve this ...READ MORE

answered Feb 8 in Others by Rahul
• 8,980 points
9 views
0 votes
1 answer

How do I check out a remote Git branch?

The answer to your question has been ...READ MORE

answered Feb 10 in Others by Rahul
• 8,980 points
19 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP