CN102331940A - Method and system for loading applications on Android mobile phones - Google Patents
Method and system for loading applications on Android mobile phones Download PDFInfo
- Publication number
- CN102331940A CN102331940A CN201110172858A CN201110172858A CN102331940A CN 102331940 A CN102331940 A CN 102331940A CN 201110172858 A CN201110172858 A CN 201110172858A CN 201110172858 A CN201110172858 A CN 201110172858A CN 102331940 A CN102331940 A CN 102331940A
- Authority
- CN
- China
- Prior art keywords
- reflection
- application
- address
- application program
- binaries
- 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
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention relates to a method and a system for loading applications on Android mobile phones. The method includes the following steps: step 1: judging whether a loading address for the binary image of an application is within a conflict range or not; if yes, step 2 is executed, or else loading the binary image of the application onto an Android mobile phone with a middleware; step 2: modifying the base address of the binary image of the application to evade the conflict range, and loading the binary image of the application onto the Android mobile phone with the middleware according to the modified base address of the binary image of the application; and the application is not an application based on an Android operating system. The invention solves the problem that loading can fail when the binary image of the WinCE is operated by the Wine application on the Android mobile phone.
Description
Technical field
The present invention relates to moving communicating field, relate in particular to a kind of method and system of pacifying on the Zhuo Shouji that application program is loaded into.
Background technology
The intelligent mobile terminal device that with the mobile phone is representative is an important development direction of computer technology, is again the very fierce market of a competition.Since Google and open mobile phone tall and erect (Android) operating system of alliance's release peace and mobile phone based on Android operating system, on world's mobile phone market, occupied no small share soon, various Android mobile phones emerge in an endless stream.
So-called Android operating system; Be actually a kind of reorganization and expansion to (SuSE) Linux OS; Its kernel is exactly the kernel of Linux basically; But but done significantly to improve and strengthen to the characteristics of mobile phone and mobile terminal device specially at user's space, these changes mostly with programming mode and graphical interfaces, promptly graphic user interface (GUI) is relevant.Fig. 1 has shown the memory pattern of WinCE and (SuSE) Linux OS.
In order to let existing WinCE application program on the Android mobile phone, move, need to utilize Wine application program to carry out the WinCE application program through transplanting.But the Wine application program is to desktop Windows operating system exploitation at first, and there is following problem in the application program of on the Android mobile phone, moving WinCE through the Wine application program:
At first; Different with the desktop window application; There is not the problem of compatible 16 application programs in the WinCE application program, need not to keep minimum DOS space, so the development environment of the application program of WinCE is often very lowly fixed executable application programs reflection loading address; 0x10000 for example, and don't relocation information is provided; And the Wine application program has kept the 0x110000 of user's space address least significant end, and promptly use is not allowed in the space of 17 64KB.Therefore when the application program of WinCE is loaded through Wine, the problem of failure can appear loading.
Secondly, in order to carry out the application program of WinCE, Wine Server can generate wine-pthread, and wine-pthread and WinCE target images belong to same address space, therefore possibly form conflict.
Summary of the invention
In order to solve above-mentioned technical matters, provide a kind of application program has been loaded into the method and system on the peace Zhuo Shouji, its purpose is, has solved the problem of loading failure when on the Android mobile phone, passing through Wine application program operation WinCE binary image.
The invention provides and a kind of application program is loaded into the method for peace on the Zhuo Shouji, comprising:
Step 1 judges whether the loading address of application binaries reflection is in conflict range; If, execution in step 2, otherwise middleware is loaded into the application binaries reflection on the peace Zhuo Shouji;
Step 2, the base address of revising the application binaries reflection is to avoid conflict range, and middleware is loaded into the application binaries reflection on the peace Zhuo Shouji according to the base address of amended application binaries reflection;
Wherein, said application program is not based on the application program of the tall and erect operating system of peace.
In one example, said application program is the application program based on WinCE operating system or WindowsMobile operating system; Said middleware is the Wine application program.
In one example; In the step 1, the base address of application binaries reflection is more than or equal to 0x110000, and the base address does not have when occupied; The loading address of application binaries reflection is not in conflict range, otherwise the loading address of application binaries reflection is in conflict range.
In one example, in the step 3, revise the base address of application binaries reflection through the map_view function in the Wine application program; It is NULL that second of map_view function imported parameter into.
In one example, this method also comprises step 4, and the mapping address of the wine-pthread that Wine Server generates is set to 0x80000000.
The invention provides and a kind of application program is loaded into the system of peace on the Zhuo Shouji, comprising:
The conflict determination module is used to judge whether the loading address of application binaries reflection is in conflict range;
The address modification module, when being used for being in conflict range in the loading address of application binaries reflection, the base address of revising the application binaries reflection is to avoid conflict range;
Middleware when being used for not being in conflict range in the loading address of application binaries reflection, being loaded into the application binaries reflection according to this loadings address of application binaries reflection and pacifying on the Zhuo Shouji; Perhaps the base address according to amended application binaries reflection is loaded into the application binaries reflection on the peace Zhuo Shouji;
Wherein, said application program is not based on the application program of the tall and erect operating system of peace.
In one example, said application program is the application program based on WinCE operating system or WindowsMobile operating system; Said middleware is the Wine application program.
In one example; In the base address of application binaries reflection more than or equal to 0x110000; And the base address does not have when occupied, and the loading address of application binaries reflection is not in conflict range, otherwise the loading address of application binaries reflection is in conflict range.
In one example, the map_view function in the Wine application program is revised the base address of application binaries reflection; It is NULL that second of map_view function imported parameter into.
In one example, the address modification module, the mapping address that also is used for the wine-pthread of Wine Server generation is set to 0x80000000.
The invention solves the problem of loading failure when on the Android mobile phone, passing through Wine application program operation WinCE binary image; Need not the operating system of mobile phone is made amendment; The collision detection of mapping address and the process that remaps are transparent fully to the user.
Description of drawings
Fig. 1 is the memory pattern of WinCE and (SuSE) Linux OS;
Fig. 2 is that WinCE application binaries reflection is redirected the process flow diagram that loads on the Android mobile phone.
Embodiment
The present invention is directed on the Android mobile phone problem of moving the address space conflicts that the WinCE application program produces through Wine; Designed a kind of technical scheme that the WinCE binary image is loaded on the Android mobile phone; Do not provide under the situation of relocation information at WinCE application binaries reflection; Need not carry out the modification of Android cell phone system kernel, solve the WinCE application program smoothly and on the Android mobile phone, load the problem that failure occurs through the Wine application program.
The flow process that application program is loaded on the Android mobile phone provided by the invention is as shown in Figure 2, comprising:
In order to realize above-mentioned flow process, need make amendment to the source code of Wine application program:
1, revise the Wine source code ntdll in map_image () function
2, in function m map_init (), increase conditional compilation
#if?defined(_DOS_Reserve_)
……
#endif
Above-mentioned conditional compilation module only _ when DOS_Reserve_ is defined, just compiled, and during the Wine application program of on compiling Android mobile phone, moving, this variable is not defined, so this module can not compiled.
3, wine-pthread is positioned at the address realm of 0x80000000
Increase by one and connect script load Script (loader/wine.lds), wherein critical code is:
Though the main purpose of the present invention is the WinCE binary image and on the Android mobile phone, is redirected the method for loading, in fact also is applicable to the redirected loading of Windows Mobile binary image on the Android mobile phone.
Those skilled in the art can also carry out various modifications to above content under the condition that does not break away from the definite the spirit and scope of the present invention of claims.Therefore scope of the present invention is not limited in above explanation, but confirm by the scope of claims.
Claims (10)
1. one kind is loaded into the method for peace on the Zhuo Shouji with application program, it is characterized in that, comprising:
Step 1 judges whether the loading address of application binaries reflection is in conflict range; If, execution in step 2, otherwise middleware is loaded into the application binaries reflection on the peace Zhuo Shouji;
Step 2, the base address of revising the application binaries reflection is to avoid conflict range, and middleware is loaded into the application binaries reflection on the peace Zhuo Shouji according to the base address of amended application binaries reflection;
Wherein, said application program is not based on the application program of the tall and erect operating system of peace.
2. the described method of claim 1 is characterized in that, said application program is the application program based on WinCE operating system or Windows Mobile operating system; Said middleware is the Wine application program.
3. the described method of claim 2; It is characterized in that; In the step 1, the base address of application binaries reflection is more than or equal to 0x110000, and the base address does not have when occupied; The loading address of application binaries reflection is not in conflict range, otherwise the loading address of application binaries reflection is in conflict range.
4. the described method of claim 2 is characterized in that, in the step 3, revises the base address of application binaries reflection through the map_view function in the Wine application program; It is NULL that second of map_view function imported parameter into.
5. the described method of claim 2 is characterized in that, this method also comprises step 3, and the mapping address of the wine-pthread that WineServer generates is set to 0x80000000.
6. one kind is loaded into the system of peace on the Zhuo Shouji with application program, it is characterized in that, comprising:
The conflict determination module is used to judge whether the loading address of application binaries reflection is in conflict range;
The address modification module, when being used for being in conflict range in the loading address of application binaries reflection, the base address of revising the application binaries reflection is to avoid conflict range;
Middleware when being used for not being in conflict range in the loading address of application binaries reflection, being loaded into the application binaries reflection according to this loadings address of application binaries reflection and pacifying on the Zhuo Shouji; Perhaps the base address according to amended application binaries reflection is loaded into the application binaries reflection on the peace Zhuo Shouji;
Wherein, said application program is not based on the application program of the tall and erect operating system of peace.
7. system as claimed in claim 6 is characterized in that, said application program is the application program based on WinCE operating system or Windows Mobile operating system; Said middleware is the Wine application program.
8. system as claimed in claim 7; It is characterized in that; In the base address of application binaries reflection more than or equal to 0x110000; And the base address does not have when occupied, and the loading address of application binaries reflection is not in conflict range, otherwise the loading address of application binaries reflection is in conflict range.
9. system as claimed in claim 7 is characterized in that, the map_view function in the Wine application program is revised the base address of application binaries reflection; It is NULL that second of map_view function imported parameter into.
10. system as claimed in claim 7 is characterized in that, the address modification module, and the mapping address that also is used for the wine-pthread of Wine Server generation is set to 0x80000000.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110172858A CN102331940A (en) | 2011-06-24 | 2011-06-24 | Method and system for loading applications on Android mobile phones |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110172858A CN102331940A (en) | 2011-06-24 | 2011-06-24 | Method and system for loading applications on Android mobile phones |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102331940A true CN102331940A (en) | 2012-01-25 |
Family
ID=45483726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110172858A Pending CN102331940A (en) | 2011-06-24 | 2011-06-24 | Method and system for loading applications on Android mobile phones |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102331940A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371920A (en) * | 2016-08-24 | 2017-02-01 | 天脉聚源(北京)传媒科技有限公司 | Method and apparatus for avoiding memory address conflict |
CN106598596A (en) * | 2016-12-14 | 2017-04-26 | 天津光电通信技术有限公司 | OpenCL image processing method based on Androrid platform |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1310387A (en) * | 2000-02-21 | 2001-08-29 | 英业达股份有限公司 | Dynamic positioning method for repeated resource |
US20080127149A1 (en) * | 2006-11-28 | 2008-05-29 | Nicolai Kosche | Method and Apparatus for Computing User-Specified Cost Metrics in a Data Space Profiler |
CN101246427A (en) * | 2007-02-15 | 2008-08-20 | 凌阳科技股份有限公司 | Method for relocated loading application program and address relocation device |
-
2011
- 2011-06-24 CN CN201110172858A patent/CN102331940A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1310387A (en) * | 2000-02-21 | 2001-08-29 | 英业达股份有限公司 | Dynamic positioning method for repeated resource |
US20080127149A1 (en) * | 2006-11-28 | 2008-05-29 | Nicolai Kosche | Method and Apparatus for Computing User-Specified Cost Metrics in a Data Space Profiler |
CN101246427A (en) * | 2007-02-15 | 2008-08-20 | 凌阳科技股份有限公司 | Method for relocated loading application program and address relocation device |
Non-Patent Citations (1)
Title |
---|
王燕凤等: "利用WINE实现Windows到Linux的转换", 《计算机与现代化》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371920A (en) * | 2016-08-24 | 2017-02-01 | 天脉聚源(北京)传媒科技有限公司 | Method and apparatus for avoiding memory address conflict |
CN106598596A (en) * | 2016-12-14 | 2017-04-26 | 天津光电通信技术有限公司 | OpenCL image processing method based on Androrid platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6912583B2 (en) | Service processing method and equipment | |
KR102059705B1 (en) | Adaptive portable libraries | |
US8607224B2 (en) | System for packaging native program extensions together with virtual machine applications | |
US10846101B2 (en) | Method and system for starting up application | |
US9639329B2 (en) | System and method for automatic invocation of constructor code for superclasses | |
CN103970563B (en) | The method of dynamic load Android class | |
US20170242664A1 (en) | Method, apparatus, system, and non-transitory computer readable medium for extending at least one function of a package file | |
US20120254831A1 (en) | Supporting hardware configuration changes in a uefi firmware component | |
US20130283235A1 (en) | Build system redirect | |
US20060190933A1 (en) | Method and apparatus for quickly developing an embedded operating system through utilizing an automated building framework | |
US9164735B2 (en) | Enabling polymorphic objects across devices in a heterogeneous platform | |
WO2019005228A1 (en) | Automated source code adaption to inject features between platform versions | |
WO2015074526A1 (en) | Method and apparatus for injecting java by tecode into target process | |
CN111857765B (en) | Plug-in system for drug design system, and generation method and updating method thereof | |
CN103218428B (en) | A kind of dynamic link method and system | |
CN102364433B (en) | Method for realizing Wine construction tool transplanting on ARM (Advanced RISC Machines) processor | |
CN107943544B (en) | Kernel patch loading method and device | |
US10310863B1 (en) | Patching functions in use on a running computer system | |
WO2022017242A1 (en) | Method and apparatus for running second system application in first system, device, and medium | |
CN115390945A (en) | Application program running method and device, electronic equipment and readable storage medium | |
CN102364442A (en) | Method for transplanting Wine from x86 to advanced risc machine (ARM) platform | |
CN109960511B (en) | Dynamic library issuing method based on virtualization technology, storage medium and intelligent terminal | |
CN107430664B (en) | Control flow integrity with managed and unmanaged code | |
CN102169446B (en) | BIOS (basic input/output system) system and method based on basic input/output system of open source system | |
CN102331940A (en) | Method and system for loading applications on Android mobile phones |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20120125 |