CN110580169A - method for copying and rewriting android system through USB storage equipment - Google Patents

method for copying and rewriting android system through USB storage equipment Download PDF

Info

Publication number
CN110580169A
CN110580169A CN201910760359.1A CN201910760359A CN110580169A CN 110580169 A CN110580169 A CN 110580169A CN 201910760359 A CN201910760359 A CN 201910760359A CN 110580169 A CN110580169 A CN 110580169A
Authority
CN
China
Prior art keywords
usb storage
storage device
starting
storage equipment
mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910760359.1A
Other languages
Chinese (zh)
Inventor
林立伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Coship Electronics Co Ltd
Original Assignee
Shenzhen Coship Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Coship Electronics Co Ltd filed Critical Shenzhen Coship Electronics Co Ltd
Priority to CN201910760359.1A priority Critical patent/CN110580169A/en
Publication of CN110580169A publication Critical patent/CN110580169A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention discloses a method for copying and rewriting an android system through USB storage equipment, which comprises the following steps: firstly, normally starting an android system, checking application starting of a USB storage device, and starting monitoring whether the USB storage device is inserted; checking whether a starting file exists in the USB storage equipment or not after the USB storage equipment is checked, if the starting file exists in the USB storage equipment, executing a command to copy the starting file into the USB storage equipment, modifying the starting file into a pasting mode, and writing chip information into the starting file; if the mode is the paste mode, writing the pasted flag bit into the flash, and restarting the system; fifthly, if the flag bit is the flag bit to be pasted, recovery in the USB storage device is started; and sixthly, entering a new software system after recovery in the USB storage device is started. The method solves the problem that the software in the android device is copied to another device or devices under the condition that the original software package of the android device is lost or the software version number is unknown.

Description

method for copying and rewriting android system through USB storage equipment
Technical Field
The invention relates to the field of android systems, in particular to a method for copying and rewriting an android system through USB storage equipment.
Background
The Android term is used to mean a "robot" and is also the name of the Linux platform-based open source mobile phone operating system announced by Google in 2007, 11 and 5, and the platform is composed of an operating system, middleware, a user interface and application software. The Android system architecture is the same as the operating system, and a layered architecture is adopted. From the architecture diagram, the Android is divided into four layers, namely an application program layer, an application program framework layer, a system operation library layer and a Linux kernel layer from a high layer to a low layer. Android is released with a series of core application packages including clients, SMS messages, calendars, maps, browsers, contact management programs, etc. All applications are written in the JAVA language. Developers may also have full access to the API framework used by the core application. The architectural design of the application simplifies the reuse of components, any one application can publish its function blocks and any other application can use its published function blocks. Also, the application reuse mechanism allows a user to easily replace program components. Android contains a number of C/C + + libraries that can be used by different components in the Android system. They provide services to developers through the Android application framework.
This application mainly solves two problems: 1. when the original software package of the android device is lost or the software version number is unknown, the software in the android device is copied to one or more other devices. 2. And when an upgrade package, a computer or a burning tool is not available on hand, the software of one android device is synchronized to be the same as that of another device. In order to overcome the defects of the prior art, a method for copying and rewriting the android system through the USB storage device needs to be designed.
Disclosure of Invention
in order to overcome the defects in the prior art, a method for copying and rewriting the android system through the USB storage device is provided.
The invention is realized by the following scheme:
A method of copying and rewriting an android system via a USB storage device, the method comprising the steps of:
Firstly, normally starting an android system, checking application starting of a USB storage device, and starting monitoring whether the USB storage device is inserted;
secondly, after the USB storage equipment is checked, whether the USB storage equipment has the starting file or not is checked, if the USB storage equipment does not have the starting file, the step one is returned, and the insertion of other USB storage equipment is continuously monitored; if the starting file is checked, analyzing the file, and judging whether a copying mode or a pasting mode is to be carried out;
if the mode is the copy mode, acquiring the size of system software and the space size of the USB storage equipment, and if the size of the system software is larger than the space size of the USB storage equipment, returning to the step one, and continuously monitoring the insertion of other USB storage equipment; if the size of the system software is smaller than the storage space of the USB storage device, executing a command to copy the system software into the USB storage device, modifying the starting file into a paste mode, and writing chip information into the starting file;
if the mode is the paste mode, chip information in the starting file is analyzed and compared with chip information read from the android device, if the mode is the same platform, a flag bit to be pasted is written into a flash (partition), and the system is restarted; if the platform is not the same, the USB storage device cannot be pasted, otherwise, the pasting system has problems, and the step I is returned to, and the insertion of other USB storage devices is continuously monitored;
Step four, if the system is restarted, entering u-boot, reading the flag bit by the u-boot, and if the flag bit is to be pasted, starting recovery in the USB storage device; if the flag bit is not pasted, returning to the step one, and continuously monitoring the insertion of other USB storage equipment;
and sixthly, reading the flag bit after recovery in the USB storage device is started, starting a pasting process to write the software in the USB storage device back to the system if the flag bit is pasted, restarting the system, and entering a new software system.
in step three, the system software size includes the entire partition plus recovery single partition.
in step three, the executed commands are assembled from dd commands.
in step six, the paste flow is integrated by dd commands.
the invention has the beneficial effects that:
The invention relates to a method for copying and rewriting an android system through a USB storage device, which solves the problem that software in the android device is copied to another device or devices under the condition that an original software package of the android device is lost or the version number of the software is unknown. The problem that the software of one android device is required to be synchronized into the same software as another device under the condition that an upgrade package, a computer or a burning tool is not available at hand is solved.
Detailed Description
The following further illustrates preferred embodiments of the invention:
A method of copying and rewriting an android system via a USB storage device, the method comprising the steps of:
firstly, normally starting an android system, checking application starting of a USB storage device, and starting monitoring whether the USB storage device is inserted;
secondly, after the USB storage equipment is checked, whether the USB storage equipment has the starting file or not is checked, if the USB storage equipment does not have the starting file, the step one is returned, and the insertion of other USB storage equipment is continuously monitored; if the starting file is checked, analyzing the file, and judging whether a copying mode or a pasting mode is to be carried out;
if the system software is in the copy mode, acquiring the size of the system software and the size of the space of the USB storage equipment, wherein the size of the system software comprises the whole partition and a recovery single partition, and returning to the step one if the size of the system software is larger than the space of the USB storage equipment, and continuously monitoring the insertion of other USB storage equipment; if the size of the system software is smaller than the storage space of the USB storage device, executing commands are copied into the USB storage device, the executed commands are combined by dd commands, the starting file is modified into a paste mode, and chip information is written into the starting file;
If the mode is the paste mode, chip information in the starting file is analyzed and compared with chip information read from the android device, if the mode is the same platform, a flag bit to be pasted is written into a flash (partition), and the system is restarted; if the platform is not the same, the USB storage device cannot be pasted, otherwise, the pasting system has problems, and the step I is returned to, and the insertion of other USB storage devices is continuously monitored;
step four, if the system is restarted, entering u-boot, reading the flag bit by the u-boot, and if the flag bit is to be pasted, starting recovery in the USB storage device; if the flag bit is not pasted, returning to the step one, and continuously monitoring the insertion of other USB storage equipment;
And sixthly, reading the flag bit after recovery in the USB storage device is started, if the flag bit is a paste flag bit, starting a paste flow to write the software in the USB storage device back to the system (the paste flow is integrated by dd commands), restarting the system, and entering a new software system.
the method is a method for copying and rewriting the android system through the USB storage device, is only applied to debugging software at present, and commercial software does not have the function, and mainly solves the following two problems:
1. When the original software package of the android device is lost or the software version number is unknown, the software in the android device is copied to one or more other devices.
2. and when an upgrade package, a computer or a burning tool is not available on hand, the software of one android device is synchronized to be the same as that of another device.
Although the invention has been described and illustrated in some detail, it should be understood that various modifications may be made to the described embodiments or equivalents may be substituted, as will be apparent to those skilled in the art, without departing from the spirit of the invention.

