In this section, the server component, which is responsible for parsing, decompiling, and recompiling APK files, is evaluated. A list of mobile applications and their application identifiers are first collected to be used in this evaluation process. The applications used for refactoring are the ones investigated by the researchers in [130]. Due to the unavailability of some links of the applications provided in the paper, alternative applications are used as shown in Table 6.11. The applications are widely used in conducting MCC studies by researchers [130].
This main goals of conducting this experiment are to explore the computational costs of refactoring mobile cloud applications and whether it is feasible in practice. The limitations of the refactoring process can also be explored through retargeting Android market applications, which will be discussed in Section 6.7. The answers to these questions will determine the degree to which this is a useful tool for extracting code for further analysis.
Application Name Application ID
Sudoku game org.moire.opensudoku N-Queens game com.memmiolab.queens Gobang game ric.ov.SimplyGomoku Video downloader for Twitter com.billApps.VTLoader OpenCV face detection com.ollieteam.facedetection Photoshoot Game com.appsdgl.photoPuzzle DealsPure app com.dealspure.wild Opera Mini Browser com.opera.mini.native Bing Image Search de.devmil.muzei.bingimage Flickr Mobile pl.eprogmedia.flickrmobile Linpack org.skynetsoftware.linpack BBC News bbc.mobile.news.ww
Smart News jp.gocro.smartnews.android Euro News com.euronews.express Twitter Lite com.twitter.android.lite Last.fm com.adriannieto.lastfmtops Chess Game com.cnvcs.chess
Basic Physics com.zayaninfotech.physics Antivirus com.antivirus.applock Photoshop Viewer com.psd.viewer
Applock mobilesecurity.applockfree Expense Manager com.mlab.expense.manager
6.5 Application Refactoring Evaluation 155
6.5.1 Experimental Environment
The edge server identified as (Edge-3) in the previous experiment is used to conduct this test. MAMoC Server uses a Python library called Androguard to aid with the process of parsing and analysing APKs. Under the hoods, Androguard uses Jadx tool which was described in Section 5.6.2.2 as a tool used in MAMoC Client for decompiling the Java codes from the application bytecode in the Host Mobile Device. The steps of application refactoring were explained earlier in Section 5.7.2.4. The same steps are applied to each application in this experiment. The following metrics are collected in the process:
• Total number of classes: this counts every class which are produced from the decompilation process of the application.
• Total number of methods: each class contains a number of methods that are all aggregated into this field.
• Filtered classes: the dx.get_classes() method provided by AndroGuard returns a list of ClassAnalysis objects with some of them labelled as “EX- TERNAL”. This label indicates that the source code of the class is not defined within the DEX files that are loaded inside the analysis. For example, java.io.FileNotFoundException is an API class, and it is not included in the DEX files as it is available on the system.
• Classes with code: Some of the classes are resource or layout related classes that do not contain any Java code. Only the classes with code are filtered for further analysis.
• Offloadable classes: the filtered classes with codes are scanned for depen- dency on any native device features and Android-specific library calls. The classes that only contain pure Java code and can be executed on JVM are marked and annotated as @Offloadable.
• Elapsed time: this is the time taken from the start of the analysis until the offloadable classes are identified and annotated.
6.5.2 Results and Analysis
The application IDs are saved in a text file and passed to the application refactor component in MAMoC Server to be read. The script starts by downloading the APK and applying the steps described in Section 5.7.2.4 for each file. The
output is a text file that includes the metrics and a signed APK file to be distributed and installed to the mobile devices.
It can be observed from the refactoring results, the smaller apps with fewer classes and methods are processed in a shorter time. However, this pattern is not standard among all the apps, for instance, the Sudoku app with a lower number of classes took 16.95 seconds to be processed while the N-Queens app with a higher number of classes took 11.31 seconds. Meanwhile, the GoBang game which has less than half the number of classes compared with the Sudoku and N-Queens takes about 5 times longer to be processed.
For the larger apps such as Opera browser and BBC apps with over 20,000 classes, it can take up to or more than 10 minutes to produce the results which can be impractical in real-life scenarios.
Application ID Classes Methods Filtered
classes withClasses code Offload- -ables Time (in sec) org.moire.opensudoku 1208 8795 401 394 100 16.95 com.memmiolab.queens 1486 11268 33 28 17 11.31 ric.ov.SimplyGomoku 620 3506 278 267 32 77.83 com.billApps.VTLoader 8238 51577 5894 5790 272 250.29 com.ollieteam.facedetection 5882 35010 4490 4453 18 197.16 com.appsdgl.photoPuzzle 3114 19977 1823 1789 30 130.08 com.dealspure.wild 2059 14502 548 535 52 21.89 com.opera.mini.native 20173 102465 18386 17972 5968 571.76 de.devmil.muzei.bingimage 3212 20574 1386 1302 34 58.03 pl.eprogmedia.flickrmobile 3419 26610 945 880 43 64.27 org.skynetsoftware.linpack 38 117 9 9 1 1.79 bbc.mobile.news.ww 23838 119000 20337 19983 4257 689.46 jp.gocro.smartnews.android 9947 62031 8213 7977 1130 302.01 com.euronews.express 9231 58811 7261 7038 1168 270.51 com.twitter.android.lite 2464 14169 1901 1859 303 85.91 com.adriannieto.lastfmtops 3670 22881 2021 1961 635 135.82 com.cnvcs.chess 2258 11163 1886 1853 3 125.1 com.zayaninfotech.physics 712 4352 217 206 13 11.56 com.antivirus.applock 11096 62213 8840 8641 804 341.17 com.psd.viewer 11149 65752 9735 9552 3215 375.04 mobilesecurity.applockfree 5207 28725 3424 3360 140 192.07 com.mlab.expense.manager 15564 101512 11788 11281 1163 537.27
Table 6.12 Application refactoring evaluation results
Table 6.12 shows the results of running the application refactor component in MAMoC Server for the selected benchmarking applications.