What is the APK file extension? How to open APK? File with extension apk.

You can encounter an APK extension file, for example, if you decide to install an application on your computer that you used on your tablet. After downloading a file from the Internet, the time will come to think about how to open the apk file on your computer?

What is a fileAPKand its purpose

APK (abbreviation for Android Package) is a format of archived application files for Android. Any application written for Android, after compilation, is packaged into one file of this extension. The file name can be anything, but the extension must be .APK.

Encryption is not used when storing data in the archive of this type.

Thus, each .apk file is an archive that can be executed by DalvikVM (virtual machine) and can be installed not only on Android OS.

APK files are stored in the system in the /data/app directory, which is accessible only through Explorer.

To develop your own applications, you can use Google's Android SDK, a development environment.

You can download files of this extension either from where they are stored, or on third-party resources on the Internet (which is undesirable). Once downloaded, you can manually install the application contained in the apk file on your tablet or smartphone. It is not recommended to install applications from unknown sources - they may contain malicious code, while all applications available through Google Play are tested and signed. The procedure for installing the Android APK application on a tablet or smartphone via USB is described below:

  1. You need to copy the .APK file to the device in any convenient way (via USB, transfer via Wi-Fi, etc.);
  2. Using the file manager, go to the directory where the application was saved;
  3. Open the selected apk file.

A number of manufacturers disable the ability to install applications from unknown sources. If you need to enable this feature, go to Settings. Select the “Security” section, check the “Allow installation of applications not obtained from the Market” option.

Video tutorial on APK file format

View file contentsAPK

Wondering which program to open an apk file to see what's inside?

Since .APK files use compression algorithms similar to ZIP, the contents of such archives can be obtained using almost any archiver - .

To view the contents of a file using one of the specified archivers, you need to change the APK extension to ZIP.

File installationAPKon computer

Are you wondering how to open an apk file on your computer? Below is a list that will help you with the installation - it will show you how to open the arc file under any required operating system.

So, how to open APK files under different platforms:


Where else can you encounter files?APK?

Files of this extension can be used by other applications and services discussed below.

  1. As a file for the GameSpy arcade game service. This extension is used in a shareware MMO game. The utility, which allows players to find available multiplayer games, connect to them, and communicate between players, uses APK extension files that store service data.
  2. Storage of Active Tutor projects - an environment that provides tools for multimedia development (Creator - 4C Soft Inc.).
  3. Activity data storage. APK files are also used in the train simulation game (Microsoft Train Simulator), released back in 2001.

So, we looked at the APK file format - what is it used for, what program to open the arc file, where else can you use files of this extension. We hope the information will be useful to readers.

APK. How to open it?

If you don’t know what kind of format this is - APK and how it can be opened on a computer or phone, then read the text of the article. We will talk in detail about its features, methods for working and modifying its individual elements.

What is an APK?

Read also:[Instructions] How to recover deleted files on Android: Programs for phone and PC

Android Package Kit (APK) is an executable file format for the operating system. It is an archive containing the application's source data (program code, compiled resource files, settings, assets, libraries).

Peculiarities:

  • Cannot be converted to another format.
  • Archived using JAR-based compression feature.
  • It is a subset of the ZIP format.
  • Can be changed using Google Android SDK, Eclipse with ADT plugin.
  • Files from the APK archive are not encrypted.

Files with the APK extension are stored in Google Play and other application stores for Android devices. They are unpacked and installed automatically, without the use of additional software. The data is stored in the root folder at /data/app. You can only access them through Explorer.

To develop Android applications with an APK extension, Google's Android SDK is used. It is available for free download from the official website and is Java-based.

How to open on your phone

Read also: RAR for Android: How to use the archiver on mobile

How to open an APK file on your phone

If a mobile application for the Android platform is downloaded from a third-party resource or computer, then it will have an apk extension. Then you can install it on your phone manually.

How to open apk file from phone:

After this, the application will begin unpacking. Review the terms, grant access to features if necessary, and continue with the installation.

APK format

If you can’t copy the APK package via USB, then send it via Bluetooth or e-mail. Or separately connect a mini SD card to your computer using an adapter and transfer the file to it.

Error when opening

Read also: TOP 10 File managers for Android: choosing the best one for yourself | Review of English and Russian versions

