Custom Android: we make our own firmware from stock without digging into the source code. Purpose of TWRP Recovery menu items

Custom Android: we make our own firmware from stock without digging into the source code. Purpose of TWRP Recovery menu items

16.06.2022

Superuser rights or simply root is an integral part of the world of the Android operating system. As you know, with its help you can significantly expand the functionality: from removing ads to a serious modification of the device software. However, many users are asking questions like: “how to run Sberbank Online with root?”, Or: “how to play Pokemon GO on a hacked smartphone?”. The answer to all this is Magisk.
With the popularization of contactless payment systems, the question has become relevant: “why does Visa payWave not work with superuser rights?”. Previously, modified versions of applications with disabled protection came to the rescue, you can’t talk about their safety, you can include anything in the apk file! Developer topjohnwu from the XDA-Developers forum approached the problem in a completely different way!

What is Magisk

- a modern root administrator, in fact - a more advanced alternative to SuperSU from Chainfire with some functional innovations.

The program interface is made according to the Material Design guideline, the navigation is intuitive, the menu is not overloaded with unnecessary items, only everything you need. The application, with rare exceptions, is Russified.

Key Features

The mechanism for obtaining superuser rights MagiskSU does not interfere with the system partition. This approach is safer than the classic one, and allows you to update the firmware with the formatting of the system partition, without fear for the root and additionally installed modules.

A key feature is the ability to hide superuser rights from apps that don't run on a jailbroken device. These include clients of many banks, contactless payment systems and, for example, Pokemon GO. The implementation is convenient, the root is hidden in one click, the Magisk Hide section of the main menu. The same Sberbank Online stopped reporting the threat and opened all the functionality!

Additional modules

In addition, Magisk Manager includes a powerful mod engine that corresponds to the general concept of the application and works without modifying the system partition (systemless), you don’t have to worry about damaging system files, this approach allows you to disable all add-ons at any time. Installation of modifications is carried out through custom recovery or directly through the Magisk Manager menu. Already now there are many modules, the most interesting of them will be considered separately:

App Systemizer- a module that allows you to install any user application as a system one without modifying the system partition. Manual installation to the system partition is not the easiest task, and in the module you only need to mark the necessary applications.

Viper4Android is a popular sound effects manager with the widest range of options for customizing the sound path. With it, you can easily unlock the potential of any modern smartphone!

SELinux Permissive Script- Sets the SELinux security system to "Warning Only" mode. This manipulation is required by some applications, for example, the Viper4Android audio engine.

Xposed- powerful engine for modding without changing apk files does not require any introduction. Android supported from Lollipop to Marshmallow. It is gratifying that now it works without modifications to system files! To install it, in addition to the framework itself from Magisk Manager, you need to install the Xposed Installer!

The choice of modules is really wide, you can find them in the application, or in a special section on XDA-Developers. There are both general modifications, like the same ViperFX or AdBlock, and tailored for specific devices, for example, activating 50/60 FPS video recording for Nexus 5X/6P, or APT-X HD codecs for OnePlus 3. Everyone will find something interesting , and those who wish can create something of their own, the author provides all the necessary tools!

How to install Magisk

To install the application, you need OS version 5.0 Lollipop and higher, an unlocked bootloader and custom recovery, for example, TWRP. It is highly recommended to make a full nandroid backup in case the installation fails.

For the full functionality of Magisk Manager, you must use MagiskSU, for the correct installation of which, it is first recommended to remove alternative root administrators. For example, Chainfire's SuperSU is being removed from the app's settings menu.

Uninstall Magisk Manager

All files of the latest version required for deletion can be found in the topic
To uninstall an application in automatic mode, you need to flash Magisk-unistaller.zip of the corresponding version through custom recovery.

In case the archive did not work
, you need to restore the boot partition (boot.img) from a backup, as well as manually delete /data/magisk.img, /cache/magisk, /data/busybox.

And what is the result?

The result is that Magisk Manager is a new, modern approach to superuser rights, which is focused on comfort, and not just granting access. I am very pleased with the modularity, with which you can achieve the necessary functionality without unnecessary frills. The project is actively developing, I think that over time, developers will start using it by default in their custom firmware.

Hello Habr!

A few years ago, when I was first introduced to Android, I heard from a colleague at work that Android provides for the ability to install modified or homemade firmware. Frankly, then I was far from it. And even half a year ago I was hardly interested in such things. Deep in my heart, I was sure that what the manufacturer makes is already intended for normal use.