Claims (4)

1. A method for copying and rewriting an android system through a USB storage device is characterized by comprising the following steps:
firstly, normally starting an android system, checking application starting of a USB storage device, and starting monitoring whether the USB storage device is inserted;
Secondly, after the USB storage equipment is checked, whether the USB storage equipment has the starting file or not is checked, if the USB storage equipment does not have the starting file, the step one is returned, and the insertion of other USB storage equipment is continuously monitored; if the starting file is checked, analyzing the file, and judging whether a copying mode or a pasting mode is to be carried out;
If the mode is the copy mode, acquiring the size of system software and the space size of the USB storage equipment, and if the size of the system software is larger than the space size of the USB storage equipment, returning to the step one, and continuously monitoring the insertion of other USB storage equipment; if the size of the system software is smaller than the storage space of the USB storage device, executing a command to copy the system software into the USB storage device, modifying the starting file into a paste mode, and writing chip information into the starting file;
If the mode is the paste mode, chip information in the starting file is analyzed and compared with chip information read from the android device, if the mode is the same platform, the flag bit to be pasted is written into a flash, and the system is restarted; if the platform is not the same, the USB storage device cannot be pasted, the step I is returned, and the insertion of other USB storage devices is continuously monitored;
step four, if the system is restarted, entering u-boot, reading the flag bit by the u-boot, and if the flag bit is to be pasted, starting recovery in the USB storage device; if the flag bit is not pasted, returning to the step one, and continuously monitoring the insertion of other USB storage equipment;
and sixthly, reading the flag bit after recovery in the USB storage device is started, starting a pasting process to write the software in the USB storage device back to the system if the flag bit is pasted, restarting the system, and entering a new software system.
2. The method for copying and rewriting an android system through a USB storage device according to claim 1, wherein: in step three, the system software size includes the entire partition plus recovery single partition.
3. The method for copying and rewriting an android system through a USB storage device according to claim 1, wherein: in step three, the executed commands are assembled from dd commands.
4. the method for copying and rewriting an android system through a USB storage device according to claim 1, wherein: in step six, the paste flow is integrated by dd commands.
CN201910760359.1A 2019-08-16 2019-08-16 method for copying and rewriting android system through USB storage equipment Pending CN110580169A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910760359.1A CN110580169A (en) 2019-08-16 2019-08-16 method for copying and rewriting android system through USB storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910760359.1A CN110580169A (en) 2019-08-16 2019-08-16 method for copying and rewriting android system through USB storage equipment