How to allow installation from unknown sources

If, after copying the APK file to the device, it cannot be launched, then most likely the ability to install via was disabled by the manufacturer.

Follow these steps to enable it:

  • Go to the Settings menu and find the Personal Information category here.
  • Select “Security” and check the box next to it "Unknown sources (allow installation from unknown sources)".
  • Launch the APK file and continue with the installation.

If an error appears, then in the same menu uncheck the box next to "Check applications". Then Android will not prohibit installations that could harm the device. Use this method only if you are sure that the APK file you are installing is safe.

other methods

Read also: TOP 15 Best free antiviruses for Android gadgets in 2019

If you want to view the contents of the APK file from your phone, you can use the mobile version or special software for this.

Let's look at the most popular programs that allow you to edit apk packages:

  • APK Editor

APK Editor program interface

Works both with packages and those already installed on the device, . Allows you to change individual manifests, edit resources, replace files. It features a convenient graphical interface and Cyrillic support.

  • DroidEdit Free

DroidEdit Free program interface

Free mobile app for creating and editing individual manifests. You won’t be able to open the APK itself using it, but changing individual elements (after unpacking) is no problem.

  • SmartAPKTool

SmartAPKTool interface

Allows you to sign files in APK, ZIP formats. Unpack and package APK. Suitable for pre-editing applications. SmartAPKTool may require additional software (ApkTool, Java virtual machine) to operate.

After this, you will be able to change existing lines of code and notifications. In some applications, you can add additional actions or remove existing ones (for example, displaying ads). Please note that after this it will be different from the original one, so you will no longer be able to update it via Google Play.

How to extract APK

Read also: How to remove a virus from Android on your phone: Instructions 2019

APK Extractor Interface

If you need to get the APK of an application already installed on your phone, you can do this using special software. There are several free programs on the Play Market, but we will use APK Extractor for this purpose.

The procedure will be as follows:

How to extract apk using APK Extractor

How to open on a computer

Read also:[Instructions] How to transfer an application to the memory card of an Android smartphone: 4 easy ways | 2019

APK files

You can unzip the APK file to view or edit the contents using a regular archiver. However, you will not be able to install or launch the application. For this you need special software.

How to open APK on different operating systems:

  • Windows - 7-Zip, WinRAR.
  • Linux - 7-Zip, unzip.
  • MacOS - Archive Utility.

If, when installing the archiver, extensions were not configured (which will be associated by default), then the program may not recognize the apk file. Then it will be of an “unknown” format.

To open, click on it with the mouse and select the desired software from the list of suggested programs. After this, you will have access to all the original application data.

Emulators for running APK files on PC

Read also: Installing Android on PC: TOP 10 Emulators on Windows

If you want to install it on your computer, the file will have an APK extension. To install it, you will need a special emulator. They are available for free download.

BlueStacks interface

It has good performance in games and allows you to run resource-intensive applications. The main feature is the Bluestacks TV feature. Needed for online broadcasts on .

Using an emulator, you can launch mobile applications through apk packages or install them directly from the Play Market. To use Google services, you will need to log in with an account.

To launch the apk packages themselves, it is not necessary to connect an account. But if a game or program requires linking to a social network or other services, then you will need to log in or go through a simple registration.

Not even all owners of devices with the Android operating system know what an APK file is. What can we say about those who have never used phones or tablets with this system. However, even owners of Windows computers can get a lot of useful things out of APK files.

First, let's understand what files are.

Android Package is a file extension that is used to distribute programs for any device on which Android is installed. In Windows, to install the program you need to find the .exe file. In Android, you need to find an APK for this. Such files are distributed through sites with software for phones or on special forums.

Android Package is an archive that stores the application itself and all the files necessary for its operation. .

Why are they needed and why can they be useful to owners of simple computers?

Many interesting and unusual applications have already been written for devices with Android OS. Most of them do not have a desktop version. In this case, if you want to play your favorite game on your phone, but you don’t have it at hand, you will need to install the APK file on your computer.

Another situation where you might need to open an APK on your computer is to view its contents. This may be necessary to partially change it. For example, translate it into the desired language.

Important! The files we are interested in do not have any additional encryption. An APK file is nothing more than an archive in which application data is stored.