Imagine my disappointment when I bought a phone from China, where the factory settings prohibited the use of Google, Skype, Facebook and other applications. In principle, it was possible to turn a blind eye to some things, but when my phone did not imply the use of a Google account, I took a promise to figure it out, no matter what happened to me.

Half a year has passed and my custom firmware is successfully used all over the world.

This series of articles will talk about how to do reverse programming for Android, implement patches, tweaks and mods.

Preamble

So! Let's first define the terms that will be used in given article. Your usual understanding, however, may differ greatly.

Patch- change or replacement of the existing program code in order to modify the program algorithm.
Maud- as a rule, adding additional functionality to existing program code without changing the algorithm.
tweak- improvement of the program functionality in order to facilitate access to system parameters.

I also want to note that all examples will be taken for the HTC phone, but this does not mean that this information cannot be used on other phones.

Preparing the environment

I will do without detailed instructions on how to use this or that software. If you are interested in this article and you have read up to these lines, then I hope that you are already an experienced user and have experience in using, or at least experimenting in this area. There are a lot of instructions, articles and test results in the public domain, however, as well as on Habré. I will also do without describing some terms, otherwise the article will turn out to be very large and tedious. We will write only on business. I am sure that you have already had the environment for a long time. If not, then I suggest downloading and installing.

1 . Android SDK. This is an Android application development environment. In order to make modifications, we will definitely have to check our program code. The development environment is the best we can use.
2 . Android Kitchen. This utility will allow you to work with images of system partitions of official or unofficial firmware.
3 . JD GUI. Java code decompiler. I will immediately note that this is the best decompiler in terms of ease of use.
4 . DJ Java Decompiler. Another decompiler, or disassembler, as some like to call it, of the Java language code. Not user-friendly, but parses code that JD-GUI sometimes doesn't understand.
5 . smali. Another disassembler, but already dalvik code. smali is needed for disassembly, and backsmali for code assembly.
6 . dex2jar. Utility for converting executable Dalvik code files.

Firmware Conversion

Of course, the firmware that you have on your phone from the manufacturer is optimized to reduce power consumption. In order for the firmware to be modified, it must be converted to a format that allows the code to be modified. Android Kitchen is used for this. You can, of course, use your hands, as I did before, until I found this very “kitchen”. How to pull out the system area from the phone, install the environment, make DEODEX firmware, you can read on the Internet. If you already do not understand anything, I think you should wait with the article until you gain enough experience.

After the firmware from an optimized form (ODEX - optimized dalvik executable code, if my memory serves me) has become DEODEX (that is, NOT optimized), all executable files are ready for modification.

Direct modifications

Creating patches
As I already said, my phone initially had a ban on the use of Google. Well, at least you crack, you can’t go to the Playstore, you can’t set up an account, the phone book doesn’t really sync. Why do we need such an Android? Long digging into the logs (logcat) of the device itself, I found entries that said that the use of Google is prohibited. The most inconvenient in Android, you see the log, but you don’t know which system application produces it. To find where my legs grow from, I had to gut all system applications to disassembled Java code. It took quite some time, but I still use the work done when analyzing and finding the right code. The steps for obtaining such a tool are as follows:
1 . Make DEODEX all firmware
2 . Your new DEODEX firmware will need to be assembled and flashed onto the phone. How this is done is the topic of another article.
3 . Extract the classes.dex file from each file located in /system/framework and convert it to JAR using dex2jar.
4 . Each received JAR open in JD-GUI and re-save to source code
5 . Unpack the source code from the archive.

I ended up with as many folders as there were JAR files in /system/framework, and each folder had a Java source code structure.
Through simple manipulations, I quickly found the place that generated logcat entries.

We will not consider the entire logic of the ban, since for each case this is a separate story. I had to spend a couple of hours before I found where the checks are made, build a block diagram of the algorithm in my head and understand where to go in order to “spoil” the algorithm a little.

Everything turned out to be simple. There is a subroutine that, based on pre-set constants, answered whether the phone belongs to China or not.

The code was in the file HTCExtension.jar, and the class that contained this subroutine was in

