We open, modify and pack Android applications. We open, modify and pack Android applications How to disable the notification from the Play Store about the need to remove Lucky Patcher

As a rule, most programs and games have standard code when interacting with Google Market. However, the tool of the program is often very well protected from changes. In order not to get confused and not waste extra time, I found an excellent program Lucky Patcher, which I will use in more detail below.

The Lucky Patcher application scans the device for all the programs you have supplied. Next, there is a sorting on the possibility or impossibility of the patch, then the applications are shown where the patch is most useful and the information is displayed at the beginning of the list. Then you can apply this patch to the desired program. If successful, you get a fully registered application.

In later versions of Lucky Patcher, it is possible to block banners and annoying ads. It is recommended to backup the application before using the patch.

Instructions: how to use Lucky Patcher

  1. Install the program or game you need.
  2. Install Lucky Patcher itself.
  3. Launch Lucky Patcher, then press and hold the button on the app you want. Choose Lucky Market Google Patch (or "make licensed") - the top menu item.
  4. After successfully completing the process, you can play. By the way, it is worth recalling that the use of Lucky Patcher often allows, after application, to launch applications without connecting to the network, even if initially it was prohibited by the developer!

As you can see, in general, using Lucky Patcher is simple, but it doesn't hurt to know some details and action plans in certain situations.

Firstly, if it was not possible to find and remove the license automatically, you can try to do it manually.

When the manual mode is launched, Lucky Patcher will identify absolutely all objects similar to the license (keystroke control, color tables, resolution, etc.) In the list that appears, you will need to find the correct license key. This is done by a simple brute force: first, select the first object and press the "Patch" button, when the process is over, try to launch the application using "Launch".

Using the Lucky Patcher program is not difficult, you just need to go through the instructions several times and learn the basic features.

If you have not guessed correctly - i.e. failed, then click "Restore" - and everything will be returned to its original state without any problems. After that, we repeat the procedure with the next object, and so on - until we achieve success.

There is also such a concept as Custom patch - a specific patch for a particular application that can change anything. They are located in the / sdcard / Luckypatcher / folder - these are files with the .txt extension. To apply such a patch, you just need to download a text file, copy it to a folder. The next time you launch Lucky Patcher, the application will be marked in yellow and to apply the Custom Patch, you just need to click on "Patch for this program!"

Finally, I will mention the function Patch on reboot... The function is intended so that you can add a specific patch to the BootList. It is necessary when, for some reason, “Commit changes” does not work for you and you cannot save the position of the patch (the point is that the patch is trying to change the library). To prevent this from happening, you need to click "patch on reboot" and select a custom patch, thereby allowing your library to be patched every time the device is started. If this does not work, then you can add a patch for applications with ads and a removed license.


Last Survival War: Apocalypse is a top-down zombie shooter.

Survive in a harsh post-apocalyptic world, fight against thousands of mutant zombies, collect supplies and develop your base. Last Survival War is a new representative of the already hackneyed genre of "survival-action", in which the balance is shifted in favor of battles, rather than towards strategic elements. You can participate in fights alone or with a friend, survive in the PvE world or take part in PvP duels, and of course you can improve your character in every way.

What's new:

Added mod.


Mod Info:

  • Free crafting (crafting does not require resources);
  • All items are available for crafting, regardless of the current level;
  • Maximum attack and defense of the protagonist.
To install a modified version of the APK file, you must remove the previous (original) version. This deletes all your data (development level, save level and overall game progress).

Sometimes some applications on Android do not suit the user in some way. An example is annoying ads. And it also happens - everyone is good at the program, but only the translation in it is either crooked, or completely absent. Or, for example, the program is trial, but it is not possible to get the full version. How can the situation be changed?

Introduction

In this article we will talk about how to disassemble an APK package with an application, look at its internal structure, disassemble and decompile the bytecode, and also try to make a few changes to the application that can bring us one or another benefit.

To do all this on your own, you will need at least some basic knowledge of the Java language, in which Android applications are written, and the XML language, which is used everywhere in Android - from describing the application itself and its access rights to storing the strings that will be displayed on the screen. You will also need to be able to handle specialized console software.

So, what exactly is the APK package in which absolutely all the software for Android is distributed?

Decompiling applications