View content

Now we will learn how to view the contents of a file, look at its structure and, if necessary, make changes to it. So we need:


You can also unpack this archive to your computer and access it at any time.

But most are still interested in how to start using applications on their computer. This will be a little more difficult to do, but still quite simple. Everyone can do this.

A telephone is also a small computer. The only difference is the fundamentally different software. Therefore, you will need to install a special program - emulator

As the name implies, such a program creates a system running Android on your device. You will be able to download, install any applications on the emulator and use them directly through your computer.

Android emulators are becoming more and more popular and in demand due to the growing number of unique applications. Now several developers can offer a high-quality and stable emulator. Let's look at several emulators and choose the one most suitable for your tasks.

The most famous, widespread and used emulator is Bluestacks.

To begin with, we will open our file on it.


Important! Bluestacks is ideal for opening games, and is most often used for this. The disadvantages of the application include an overly cluttered interface in some places and a large amount of unnecessary information, which will not be useful to everyone.

Nox App Player

But this program is poorly suited for games. They often display graphic elements incorrectly. In this emulator, the developers focused on working with programs. You can get root in a couple of clicks. If you want to open the APK with this application, then you need:


Viewing content on Android

To view the contents of the apk file, and not install it completely, we will be helped by a powerful program Apk editor for Android. So we need:


Installing smartphone apps on your device is not that difficult. Any user can do this.

Video - How to open an apk file on a computer

When downloading smartphone applications via a computer, a user may find that their installation file has an APK extension. Few people know, but this format can be launched not only on Android, but also on Windows, and how to do this will be described further in the text.

What is APK

Before we start looking at ways to launch APK files on a desktop device, it’s worth telling what this format actually is.

So, its full name is Android Package. Accordingly, from this we can already conclude that it is intended to work within the framework of a mobile operating system. Here we can draw an analogy with the EXE format, which is used in Windows and is an installer for an application. Likewise, an APK is an archive with all the program files, as well as instructions for extracting them. In simple words, it is an app installer for Android.

How to open an APK file on a computer

At the beginning of the article it was said that APK files can be run not only on smartphones running Android, but also on Windows. Of course, this will require additional tools. They can be divided into two categories:

  • to view the list of installed files;
  • to install the application.

In the first case, any well-known archiver will do; it can be used to open the APK and see what files are in it. But to install Android programs on the Windows operating system, you need to use more serious applications called emulators.

Using archivers

We'll start with how to open an APK file using an archiver. The question may immediately arise as to why this is necessary at all. But, as mentioned earlier, in this way you can view all the files of the installed application, and, most importantly, make some changes to them, for example, translate the text into Russian.

To perform all operations, the WinRAR archiver will be used, which every user can install, because the application is distributed free of charge.

  1. Right-click (RMB) on the APK file.
  2. Select the "Properties" option from the menu.
  3. In the window that opens, go to the “General” tab.
  4. Opposite the “Application” line, click the “Change” button.
  5. A dialog box will appear in which you must select a program to open the file. If WinRAR is not in the list, then specify the direct path to it by clicking on the “Find another application on this computer” link.
  6. A file manager window will open. In it you need to go to the directory with the WinRAR executable file. By default, it is located in the following path: “C:\Program Files\WinRAR\”.
  7. Going to the folder with the archiver, select the executable file and click the “Open” button.
  8. In the Properties window, click Apply and then OK.

After following this instruction, all files that have the APK extension will be launched through the archiver; you just need to double-click on them with the left mouse button (LMB).

Launching the emulator

If the purpose of downloading the APK file to your computer was to install it further and not open it, then you will need to use a Windows operating system emulator. There are quite a lot of them on the software market, so all of them will not be considered in the article, but only the most popular ones.

BlueStacks

BlueStacks is the most popular Android emulator, so it's a smart place to start. So, to install an Android application on the Windows desktop, you must follow these steps:

  1. Launch BlueStacks.
  2. On the left panel with a list of tools, click on the “APK” button.
  3. A file manager window will open, in which you need to go to the folder with the previously downloaded APK file.
  4. Select the Android application and click the “Open” button.
  5. The installation process of the application in BlueStacks will start, wait for it to complete.
  6. The emulator menu will display the icon of the newly installed program; click on it to launch.