Publications (1)

Publication Number Publication Date
CN110580169A true CN110580169A (en) 2019-12-17

Family

ID=68811679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910760359.1A Pending CN110580169A (en) 2019-08-16 2019-08-16 method for copying and rewriting android system through USB storage equipment

Country Status (1)

Country Link
CN (1) CN110580169A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004318487A (en) * 2003-04-16 2004-11-11 Bokushi Mutsukawa Usb memory with automatic copying function
CN101788913A (en) * 2009-01-23 2010-07-28 余俊德 Computer system with double operating devices and monitoring method thereof
CN102707968A (en) * 2012-04-12 2012-10-03 华平信息技术股份有限公司 Method and system for generating installation backup system
CN104461653A (en) * 2014-12-29 2015-03-25 浪潮电子信息产业股份有限公司 Method for installing NeoKylin Linux system on Loongson 3B server through USB flash disk
CN107943530A (en) * 2017-11-02 2018-04-20 安徽科微智能科技有限公司 USB interface-based unmanned boat system automatically updating method
US20180173517A1 (en) * 2016-12-19 2018-06-21 Vmware, Inc. Operating system update management for enrolled devices
CN108509215A (en) * 2018-03-22 2018-09-07 广州视源电子科技股份有限公司 A kind of replacing options of system software, device, terminal device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004318487A (en) * 2003-04-16 2004-11-11 Bokushi Mutsukawa Usb memory with automatic copying function
CN101788913A (en) * 2009-01-23 2010-07-28 余俊德 Computer system with double operating devices and monitoring method thereof
CN102707968A (en) * 2012-04-12 2012-10-03 华平信息技术股份有限公司 Method and system for generating installation backup system
CN104461653A (en) * 2014-12-29 2015-03-25 浪潮电子信息产业股份有限公司 Method for installing NeoKylin Linux system on Loongson 3B server through USB flash disk
US20180173517A1 (en) * 2016-12-19 2018-06-21 Vmware, Inc. Operating system update management for enrolled devices
CN107943530A (en) * 2017-11-02 2018-04-20 安徽科微智能科技有限公司 USB interface-based unmanned boat system automatically updating method
CN108509215A (en) * 2018-03-22 2018-09-07 广州视源电子科技股份有限公司 A kind of replacing options of system software, device, terminal device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
唐锐等: "《系统安装与重装》", 31 January 2010, 电脑报电子音像出版社 *

Similar Documents

Publication Publication Date Title
CN110716845B (en) Log information reading method of Android system
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
US10228993B2 (en) Data dump for a memory in a data processing system
CN109710317B (en) System starting method and device, electronic equipment and storage medium
JP2009522664A (en) Method and system usable in sensor networks to handle memory failures
CN111708738B (en) Method and system for realizing interaction of hadoop file system hdfs and object storage s3 data
JP2008502968A (en) Method for loading software comprising an intermediate object-oriented language onto a portable device
CN114222975A (en) Data preservation using memory aperture flush sequence
CN110659256A (en) Multi-computer room synchronization method, computing device and computer storage medium
US10853224B2 (en) Indexing and searching a time-travel trace for arbitrary length/arbitrary alignment values
JP2008009721A (en) Evaluation system and evaluation method thereof
CN111258666A (en) Reading method and device of computer file, computer system and storage medium
CN112445780A (en) Master-slave architecture deployment method and device based on snapshot
CN108897576A (en) A method of the quick start BOOT based on ARM chip
CN110764962A (en) Log processing method and device
US9588884B2 (en) Systems and methods for in-place reorganization of device storage
US20130167138A1 (en) Method and apparatus for simulating installations
CN108334453B (en) File debugging method and device, terminal equipment and storage medium
CN110471828B (en) Operating system testing method, device and equipment thereof
CN110580169A (en) method for copying and rewriting android system through USB storage equipment
US8819494B2 (en) Automatically changing parts in response to tests
CN106940681B (en) Method for debugging storage software by using tracking function and analysis tool
CN115237889A (en) Database switching method and device, storage medium and computer equipment
CN111367512B (en) Method and device for creating Android library module dependency relationship in application development
US7539839B1 (en) Method to test error recovery with selective memory allocation error injection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191217