In this article, we worked only with disassembled application code, however, if you make more serious changes to large applications, it will be much more difficult to understand the smali code. Fortunately, we can dex the dex code into Java code that, although not original and not compiled back, is much easier to read and understand the logic of the application. To do this, we need two tools:

  • dex2jar - translator of Dalvik bytecode into JVM bytecode, on the basis of which we can get code in the Java language;
  • jd-gui is the decompiler itself that allows you to get readable Java code from the JVM bytecode. Alternatively, you can use Jad (www.varaneckas.com/jad); although it is quite old, in some cases it generates more readable code than Jd-gui.

They should be used like this. First, we run dex2jar, specifying the path to the apk package as an argument:

% dex2jar.sh mail.apk

As a result, the mail.jar Java package will appear in the current directory, which can already be opened in jd-gui to view the Java code.

Device APK-packages and their receipt

An Android app package is essentially a regular zip file that doesn't require any special tools to view and unzip its contents. It is enough to have an archiver - 7zip for Windows or console unzip for Linux. But that's about the wrapper. What's inside? Inside, we generally have the following structure:

  • META-INF / - contains a digital certificate of the application, confirming its creator, and checksums of the package files;
  • res / - various resources that the application uses in its work, for example, images, a declarative description of the interface, and other data;
  • AndroidManifest.xml - application description. This includes, for example, a list of required resolutions, required Android version and required screen resolution;
  • classes.dex - compiled application bytecode for the Dalvik virtual machine;
  • resources.arsc - also resources, but of a different kind - in particular, strings (yes, this file can be used for Russification!).

The listed files and directories are, if not in all, then perhaps in the vast majority of APKs. However, there are a few more not-so-common files / directories worth mentioning:

  • assets - analogue of resources. The main difference is that to access an asset, you need to know its identifier, while the list of assets can be obtained dynamically using the AssetManager.list () method in the application code;
  • lib - Native Linux libraries written with the NDK (Native Development Kit).

This directory is used by game makers to host a game engine written in C / C ++, as well as high-performance application makers (such as Google Chrome). The device was sorted out. But how do you get the actual package file of the application of interest? Since it is not possible to pick up APK files from the device without root (they are in the / data / app directory), and root is not always advisable, there are at least three ways to get the application file to the computer:

  • aPK Downloader extension for Chrome;
  • real APK Leecher application;
  • various file sharing and warezniki.

Which one to use is a matter of taste; we prefer to use separate applications, so we will describe the use of Real APK Leecher, especially since it is written in Java and, accordingly, will work even in Windows, even in nix.

After starting the program, you need to fill in three fields: Email, Password and Device ID - and select a language. The first two are the e-mail and password of your Google account that you use on your device. The third is the device identifier, and you can get it by dialing the code on the dialer # #8255## and then finding the line Device ID. When filling out, you only need to enter the ID without the android- prefix.

After filling and saving, the message "Error while connecting to server" often pops up. It has nothing to do with Google Play, so feel free to ignore it and look for packages that interest you.

View and modify

Let's say you found a package you are interested in, downloaded, unpacked ... and while trying to view some XML file, I was surprised to find that the file is not text. How to decompile it and how to work with packages in general? Is it really necessary to install the SDK? No, you don't have to install the SDK. In fact, all the steps to unpack, modify, and package APK packages require the following tools:

  • zIP archiver for unpacking and packing;
  • smali - assembler / disassembler bytecode of the Dalvik virtual machine (code.google.com/p/smali);
  • aapt - a tool for packing resources (by default, resources are stored in binary form to optimize application performance). Included with the Android SDK, but can be obtained separately;
  • signer - a tool for digitally signing a modified package (bit.ly/Rmrv4M).

You can use all these tools separately, but this is inconvenient, so it is better to use a higher-level software built on their basis. If you work on Linux or Mac OS X, there is a tool called apktool. It allows you to unpack resources in their original form (including binary XML and arsc files), rebuild a package with changed resources, but it cannot sign packages, so you will have to run the signer utility manually. Despite the fact that the utility is written in Java, its installation is rather non-standard. First you should get the jar file itself:

$ cd / tmp $ wget http://bit.ly/WC3OCz $ tar -xjf apktool1.5.1.tar.bz2

$ wget http://bit.ly/WRjEc7 $ tar -xjf apktool-install-linux-r05-ibot.tar.bz2