Droid4X

Droid4X is one of its popular mobile operating system emulators, and it can be used to run Android applications on Windows computers. This can be done much easier:

  1. Install the Droid4X program on your computer.
  2. Open the File Explorer file manager.
  3. Go to the folder with the downloaded APK file.
  4. Right-click on it.
  5. In the context menu, select “Play with Droid4X”.
  6. The installation process of the mobile application will begin. Wait for it to complete.
  7. Click LMB on the icon of the installed program in the emulator menu.

Genymotion

Using the Genymotion emulator, installing an APK file on a computer is much more difficult, but it is still a good alternative to the previous methods. However, please note that you must first create an account on the Genymotion website and install the VirtualBox virtual machine.

  1. Launch Genymotion.
  2. Click the “Add” button on the top panel.
  3. In the window that appears, click “Next”.
  4. Subsequently, also click “Next”.
  5. Wait for the download to complete and in the VirtualBox window that opens, click the “Launch” button.
  6. Return to the Genymotion window and click the "Start" button.
  7. An emulated Android window will appear. To install the APK, you must first install Genymotion ARM Translation. To do this, open the folder with this file and drag it with the mouse into the emulator window.
  8. Restart the emulator and virtual machine.
  9. Open the folder with the APK file and drag it into the emulator window.

Immediately after this, the application will be launched and you will be able to interact with it through the emulator window.

Sometimes some applications on Android do not suit the user in some way. An example is intrusive advertising. And it also happens that the program is good for everyone, but the translation in it is either crooked or completely absent. Or, for example, the program is a trial, but there is no way to get the full version. How to change the situation?

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 several changes to the applications that can bring us one benefit or another.

To do all this yourself, you will need at least 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 strings that will be displayed on the screen. You will also need the ability to use specialized console software.

So, what is an APK package in which absolutely all Android software is distributed?

Application decompilation

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

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

This is how they should be used. First, we launch dex2jar, specifying the path to the apk package as an argument:

% dex2jar.sh mail.apk

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

Arrangement of APK packages and receiving them

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

  • META-INF/- contains a digital certificate of the application, identifying its creator, and checksums of the package files;
  • res/ - various resources that the application uses in its work, such as images, declarative description of the interface, as well as other data;
  • AndroidManifest.xml- description of the application. This includes, for example, a list of required permissions, the required Android version and the 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 a resource you need to know its identifier, but the list of assets can be obtained dynamically using the AssetManager.list() method in the application code;
  • lib- native Linux libraries written using NDK (Native Development Kit).

This directory is used by game producers who place the game engine written in C/C++ there, as well as by creators of high-performance applications (for example, Google Chrome). We figured out the device. But how do you get the package file of the application you are interested in? Since it is not possible to pick up APK files from the device without root (they are located in the /data/app directory), and rooting is not always advisable, there are at least three ways to get the application file to your computer:

  • APK Downloader extension for Chrome;
  • Real APK Leecher app;
  • various file hosting and Varezniks.

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 in either Windows or 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 the device. The third is the device identifier, and can be obtained by typing the code on the dialer # #8255## and then finding the Device ID line. When filling out, you only need to enter the ID without the android- prefix.

After filling out 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 that interests you, downloaded it, unpacked it... and when you tried to view some XML file, you were surprised to discover that the file was not text. How to decompile it and how to work with packages in general? Is it really necessary to install the SDK? No, it is not necessary to install the SDK at all. In fact, all the steps to extract, modify and package APK packages require the following tools:

  • ZIP archiver for unpacking and packing;
  • smali- Dalvik virtual machine bytecode assembler/disassembler (code.google.com/p/smali);
  • aapt- a tool for packaging resources (by default, resources are stored in binary form to optimize application performance). Included in 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 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 does not know how to 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 quite non-standard. First you need to 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=~/bin:$PATH

If you work on Windows, then there is an excellent tool for it called Virtuous Ten Studio, which also accumulates all these tools (including apktool itself), but instead of a CLI interface it provides the user with an intuitive graphical interface with which you can perform operations for unpacking, disassembling and decompiling in a few clicks. This tool is Donation-ware, that is, sometimes windows appear asking you to get a license, but in the end this can be tolerated. There is no point in describing 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 look at the apktool options. In short, there are three basic commands: d (decode), b (build) and if (install framework). If everything is clear with the first two commands, then what does the third, conditional statement, do? It unpacks the specified UI framework, which is necessary in cases where you dissect any system package.