Unpacking and analyzing the original file
1 . First we need to take the original DEODEX JAR file, which is responsible for the part of the code we need. In our case HTCExtension.jar.
2 . Open with any archiver and pull out classes.dex from there
3 . Use the dex2jar converter to convert it into a JAR file. Command: dex2jar.bat classes.dex
4 . Open the resulting classes_dex2jar.jar file in the JD-GUI.
5 . Yes, most often JD-GUI decompiles the code differently from how it looks in the original, it is understandable, but it is quite readable. In the source code, we see that the subroutine checks the project parameters and the firmware language flag. In our unfortunate case, TRUE is returned.
public static boolean isChina() ( if ((HtcBuildFlag.Htc_PROJECT_flag == 216) || (HtcBuildFlag.Htc_PROJECT_flag == 218) || (HtcBuildFlag.Htc_PROJECT_flag == 23)); while (((HtcBuildFlag.Htc_PROJECT_flag == 1) && (2 == HtcBuildFlag.Htc_LANGUAGE_flag)) || (HtcBuildFlag.Htc_PROJECT_flag == 27)) return true; return false; )
6 . To make a patch, we need to disassemble the Dalvik code itself. For this we use baksmali. It is most convenient to create a separate folder and put three files together there: HTCExtension.jar, smali.jar And baksmali.jar. We give the command java -Xmx512m -jar baksmali.jar -a -d -o HTCExtension -x HTCExtension.jar

This is the API of your android version. For JB it's 16
- the folder where all firmware frameworks are located.

In my case it was the command
java -Xmx512m -jar baksmali.jar -a 16 -d S:\dev\Android\Android-Kitchen\WORKING_JB_15\system\framework -o HTCExtension -x HTCExtension.jar
7 . In our newly created folder, the HTCExtension folder appeared, and in it our Dalvik code files.
8 . Finding a file along the way \com\htc\util\contacts\BuildUtils$Customization.java and look at the code:
.method public static isChina()Z .registers 3 .prologue const/4 v0, 0x1 .line 276 sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S const/16 v2, 0xd8 if-eq v1 , v2, :cond_13 sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S const/16 v2, 0xda if-eq v1, v2, :cond_13 sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag ;->Htc_PROJECT_flag:S const/16 v2, 0x17 if-ne v1, v2, :cond_14 .line 297:cond_13:goto_13 return v0 .line 283:cond_14 sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;-> Htc_PROJECT_flag:S if-ne v1, v0, :cond_1d .line 285 const/4 v1, 0x2 sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_LANGUAGE_flag:S if-eq v1, v2, :cond_13 .line 291:cond_1d sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S const/16 v2, 0x1b if-eq v1, v2, :cond_13 .line 297 const/4 v0, 0x0 goto:goto_13 .end method
9 . Scary, isn't it? Nothing is clear. But, this is fixable. Once you've created a few of your own patches and gotten your hands dirty, you can easily modify the code without third-party tools. In our case, in this code
.prologue const/4 v0, 0x1 the variable v0 is assigned the value 1, i.e. TRUE. Then there are all sorts of checks, and if the phone is not Chinese, then the value of the variable changes:
.line 297 const/4 v0, 0x0 goto:goto_13
10 . The easiest way to save the father of Russian democracy is to change the code to the following:
.prologue const/4 v0, 0x0 , that is, change the value of the variable from 1 to 0. That is, whatever happens, the value of FALSE would always be returned and in the JD-GUI the code would look like public static boolean isChina() ( if (( HtcBuildFlag.Htc_PROJECT_flag == 216) || (HtcBuildFlag.Htc_PROJECT_flag == 218) || (HtcBuildFlag.Htc_PROJECT_flag == 23)); while (((HtcBuildFlag.Htc_PROJECT_flag == 1) && (2 == HtcBuildFlag.Htc_LANGUAGE_flag)) || (HtcBuildFlag.Htc_PROJECT_flag == 27)) return false; return false; )
11 . Yes, the method will work. But we are not looking for easy ways - this time. Secondly, it's not very pretty. I want code something like
public static boolean isChina() ( return false; )
12 . And how do we get the Dalvik code of this source code? For beginners, we will do a little trick.

Creating Dalvik code
1 . Open Android SDK.
2 . We create a new project, and in our only test class we write the following code
package en.habrahabr.test; public class test ( public static boolean isChina() ( return false; ) )
3 . We compile our project and then take the assembled application from the workspace.
4 . We put the assembled application in the folder where we gutted the JAR file.
5 . We give the command java -Xmx512m -jar baksmali.jar -a -d -o test -x test .apk
6 . We have disassembled the newly built application into Dalvik code.
7 . Open our test.smali file and see the code there
.method public static isChina()Z .registers 1 .prologue .line 7 const/4 v0, 0x0 return v0 .end method
8 . Everything, the code for patching is ready.
Patch rolling
1 . Dalvik code is littered with markers indicating a line of code in the original source file. This is necessary when displaying errors, if any, in your program. The code also works fine without strings.
2 . We delete lines with line numbering, copy and replace the method (subroutine) in our \com\htc\util\contacts\BuildUtils$Customization.java file.
.method public static isChina()Z .registers 1 .prologue const/4 v0, 0x0 return v0 .end method
3 . We save the file. Yes, I forgot to say, you need a normal editor, such as Notepad++ or EditPlus. Who likes what.
Compiling and building the patched JAR file
1 . With the help of backsmali, we gutted our JAR file, and now we need to build it back.
2 . We give the command java -Xmx512m -jar smali.jar -a 16 HTCExtension -o classes.dex
3 . The classes.dex file appears in our daddy
4 . Open again HTCExtension.jar file with an archiver and replace the existing one in it classes.dex to our newly created one.
5 . Everything, our HTCExtension.jar contains modified program code.
Replacing the original file with a patched one
Usually, special scripts are created for ordinary users, which are replaced through recovery. But we are not interested in that. Firstly, it is long and tedious, and secondly, we are experienced users and we can afford some subtleties.

1 . You can replace the current working file with the following commands if you already have the DEODEX firmware installed and have root access:

adb push HTCExtension.jar /sdcard/HTCExtension.jar adb shell su mount -o remount -rw /system dd if=/system/framework/HTCExtension.jar of=/system/framework/HTCExtension.jar.back dd if=/sdcard /HTCExtension.jar of=/system/framework/HTCExtension.jar chmod 644 /system/framework/HTCExtension.jar rm /data/dalvik-cache/ [email protected]@[email protected] reboot

1st command uploads the patched file to the flash drive
2nd command opens shell
3rd command gives root access
4th command mounts the system in read/write mode
5th command makes a backup copy of the file
The 6th command overwrites the existing file with the new patched one.
7th command configure permissions
8th command delete cache
The 9th command does a reboot of the device.

2 . Thank you for reading up to this point, there is not much left.
3 . After rebooting, your new patched code will take effect.
4 . If the code does not work or an error pops up, then by not tricky combinations you can return the backup.
adb shell su mount -o remount -rw /system dd if=/system/framework/HTCExtension.jar.back of=/system/framework/HTCExtension.jar rm /data/dalvik-cache/ [email protected]@[email protected] reboot

Epilogue

Yes, this article seemed too specific to someone, obscure to someone, and useless to someone. I deliberately did without in-depth detailing and illustrations of how it all looks live and in practice. Firstly, this work will be thankless and will only give rise to even more questions. Secondly, I do not want to see an army of users on the forums who complain that they killed their phone.

For the next article, I will tell you how to make Tweaks. There will be an example of using automatic recording of phone calls with native phone tools. Thank you for your attention.

P.S. If something is not clear or confuses, ask questions - I will always be happy to answer and explain.

Formulation of the problem

The storage of information in a computer is associated with the risk of its accidental or deliberate disclosure, therefore, various methods and means are used to protect it. Most often as the main means, which prevents free access to information in electronic form, use encryption which is implemented in hardware or software. Individual files, groups of files, directories and, finally, logical drives act as objects of cryptographic protection. The result of encryption is file archives located on electronic media. Details of the implementation of various cryptographic algorithms, it can be noted that in this case, the GCU must also solve problems related to the guaranteed destruction of the initial unencrypted information to rule out its recovery.

The fact is that a feature of all used file systems ( FAT, NTFS, etc.). are not the ability to overwrite information in clusters belonging to any file until this file is seen as deleted. That is, during file encryption, its encrypted copy is written not instead of the initial file, but into free clusters of electronic media, and only after the encryption process is completed, the unencrypted file is deleted, if this is not provided for by the algorithm.

Thus, it is possible to recover deleted unencrypted information, which is successfully handled by such software products as File Recover, Back2Life, R-Studio, GetDataBack for NTFS, etc.

If you do not take into account the recommendations associated with them with full physical destruction of the electronic media, then this can be made impossible only by repeatedly overwriting those clusters of the magnetic disk where confidential information was previously stored. For example, American national standard of the Department of Defense DOD 5220.22-M (E) involves writing random numbers in the first pass, in the second - numbers additional to those recorded in the previous pass, and in the third - random numbers. In the well-known Peter Gutmann algorithm, which is considered one of the most reliable , all known combinations of bits are written in turn to the place of the destroyed data (a total of 35 passes are performed). — methods of destruction of information support American standards DOD 5220.22-M, Army AR380-19, NCSC-TG-025, Air Force 5020, NAVSO P-5239-26, HMG IS5, German VSITR, Canadian OPS-II and Russian GOST P50739-95, etc. Thus, encryption performed inside the logical drive, is always associated with the risk of incomplete destruction of the original information, so a different approach to this problem is needed.

Menu Edit(Edit) program Regedt32 contains commands that allow you to add, modify and delete keys and significant entries in the registry.

To add a new key to any registry hive, select the command Add section(Add Key) menu Edit. When you run this command, you are prompted for a section name and a class (class in this case refers to a data type). The dialog box for entering this information is shown in fig. 14.5. The list from which you can select the data type is not provided in this dialog box, but it is possible to create a section, and determine the data type when entering a new parameter in the created section.

Team Add section used to add meaningful entries to registry keys. The dialog box that pops up when you run this command (Figure 14-6) contains a list that allows you to select the data type for the significant element: string values ​​(REG_SZ, REG_MULTI_SZ, and REG_EXPAND_SZ) or binary values ​​(REG_DWORD or REG_BINARY).

To delete a key or value from the registry, select the object (key or value) to be deleted and select the command Delete(Delete) menu Edit. You will be prompted to confirm your intention to delete the selected section or feature.

Note

As has been repeatedly repeated, registry editors do not support undo operations (Undo), so after confirming the delete operation, you will have no other way to recover deleted information than restoring it from a previously created backup. In addition, the Registry Editor offers to confirm the deletion operation only if the Confirm On Delete option is set in the Options menu. Therefore, when deciding to delete sections from the registry, do not neglect backup (and do not look for extra tasks for yourself with an existing solution).

If you accidentally delete anything from the HKEY_LOCAL_MACHINE\System\CurrentControlSet registry key, be aware that the contents of this key can be restored using the last successfully loaded configuration (see Chapters 2 and 8). To perform this operation, restart your computer and immediately after the bootloader menu appears, press the key , and then select the Last Known Good option from the debug menu.

In addition to the commands for deleting registry items and adding new sections and parameters to its composition, in the menu Edit Regedt32 has a set of commands for editing existing registry entries (and it should be noted that this set of options is much wider than that provided by the newer Regedit program). Menu Edit Regedt32 registry editor contains commands Binary data(Binary) Line(string) double word(DWORD) and Multiline(Multi String). Selecting each of the commands launches the value editor of the corresponding type - for example, selecting commands Binary data launches the Binary Editor, command selection double word- DWORD value editor, and command selection String and Multiline invokes the appropriate editors for string and multiline values. Please note that there are simply no such wide possibilities in the Regedit editor.

Having loaded your tablet or phone into TWRP Recovery, you will first of all see its main menu:

Screenshots were taken in one of the latest (at the time of this writing) versions of TWRP recovery 2.3.2. Newer versions of TWRP, as well as versions for different devices, may have a slightly different menu, but its main functions will remain unchanged.
In addition, the appearance of TWRP recovery on your device may be different - it may change depending on the theme.
Thanks to the touch interface of the recovery, it is very easy to navigate through its items and select the desired options - just tap on a specific item with your finger.
In all submenus, you can return to the previous menu by pressing the return button located in the lower (smartphone) or upper right (tablet) part of the screen.
At the top of the screen, you see the battery percentage and the current time.

Purpose of the main menu items:

1. Install - installation of firmware and add-ons

This is one of the most frequently used TWRP Recovery items.
With it, you can install both official and unofficial (custom) firmware, install kernels, themes and other software that should be in a zip file located on the built-in memory of your device.
After selecting a file, you get to the next menu, where you can choose to add the next file to the firmware queue (button Add More Zips) or start flashing the selected file using the slider located at the bottom of the screen.

With option Zip Signature verifications the zip file signature verification mode is enabled.
With option Force MD5 check on all Zips you can enable MD5 checksum verification for all zip files installed on the device.

2. Wipe - cleaning and resetting to factory settings