$ mv apktool.jar ~ / bin $ mv apktool-install-linux-r05-ibot / * ~ / bin $ export PATH \u003d ~ / bin: $ PATH

If you work in Windows, then there is an excellent tool for it called Virtual Ten Studio, which also accumulates all these tools (including apktool itself), but instead of the CLI interface provides the user with an intuitive graphical interface with which you can perform operations on unpacking, disassembling and decompilation in a few clicks. This tool is Donation-ware, that is, sometimes there are windows offering to obtain a license, but this, in the end, can be tolerated. It makes no sense to describe it, because you can understand the interface in a few minutes. But apktool, due to its console nature, should be discussed in more detail.


Let's take a look at the apktool options. In short, there are three main commands: d (decode), b (build), and if (install framework). If everything is clear with the first two commands, then what does the third, conditional operator do? It unpacks the specified UI framework, which is needed in cases when you dissect any system package.

Let's consider the most interesting options of the first command:

  • -s - do not disassemble dex files;
  • -r - do not unpack resources;
  • -b - do not insert debug information into the results of disassembling the dex file;
  • --frame-path - use the specified UI framework instead of the one built into apktool. Now let's look at a couple of options for the b command:
  • -f - forced assembly without checking changes;
  • -a - we specify the path to aapt (a tool for building an APK archive), if for some reason you want to use it from another source.

Using apktool is very simple, for this you just need to specify one of the commands and the path to the APK, for example:

$ apktool d mail.apk

After that, all the extracted and disassembled package files will appear in the mail directory.

Dissection. Disable ads

Theory is, of course, good, but why is it needed if we do not know what to do with the unpacked package? Let's try to apply the theory to our own benefit, namely, modify some software so that it does not show us ads. For example, let it be Virtual Torch - a virtual torch. For us, this software is perfect because it is stuffed to the eyeballs with annoying ads and, moreover, simple enough not to get lost in the jungle of code.


So, using one of the above methods, download the application from the market. If you decide to use Virtuous Ten Studio, just open the APK file in the application and unpack it, for which create a project (File -\u003e New project), then select Import File from the project context menu. If your choice fell on apktool, then just execute one command:

$ apktool d com.kauf.particle.virtualtorch.apk

After that, a file tree similar to the one described in the previous section will appear in the com.kauf.particle.virtualtorch directory, but with an additional smali directory instead of dex files and an apktool.yml file. The first contains the disassembled code of the executable dex-file of the application, the second contains the service information needed by apktool to build the package back.

The first place we should look is, of course, AndroidManifest.xml. And here we immediately meet the following line:

As you might guess, it is responsible for granting the application permission to use the Internet connection. In fact, if we just want to get rid of ads, we will most likely need to disable the Internet for the application. Let's try to do this. We delete the specified line and try to build the software using apktool:

$ apktool b com.kauf.particle.virtualtorch

The resulting APK file will appear in the com.kauf.particle.virtualtorch / build / directory. However, it will not be possible to install it, since it does not have a digital signature and file checksums (it simply does not have the META-INF / directory). We need to sign the package using the apk-signer utility. Launched. The interface consists of two tabs - on the first (Key Generator) we create keys, on the second (APK Signer) we sign. To create our private key, fill in the following fields:

  • Target File - the output file of the keystore; it usually contains one key pair;
  • Password and Confirm - password for storage;
  • Alias - the name of the key in the repository;
  • Alias \u200b\u200bpassword and Confirm - secret key password;
  • Validity - validity period (in years). The default is optimal.

The rest of the fields are generally optional - but at least one must be filled in.


WARNING

To sign an application using apk-signer, you must install the Android SDK and specify the full path to it in the application settings.

All information is provided for informational purposes only. Neither the editorial board nor the author is responsible for any possible harm caused by the materials of this article.

Now you can sign the APK with this key. On the APK Signer tab, select the newly generated file, enter the password, key alias and password to it, then find the APK file and boldly press the "Sign" button. If all goes well, the package will be signed.

INFO

Since we signed the package with our own key, it will conflict with the original application, which means that when we try to update the software through the market, we will receive an error.

A digital signature is required only for third-party software, so if you are modifying system applications that are installed by copying them to the / system / app / directory, then you do not need to sign them.

