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, 2022 in Others by Soham
• 9,710 points
985 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, 2022 by Rahul
• 9,680 points

Related Questions In Others

0 votes
1 answer

How can I scrape a excel file from a website and divide it in different parts?

Use Scrapy or beautifulsoup4 parsing data it's more convenient ...READ MORE

answered Jan 13, 2023 in Others by narikkadan
• 63,600 points
677 views
0 votes
1 answer

How can I open a URL in Android's web browser from my application?

ry this: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri ...READ MORE

answered Jun 14, 2022 in Others by polo
• 1,480 points
4,837 views
0 votes
1 answer

How can I convert excel to PDF by Libreoffice and keep all format from excel file?

"Times New Roman" typeface does not have ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,670 views
0 votes
1 answer

How can I copy from specific sheet in excel

You should use wb.Sheets("Name of sheet").Copy - ...READ MORE

answered Oct 29, 2022 in Others by narikkadan
• 63,600 points
504 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
745 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
1,028 views
0 votes
1 answer

Is it possible to run .APK/Android apps on iPad/iPhone devices?

It is not possible to run Android ...READ MORE

answered Sep 20, 2022 in IOS by Aditya
• 7,680 points
4,565 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, 2022 in Others by Rahul
• 9,680 points
880 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, 2022 in Others by Rahul
• 9,680 points
828 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP