Editing Android firmware using Samsung Root Firmware Replacer. Android firmware using the FastBoot utility How to open the firmware

MTwinTools is a utility that allows you to work with firmware files and images boot.img, recovery.img and system.img. The author of the utility is vin2809 from the 4pda forum. MTwinTool will be useful to owners of Huawei smartphones based on MTK processors.

User's Guide for working with MTwinTools

1. Introduction.

1.1. Purpose.

The MTwinTools tool is intended for disassembling/assembling images of devices based on MT chips.

It is built for use on the command line based on the RKwinTools tool, designed to work with devices on RK29xx-RK31xx chips, and some freely distributed programs.

It only works under Windows 7 and higher without installing CYGWIN, and also does not require any additional entries of paths in OS environment variables.

The tool allows you to:

  • unpack and pack the Boot.img image;
  • unpack and pack the Recovery.img image;
  • unpack and pack the Kernel.img image;
  • unpack and pack the System.img image, both yaffs type and ext2-ext4;
  • convert a sparse file of type sparse into an image of type ext4;
  • calculate the checksum of a file in md5 format;
  • initiate SuperUser.

1.2. Installing MTwinTools.
Installation of the tool is carried out by unpacking the archive in any place convenient for you. This will create an MTwinTools folder containing:

  • folders _In/, App/ and Cygwin/;
  • as well as Readme.txt and menu.bat files.

The _In folder is empty and is intended to contain source images for processing. The App/ folder contains a set of command files that process images. The Cygwin/ folder contains freely redistributable utility libraries and files. The Readme.txt file contains user instructions, i.e. the text you are currently reading. The menu.bat file is used to create the menu for the MTwinTools tool.

ATTENTION. There is NO REQUIRED for specifying access paths to service files in Windows OS environment variables.

As you work, other necessary folders will appear:

  • Pack, which will contain the Boot, Recovery and System files after
    packages, an md5 folder containing files with a checksum, as well as a folder
    Firmware, in the Image subfolder of which the assembled Boot files will be located,
    Recovery and System;
  • Unpack, in which Boot, Recovery and System files are COMPLETELY unpacked
    will be located in the Firmware folder, in the Image subfolder.

1.3. Uninstalling MTwinTools.

The tool is uninstalled by deleting the root folder of the tool, i.e. MTwinTools folders.

2. Basic rules of work.

2.1.To get started, you need to run the menu.bat file, which will launch the tool menu.

2.2.Images intended for unpacking must be placed in the _In folder of the tool. The names of the input files MUST contain keywords and can have names like the following:

  • *boot*.img;
  • *recovery*.img;
  • *kernel*.img;
  • *system*.img.

2.3.When starting for the first time, initialize the tool. When the tool is initialized, ALL files located in the _In folder will be copied to the working input folder Unpack/Firmware/Image. This is done in order to preserve the original files.

2.4.After disassembling the image, its contents will be placed in the Unpack folder, in which the following folder structure will be created:

Boot(Recovery)/cfg/
kernel/
ramdisk/

The cfg/ folder will contain the image settings, in the kernel folder you will find the kernel, i.e. zImage binary file, and the ramdisk folder will contain everything else. To assemble the image, its component parts, i.e. Place ramdisk, kernel, and possibly settings in the appropriate folders in Unpack. The created image will be located in the Pack output folder.

3. Description of the product.

3.1. Main command menu.

The main menu of tool commands looks like this:

**************************
* MTwinTools_V_0.6 *
**************************
*Image commands:*
* ————— *
*1-Boot*
*2-Recovery*
*3-Kernel*
*4-System*
*5-Other commands*
* *
**************************
* Tools commands: *
* ————— *
*6-Init Tools*
*7-Clean*
* *
**************************
*8-Exit*
**************************
Please choose command:

A command is selected by entering the number indicated in front of it. In the current version you can do the following:

— go to the Boot image processing menu by typing the number “1”;
— go to the Recovery image processing menu — “2”;
— go to the Kernel image processing menu — “3”;
— go to the System image processing menu — “4”;
— go to the menu of other commands — “5”;
— initialize the working area of ​​the tool — “6”;
— clean the working area of ​​the product — “7”;
— complete the work, i.e. exit the facility - “8”.

3.2. Boot menu.

To proceed to processing the Boot image, run the “1-Boot” command. This will take you to the “Boot commands” menu.

The Boot image processing menu looks like this:

**************************
* Boot commands: *
* ————— *
*1-Boot unpack*
*2-Boot pack*
* *
**************************
*3-Return*
**************************
Please choose command:

Command “1” unpacks Boot images, command “2” packs Boot images. The command “3” returns to the main menu of the tool.

2.2.1. Disassembling the boot.img image.

2.2.2. Build the boot.img image.

When building the boot image, a menu for selecting a data source will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
*3.Return*
**************************
Please choose source:

You have the opportunity to build an image from an unpacked image located in the Unpack/Boot folder; to do this, select the menu item “1. Unpack dir.” If you select the menu item “2. Pack dir", then the image will be created from the data located in the Pack/boot folder. To cancel the operation, select the menu item “3. Return". At the same time you
return to the “Boot commands” menu.

3.3. Recovery menu.

To proceed to processing the Recovery image, run the “2-Recovery” command. This will take you to the “Recovery commands” menu. The Recovery image processing menu looks like this:

**************************
* Recovery commands: *
* —————— *
* 1-Recovery unpack *
* 2-Recovery pack *
* *
**************************
*3-Return*
**************************
Please choose command:

Command “1” unpacks Recovery images, command “2” packs Recovery images. The command “3” returns to the main menu of the tool.
2.3.1. Disassembling the recovery.img image.

All actions are performed automatically, i.e. There is nothing to describe here without your participation.

2.3.2. Build the recovery.img image.

When building the recovery image, a menu for selecting a data source will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
*3.Return*
**************************
Please choose source:

You have the opportunity to build an image from an unpacked image located in the Unpack/recovery folder; to do this, select the menu item “1. Unpack dir.” If you select the menu item “2. Pack dir", then the image will be created from the data located in the Pack/recovery folder.

To cancel the operation, select the menu item “3. Return". This will return you to the “Recovery commands” menu.

3.4. Kernel menu.

To proceed to processing the Kernel image, run the “3-Kernel” command. This will take you to the “Kernel commands” menu.

The Kernel image processing menu looks like this:

**************************
* Kernel commands: *
* —————— *
* 1-Kernel unpack *
*2-Kernel pack*
* *
**************************
*3-Return*
**************************
Please choose command:

Command “1” unpacks Kernel images, command “2” packs Kernel images. The command “3” returns to the main menu of the tool.

3.4.1. Disassembling the kernel.img image.

All actions are performed automatically, i.e. There is nothing to describe here without your participation.

3.4.2. Building the kernel.img image.

When building the kernel image, a menu for selecting a data source will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
*3.Return*
**************************
Please choose source:

You have the opportunity to build an image from an unpacked image located in the Unpack/Kernel folder; to do this, select the menu item “1. Unpack dir.” If you select the menu item “2. Pack dir", then the image will be created from the data located in the Pack/Kernel folder.

To cancel the operation, select the menu item “3. Return". This will return you to the “Kernel commands” menu.

3.5. Menu System.

To proceed to processing the System image, run the “3-System” command. This will take you to the “System commands” menu.

The System image processing menu looks like this:


* System commands: *
* ——————————————— *
* 1-pack yaffs * 2-pack yaffs *
* 3-unpack ext3 * 4-pack ext3 *
* 5-unpack ext4 * 6-pack ext4 *
* 7-sparse to ext4 * *
* * *
***************************************************
*8-Return*
***************************************************
Please choose command:

3.5.1. Disassembling a system image like yaffs.

The “1” command unpacks System images of the yaffs type into the Unpack/System folder.

3.5.2. Building a system image like yaffs.

Command “2” packs System images of the yaffs type. A menu for selecting a data source will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
*3.Return*
**************************
Please choose source:

You have the opportunity to build an image from an unpacked image located in the Unpack/system folder; to do this, select the menu item “1. Unpack dir.” If you select the menu item “2. Pack dir", then the image will be created from the data located in the Pack/system folder.

To cancel the operation, select the menu item “3. Return” and you will return to the previous “System commands” menu.

3.5.3. Disassembling the ext3 type system image.

Command “3” unpacks System images of type ext2-ext3 into the Unpack/System folder.

3.5.4. Building a system image of ext3 type.

Command “4” builds the System image of type ext2-ext3. Packing is carried out similarly to clause 3.5.2. only the output image will be of type ext3.

3.5.5. Disassembling the ext4 type system image.

The “5” command unpacks ext4 System images into the Unpack/System folder.

3.5.6. Building a system image of ext4 type.

Command “6” builds the System image of ext4 type. Packing is carried out similarly to clause 3.5.2. only the output image will be of type ext4.

3.5.7. Convert sparse compressed image to ext4.

The “7” command converts (converts or transcodes) compressed images of the sparse type into images of the ext4 type (analogous to the simg2img operation).

3.5.8.Return to the main menu.

The command “8” returns to the main menu of the tool.

3.6. Menu of other commands.

To move on to executing other commands, execute the “5-Other commands” command. This will take you to the “Others commands” menu. The menu for executing other commands looks like this:

**************************
*Others commands:*
* —————- *
*1-Init SuperUser*
* 2-Calculate md5 *
* *
**************************
*3-Return*
**************************
Please choose command:

Command “1” initializes SuperUser in the System image, command “2” calculates the file checksum. The command “3” returns to the main menu of the tool.

3.6.1. Initializing SuperUser.

When initializing SuperUser, a source selection menu will appear:

**************************
* Choice source init: *
* 1. Unpack dir *
* 2. Pack dir *
*3.Return*
**************************
Please choose source:

You have the opportunity to initialize the unpacked image located in the Unpack/system folder; to do this, select the menu item “1. Unpack dir.” If you select the menu item “2. Pack dir", then the image located in the Pack/system folder will be initialized. To cancel the operation, select the menu item “3. Return".
Initialization is done by copying the necessary files (su and SuperSU.apk) into the disassembled System.img image. To obtain Root access you need:

— unpack the System image using command “3” of the main menu
tools or place the unpacked image in the Unpack (or Pack)/System/ folder;
— execute the command “1-init SuperUser” in the “Others commands” menu.

After flashing the System.img image, you will have Root access on your device. If files of a different version are used to obtain Root access on your device, then you just need to update (replace) the su and SuperSU.apk files in the App/ folder.

3.6.2. Checksum calculation.

To calculate the checksum of a file or files, place them in the Pack/md5/ folder. After executing the “2-Calculate md5” command, a checksum calculated using the md5 algorithm will be added to all files located in the Pack/md5 folder. Only files without or with the extension .img, .tar, .zip are processed.

3.7. Initialization.

To carry out initialization, run the “6-init Tools” command. This will create all the necessary folder structures for MTwinTools to work and copy the input images to the working folder Unpack/Firmware/Image.

3.8. Cleaning the product.

To clear the work area, type “7-CLEAN”. In this case, ALL additional folders along with their contents will be deleted, MTwinTools will complete its work and take the form it had immediately after installation.

3.9. Exit.

To exit, dial “8-Exit”. In this case, ONLY the product will come out without any cleaning.

Need to flash Android using FastBoot, but don't know how? This article provides detailed instructions on using the FastBoot utility and how to use it to flash an Android device.

This manual will fully explain how to use FastBoot! If you don’t know how to install archived updates, then you need the article - Clockwordmod - what is it. Instructions for CWM recovery with pictures

Downloading and installing FastBoot

Before flashing Android using FastBoot, you need to download it and install it on the desired computer.

1. You can download the FastBoot utility from the official Android SDK program (heavy weight)

why ADB RUN is better

Launch

If you downloaded Separately Fastboot

After you have downloaded and installed FastBoot, open the " Command line »

and vve Enter the commands to go to the folder with the Fastboot utility (if you installed separately FastBoot)

cd/
cd adb

If you downloaded ADB RUN

If your choice fell on the ADB RUN program, then launch it and select Manual -> ADB from the menu

The files that need to be flashed must be located in the same folder as the Fastboot utility.

Instructions for commands on how to flash Android using FastBoot

It is very important to write commands and firmware files as they are specified!

If your command is specified

fastboot flash cache NazvaniAFiLe.img

then you need to write exactly like that, but not any other way. In other words, the case of letters is important, otherwise you will get an error cannot load 'image' - there is no such file.

Reboot commands into firmware mode (bootloader)

fastboot reboot-bootloader

The command "sees" your Android PC

Get in the habit of checking before doing anything in Fastboot if there is a connection between your computer and Android:

Checking whether your PC can see your Android

fastboot devices

Execute this command when the device is already in firmware mode (bootloader)

Nexus Bootloader Unlock and Lock Commands

Unlock bootloader for Nexus

fastboot oem unlock