After that, we drop the package onto the smartphone, install and launch it. Voila, ads are gone! Instead, however, a message appeared that we do not have the Internet or do not have the appropriate permissions. In theory, this could be enough, but the message looks annoying, and, to be honest, we were just lucky with a dumb app. A normally written software will most likely clarify its authority or check the presence of an Internet connection and otherwise simply refuse to start. How to be in this case? Of course, edit the code.

Typically, application authors create special classes for displaying advertisements and call methods of these classes during application launch or one of its "activities" (to put it simply, application screens). Let's try to find these classes. We go to the smali directory, then com (org contains only the open graphics library cocos2d), then kauf (exactly there, because this is the developer's name and all his code is there) - and here it is, the marketing directory. Inside we find a bunch of files with the smali extension. These are classes, and the most notable of them is the Ad.smali class, by the name of which it is easy to guess what exactly it displays ads.

We could change the logic of its operation, but it would be much easier to remove calls to any of its methods from the application itself. Therefore, we exit the marketing directory and go to the adjacent particle directory, and then to virtualtorch. The MainActivity.smali file deserves special attention here. This is a standard Android class that is created by the Android SDK and set as the entry point to the application (analogous to the main function in C). Open the file for editing.

Inside is the smali code (local assembler). It is quite confusing and difficult to read due to its low-level nature, so we will not study it, but simply find all references to the Ad class in the code and comment them out. We drive in the line "Ad" in the search and find ourselves on line 25:

Field private ad: Lcom / kauf / marketing / Ad;

This creates an ad field to hold an object of class Ad. We comment by placing the ### sign in front of the line. We continue to search. Line 423:

New-instance v3, Lcom / kauf / marketing / Ad;

This is where the object is created. Commenting. We continue searching and find in lines 433, 435, 466, 468, 738, 740, 800 and 802 calls to the methods of the Ad class. Commenting. Look like that's it. We save. Now you need to put the package back together and check its performance and the presence of ads. For the purity of the experiment, we return the string deleted from AndroidManifest.xml, collect the package, sign and install.

Our guinea pig. Advertising visible

Oops! Advertising disappeared only while the application was running, but remained in the main menu, which we see when we launch the software. So, wait, but the entry point is the MainActivity class, and the ads disappeared while the application was running, but remained in the main menu, so the entry point is different? To identify the true entry point, reopen the AndroidManifest.xml file. And yes, it has the following lines:

They tell us (and more importantly, the android) that an activity named Start should be launched in response to the generation of the intent (event) android.intent.action.MAIN from the android.intent.category.LAUNCHER category. This event is generated when tapping on the application icon in the launcher, so it defines the entry point, namely the Start class. Most likely, the programmer first wrote an application without the main menu, the entry point to which was the standard MainActivity class, and then added a new window (activity) containing the menu and described in the Start class, and manually made it the entry point.

Open the Start.smali file and again look for the line "Ad", find in lines 153 and 155 the mention of the FirstAd class. It is also in the source code and, judging by the name, is precisely responsible for displaying ads on the main screen. We look further, there is a creation of an instance of the FirstAd class and an intent, according to the context related to this instance, and then the cond_10 label, the conditional transition to which is carried out exactly before creating an instance of the class:

If-ne p1, v0,: cond_10 .line 74 new-instance v0, Landroid / content / Intent; ...: cond_10

Most likely, the program somehow randomly calculates whether to show ads on the main screen, and, if not, jumps straight to cond_10. Ok, let's simplify her task and replace the conditional jump with an unconditional one:

# if-ne p1, v0,: cond_10 goto: cond_10

There are no more references to FirstAd in the code, so close the file and reassemble our virtual torch using apktool. Copy to smartphone, install, launch. Voila, all ads have disappeared, and congratulations to all of us.

Outcome

This article is just a short introduction to the techniques for cracking and modifying Android applications. Many issues remained behind the scenes, such as removing protection, parsing obfuscated code, translating and replacing application resources, as well as modifying applications written using the Android NDK. However, having basic knowledge, it is only a matter of time to understand all this.

Lucky Patcher is an app patcher that allows you to get additional features in Android games and applications, for example: you can turn off license verification, buy for free in in-app stores, and even block ads. As a nice addition, there are custom patches, they have a positive effect on the functionality of applications and open blocked opportunities.


The most requested functions and their applications are described below. If, after reading them, you could not cope with your problem - describe it in detail in the comments, we will advise and supplement the instructions for you :)


Most features require:

  • Installed