Let's look at the most interesting options of the first command:

  • -s- do not disassemble dex files;
  • -r- do not unpack resources;
  • -b- do not insert debugging 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- indicate 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; to do this, just specify one of the commands and the path to the APK, for example:

$ apktool d mail.apk

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

Preparation. Disabling advertising

Theory is, of course, good, but why is it needed if we don’t know what to do with the unpacked package? Let's try to apply the theory to our benefit, namely, modify some software so that it does not show us advertising. For example, let it be Virtual Torch - a virtual torch. This software is ideal for us, because it is filled to capacity with annoying advertising and, moreover, is 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, simply open the APK file in the application and unzip it, create a project (File -> New project), then select Import File in the project context menu. If your choice fell on apktool, then just run one command:

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

After this, a file tree similar to that 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 disassembled code of the application's executable dex file, the second contains service information necessary for apktool to assemble the package back.

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

It is not difficult to guess that it is responsible for granting the application permissions to use the Internet connection. In fact, if we just want to get rid of advertising, we will most likely just need to block the application from the Internet. 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 a META-INF/ directory). We must 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- keystore output file; it usually stores one pair of keys;
  • Password And Confirm- password for the storage;
  • Alias- name of the key in the storage;
  • Alias ​​password And Confirm- secret key password;
  • Validity- validity period (in years). The default value is optimal.

The remaining fields are, in general, 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 editors nor the author are 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, then find the APK file and boldly click the “Sign” button. If everything 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 only required 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, download the package to your smartphone, install it and launch it. Voila, the ad is gone! Instead, however, a message appeared that we do not have the Internet or do not have the appropriate permissions. In theory, this might be enough, but the message looks annoying, and, to be honest, we just got lucky with a stupid application. Normally written software will most likely clarify its credentials or check for an Internet connection and otherwise simply refuse to launch. 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 when the application or one of its “activities” (in simple terms, application screens) is launched. Let's try to find these classes. We go to the smali directory, then com (org contains only the open graphic library cocos2d), then kauf (this is where it is, because this is the name of the developer 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, from the name of which it is easy to guess that it is the one that displays advertising.

We could change the logic of its operation, but it would be much easier to simply remove calls to any of its methods from the application itself. Therefore, we leave 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 installed as the entry point into the application (analogous to the main function in C). Open the file for editing.

Inside there is 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 will simply find all references to the Ad class in the code and comment them out. We enter the line “Ad” in the search and get to line 25:

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

Here an ad field is created to store an Ad class object. We comment by placing a ### sign in front of the line. We continue the search. Line 423:

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

This is where the object creation occurs. Let's comment. We continue the search and find in lines 433, 435, 466, 468, 738, 740, 800 and 802 calls to methods of the Ad class. Let's comment. Look like that's it. Save. Now the package needs to be put back together and checked for functionality and the presence of advertising. For the purity of the experiment, we return the line removed from AndroidManifest.xml, assemble the package, sign and install.

Our guinea pig. Advertising visible

Oops! The 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 advertisement 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 contains 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 an intent (event) android.intent.action.MAIN from the android.intent.category.LAUNCHER category. This event is generated when you tap on the application icon in the launcher, so it determines the entry point, namely the Start class. Most likely, the programmer first wrote an application without a 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”, we find in lines 153 and 155 a mention of the FirstAd class. It is also in the source code and, judging by the name, it is responsible for displaying ads on the main screen. Let's look further, there is the creation of an instance of the FirstAd class and an intent that, according to the context, is 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 advertising should be shown on the main screen, and, if not, jumps directly to cond_10. Ok, let’s simplify her task and replace the conditional transition with an unconditional one:

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

There are no more mentions of FirstAd in the code, so we close the file and reassemble our virtual torch using apktool. Copy it to your smartphone, install it, launch it. Voila, all advertising has disappeared, for which we congratulate all of us.

Results

This article is just a brief introduction to the methods of hacking 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’s only a matter of time to figure it all out.

mob_info