Lock bootloader for Nexus

fastboot oem lock

Command to find out bootloader version

Shows the bootloader version number installed on Android

fastboot getvar version-bootloader

Partition formatting commands

Before flashing any partition in Android, you must first format it so that there are no problems with operation

fastboot erase Imya_razdela - erase partition: boot, radio, recovery, system, userdata and others

Erases the Cache partition

fastboot erase cache

Erases the Data section

fastboot erase userdata

Erases the System partition

fastboot erase system

Erases the Recovery partition

fastboot erase recovery

Commands for flashing a partition

After you have formatted the partition or partitions, you can start flashing the firmware

fastboot flash Imya_razdela imya_file.img - firmware of the selected partition: boot, radio, recovery, system, userdata and others

Flash the system partition (System)

fastboot flash system imya.img

Flash the cache partition

fastboot flash cache imya.img

Flash the data section

fastboot flash userdata imya.img

Flash the Recovery partition

fastboot flash recovery imya.img

Setting the power-on animation (firmware partition with animation)

fastboot flash splash1 splash.img

Flash all partitions (boot, recovery and system)

fastboot flashall

Instead of imya.img- you need to enter the name of the file you are going to flash

Command to install update.zip

Flashes an update archive on Android in update.zip format or a ZIP archive with IMG images of various sections

fastboot update filename.zip

For Sony devices

Checking the connection of the Sony device, if the answer is 0.3 device, then it is connected

fastboot.exe -i 0x0fce getvar version

Unlock bootloader

fastboot.exe -i 0x0fce oem unlock 0xReceived_Key

More detailed information on unlocking Bootloader Sony - How to unlock Bootloader Sony

Waiting for Device error

If you have the following message on in the command window for a long time: waiting for device- Means:

  • The driver is not installed or installed incorrectly - reinstall or install
  • Android device is not in Bootloader mode - translate
  • Incorrect connection to the USB port - use the rear USB 2.0 ports of the computer, do not use USB hubs

If you want to try your hand at creating and editing firmware on Android, then the Samsung Root Firmware Replacer program will help you create firmware!

Briefly about the Samsung Root Firmware Replacer program and its capabilities

With this program you will be able to:

  • Unpack Samsung firmware
  • Dress up the firmware
  • In automatic mode, embed Root rights
  • Automatically fill the firmware with your files
  • Freeze a project and then continue working on it
  • Pack the firmware

Required components and operating conditions for Samsung Root Firmware Replacer

Review and description of Samsung Root Firmware Replacer functions start program

1. Go to the folder with the Samsung Root Firmware Replacer program, right-click to open in the terminal

2. In the terminal, enter the command

3. The program interface will open in front of you

4. If you launched the program for the first time, then execute - Settings Configuration

Working with Samsung Root Firmware Replacer

Paragraph Unpack firmware *.tar.md5- unpacks the firmware, to do this, move the file to the folder unpack_tar_md5, after which all files will be extracted, and the factoryfs or system file will be moved to input_img

paragraph Creating *.img from your Android (needs Android)- allows you to create firmware from your current Android state. For this item to work, you must have Android connected to your PC with USB debugging enabled.

This item has a submenu

Paragraph Creating *.img from original firmware allows you to change ready-made firmware; to do this, move any IMG file to the input_img folder.

This item also has its own submenu

An example of using the Samsung Root Firmware Replacer program

In this example, the firmware is created from the current state of Android

1. Connect Android to PC

2. Launch the program

3. Select Create *.img from your Android (needs Android)

4. Select Remove image from Android and unpack img

5. Selecting the partition from which the image will be removed

6. Wait 6-7 minutes for the image to be removed and transferred to the PC.

Important! Your smartphone or tablet, as well as your PC, must have enough memory to take the image. The image size can range from 2MB to 2GB

7. After you have removed the image, you can modify it, if necessary (embed Root), you can pack it back, for this

8. Select Package project in img

9. Specify the size and name of the firmware.

  • Specify the partition size in this way: divide the block size by 1024 and add the letter M to the result.

  • The name must match the name you used to change

11. Also, do not forget to copy the kernel from your Android, to do this, use the item - Remove image from Android - boot.img or zImage

12. After all the manipulations, you need to assemble the firmware in TAR.MD5

13 In the main menu, select Pack firmware *.tar.md5

14 The firmware in the Samsung Root Firmware Replacer program is ready, you can