How to disable Play Store notification about the need to remove Lucky Patcher

As a rule, the Play Store app store detects Lucky Patcher as a virus, after which an unclosed message will appear in the notification curtain: "Remove the dangerous application, the Lucky Patcher application may disrupt the operation of the device." To get rid of this annoying notification, you need to do a few simple steps.


This instruction will be equally useful for those who want to get rid of the annoying message, and for those who cannot install Lucky Patcher on their device due to the Play Store.

Video instruction


  1. Open the Play Store - Click on the menu (upper left corner) - Select Play Protection - Uncheck the "Check security threats" item and click "OK".
  2. If you see a message in the notification line, as in the screenshot below, then you should erase all Play Store data, for which you should do the following: Go to Settings - Open Applications - In the list of installed applications, find Google Play Store and click on him - Select "Erase data" and then click "OK". The message will disappear and you can safely use Lucky Patcher.







Removing license check in applications

License check - by default, they are built into all paid games and applications, this check will find out whether you bought the application or not. If you try to install a paid game or program without a cut-out check, you will encounter an error, they say, download the application from the market. Lucky patcher is able to cut this check, thus you can easily install the desired application.


Blocking ads

Intrusive advertising in games and applications is very annoying, and sometimes it also interferes with the normal gameplay. In such situations, the only sure way is to block ads! Fortunately, the varnish patcher can remove ads (but there are also) several algorithms, and the instructions are below:

Video instruction

Free purchases in in-game stores

Lucky patcher works wonders, it will allow you to make free purchases in in-game stores, that is, you can get a lot of coins or even make them endless, buy all paid content in the game - for free!


Video instruction


Custom patches

Custom patches are extensions for an application or game, it can add new features to it or unlock closed / paid content.


How to build a modified version of the application

Video instruction

  1. In the context menu, select the "Patch menu" and then click on the "Create modified apk" item.
  2. We are invited to select the patch that we want to apply to our application (remove the license check, remove ads, make free purchases, or change the application components), you can select either one of the patches or several at once (it will be enough to click on the first line " Apk with multi-patch "and then check the boxes next to the desired items). After that, all that remains is to click on the "Rebuild application" button.
  3. When the apk file is compiled, you can open it and install it, or transfer it to your friend.

How to create a clone of an application (.apk)

The cloning function has recently appeared officially in the firmware of some Chinese developers. For example, in MIUI, after installing the application, you can make a full copy of it. Why is this needed? For example, by making a clone of the Sberbank Online application, you can use two cards, the same applies to online games where an account is created, or instant messengers and social networks. You no longer have to re-enter from one account to another a hundred times a day, you just need to make a clone of the application and log in to it.

Video instruction

  1. After you launch Lucky Patcher you need to find the application whose clone you would like to make and click on it.
  2. In the context menu that appears, select "Tools" and click on the "Clone application" item.
  3. In the next window, you do not need to change anything (there should be a check mark opposite the item "Change AndroidManifest.xml, resources and classes.dex"), just click on the "Rebuild application" button.
  4. After Lucky Patcher finishes creating a clone of our chosen application, you will need to install it. Click on the "Install clone" button, then click "Yes" and wait for the program to be installed.
  5. If successful (yes, it is not always possible to create a working clone) a second icon from the cloned application will appear on the desktop and you can run them together and use them simultaneously.

How to change app permissions

If you want to manually manage the permissions of installed applications on your device, namely: deny / allow Internet access, read data from an SD card, add applications to startup, make in-app purchases, check for a license and much more.

  1. Launch Lucky Patcher and find the application we need, then click on it.
  2. In the context menu, select the "Patch menu" and then click on the item "Change application components".
  3. In the next window, we need to select the 3rd item (Change permissions and activations while maintaining the original signature). According to the developers, this method is the safest.
  4. Now we can choose the permissions that will be left to the application and which we would like to disable, just tap on the necessary items and then click on the "Rebuild and install" button.

Backups

You can save the .apk file of the installed application, with all the changes and configurations made to it. In other words, Lucky Patcher can save .apk from applications installed from Google Play, as well as clone them, in case you need to run applications twice.


Now you know how to use Lucky Patcher! But if something didn't work out for you or if you have any questions - write in the comments to this page and we will help you :)

  • 1 July 2017
  • 49,133 views

Liked?

Ratings: 17