With this option you can clear sections such as the cache ( Cache), Dalvilk Cache, System, and also reset to factory settings - factory reset, after which your phone or tablet will return to the state in which it was sold in the store.
You can also clear the external memory card - external storage and internal memory Internal Storage, clear the android_secure system folder and clean up battery usage statistics - Wipe Battery Stats.
As in the rest of the menu items, you will have to confirm the start of a particular operation using the slider that appears at the bottom of the screen. You can cancel the operation using the "Back" button.

3. Backup - creating a backup copy of the system

Another one of the most important points of TWRP. With it, you can make a complete copy of the entire system of the tablet, along with the data and applications available in its internal memory - the so-called Nandroid Backup.
Here you can:

  • Select partitions to save: System, Data, Boot, Recovery, Cache, Uboot, NVram.
  • Find out the amount of free space on the media:free space.
  • Enable backup compression:enable compression.
  • Disable creation of files with backup checksums:Skip MD5 generation during backup.
  • Select a memory card for storing backups:Use external SD.
  • Select the internal memory of the device for storing backups:Use internal storage.
  • Set backup file name - buttonSet Backup name.
  • Recalculate partition sizes - buttonRefresh Sizes.

As usual, confirm your choice with the slider and TWRP will begin the backup process:

After that, you can restart your tablet or phone - button Reboot System, as well as go back or to the main TWRP menu using the corresponding buttons.

4. Restore - restore the system from a previously made backup

Here you can:

  • Select a memory card to search for backups: Use external SD
  • Select the internal memory of the device to search for backups: Use internal storage

Backup names consist of the date and time they were created. You can sort files by:

Asc" Sort Ascending» name, date and size
Descending " Sort Descending» name, date and size

After choosing a backup, you will have the option to:

  • Select the partitions (System, Data, Boot, Recovery, Cache, Uboot, NVram) that you want to restore,
  • Rename backup " Rename Backup»
  • Delete backup " Delete Backup»
  • Enable MD5 checksum verification of backup files

You can start recovery by confirming your choice using the slider.

5. Mount - mounting individual partitions, formatting them and mounting the device as a USB drive when connected to a computer

Mounting makes partitions or folders available for use.
The items on this menu mean the following:

  • Mount / Unmount System - mount or unmount the system partition.
  • Mount / Unmount Data - mount or unmount a partition with data.
  • Mount / Unmount Cache - mount or unmount the cache partition.
  • Mount / Unmoun Sdcard - mount or unmount a memory card
  • Mount / Unmoun Internal - mount or unmount internal memory.

Button " Mount USB storage» - connect a tablet or phone to a computer in removable storage mode.
With this you can choose to mount:

  • Memory card: Use external SD
  • Internal memory:Use internal storage

6. Settings - TWRP settings

Here you can set the default options that TWRP Recovery will use by default when creating and restoring backups, as well as when installing zip files:

  • Zip file signature verification: Verify the signature of a zip file.
  • Force MD5 check for all zips: checksum check for all zip files.
  • Use rm –rf instead of formatting: Delete files instead of formatting when clearing partitions.
  • Skip MD5 generation during backup: Disable creation of checksums during backup.
  • Ignore image size errors during backup: Ignore file size errors when backing up.

Button " time zone» is used to select your time zone.
Button " Restore Defaults» is designed to reset the settings to the default settings.

7. Advanced - additional features of TWRP

This menu consists of the following items:

  • Copy Log to SD– copying the operation log to a file on the memory card.
  • Fix Permissions- fix file and partition permissions. This item is used to return to the factory state the access rights to system files and folders, which can be changed by the incorrect operation of some root applications, which can lead to freezes and malfunctions of the tablet or phone.
  • Partition SD Card– creating partitions on the memory card. This item is used to create /sd-ext and /swap partitions on the memory card. The /sd-ext partition can be used by some firmware when there is not enough internal memory on the device, for example, to expand the /data partition. The /swap partition is commonly used to speed up an Android device.
  • file manager- file manager. Here you can select a file and perform the following operations on it:

Copy- copy file.
move- move the file.
Chmod 755– set access rights to 755 (as for all system files).
chmod– set any other access rights.
Delete- delete a file.
Rename File- rename the file.

  • Terminal Command– execute a terminal command in the style of adb commands in the selected directory.

Also, the Advanced section can contain other buttons that a developer can add when building recovery from source codes for a specific device.

Here you can choose from the following:

System- completely restart the tablet or phone.
Recovery- restart recovery.
power off– turn off the device.

© 2023 globusks.ru - Car repair and maintenance for beginners