Interpolation, interpolation- in computational mathematics, a method of finding intermediate values ​​of a quantity from an existing discrete set of known values.

Many of those who deal with scientific and engineering calculations often have to operate with sets of values ​​obtained empirically or by random sampling. As a rule, based on these sets, it is necessary to construct a function into which other obtained values ​​could fall with high accuracy. This task is called approximation. Interpolation is a type of approximation in which the curve of the constructed function passes exactly through the available data points.

There are many finite difference interpolation methods. Most
Newton's method for forward interpolation (Newton-Gregory method) is common. The interpolation polynomial in this case has the form:

We find coefficients C using the formula:

Implementation of the program in C#:
using System; namespace Interpolation ( class Program…

Visualization of sorting algorithms

The program is divided into two threads in one of which sorting is performed, and in the other the graphical interface is redrawn. After clicking on the “Sort” button, the program calls the “RunSorting” method, in which the sorting algorithm is defined and a new thread is created with the sorting process running in it.
private void RunSo…

Kacher Brovina on KT819G

Today I want to show my Kacher, which I made last winter holidays. I will not describe the entire manufacturing process, since there are many articles on the Internet. I will write only about its main parameters.

Below are a few photos taken during assembly of the device.

The coil is wound with approximately 2000 turns of 0.08 mm wire on a PVC pipe with a diameter of 50 mm and a height of 200 mm.

A plate from an old hard drive was used as a terminal. Everything else was assembled according to the diagram located at the very bottom of the page.

The first option was powered from the power supply of an old computer, with a voltage of 12 V. Then a separate power supply was made, with a voltage of 30 V and with built-in cooling.

Device diagram:

What is CORS and how to use it

Cross-Country Resource Sharing (CORS) is a W3C specification that allows cross-domain communication in the browser. By building on top of the XMLHttpRequest object, CORS allows developers to work with the same idioms as requests with the same domain. The use case for CORS is simple. Imagine that alice.com has some data that bob.com wants to obtain. This type of request is traditionally not allowed under the same browser origin policy. However, by supporting CORS requests, alice.com can add several special response headers that allow bob.com to access the data. As you can see from this example, CORS support requires coordination between the server and client. Luckily, if you're a client-side developer, you're protected from most of these details. The rest of this article shows how clients can make cross-origin requests and how servers can configure themselves to support CORS. Continued…

Mega utility Android IMG Repack Tools for all beginners and advanced romodelers, developers, for editing Android images.

Android IMG Repack Tools what is it and why?

Android IMG Repack Tools utility from user under nickname A.S._id(xda, w3bsit3-dns.com), designed to edit Android images:

  • unpack Android image (img, ext4)
  • editing files (manually)
  • collect image

And also work with kernels (boot.img) and recovery (recovery). The utility is designed to work both under Linux and Windows (you must install Cygwin).

Android IMG Repack Tools will be useful to absolutely all Android Romodels for creating new custom firmware, as well as software developers.

Where to find and download Android IMG Repack Tools?

You can also download the latest version of the Android IMG Repack Tools utility from the official project page on XDA.

Installing Android IMG Repack Tools on your computer

Since the Android OS is based on the Linux kernel, it would still be more correct to work with the Android IMG Repack Tools utility from an operating system based on Linux.

OS pre-configuration for Android IMG Repack Tools

If you have Ubuntu version 14.04 and older (and Mint based on it), then you will need to install GCC 5 from the repository (open a terminal and type the following commands):

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get install gcc-5 g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

For users of Ubuntu 16.04 (and Mint based on it), then you need to install first:

1. GNU Automake 1.14 (download and unpack)

2. Go to the folder with Gnu Automake, open a terminal and execute the commands one by one: ./configure make sudo make install

3. Install packages: sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline6-dev gcc-multilib g++-multilib libc6-dev x11proto-core -dev libx11-dev libz-dev gawk texinfo automake libtool cvs libsdl-dev

Setting up Android IMG Repack Tools

1. After downloading Android IMG Repack Tools, unpack, go, open terminal

2. Type the command to launch the utility./main_menu

If you have Mint installed, then click on the main_menu file

3. Go to the utility section " 0 - Configure & clean tools menu»

4. Select " 1 - Build android_img_repack_tools“, in order to download and configure the tools that work with Android images.

Working with the Android IMG Repack Tools utility

Expect an update to the article with instructions on how to use the utility soon!