├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── CHANGELOG.txt ├── LICENSE ├── OSBuild.iml ├── Other ├── OSBuild_v1.1.0(150606).apk ├── OSBuild_v1.1.4(150610).apk ├── OSBuild_v1.2.0(150628).apk ├── OSBuild_v1.2.7(150708).apk ├── OSBuild_v1.3.0(150723).apk ├── OSBuild_v1.4.0(150830).apk ├── OSBuild_v1.4.3(150911).apk ├── OSBuild_v1.4.7(150928).apk ├── OSBuild_v1.4.9(151115).apk ├── extra_raw_694.db ├── icon.png └── screenshot.png ├── README.md ├── app ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── fonts │ │ └── Monaco.ttf │ ├── java │ └── com │ │ └── by_syk │ │ └── osbuild │ │ ├── MainActivity.java │ │ ├── ReaderActivity.java │ │ ├── WhitePaperActivity.java │ │ ├── util │ │ ├── AndroidManifestUtil.java │ │ ├── C.java │ │ ├── ConstUtil.java │ │ ├── ExtraUtil.java │ │ ├── MinSDKVersionUtil.java │ │ └── UnitUtil.java │ │ └── widget │ │ └── MyTextView.java │ └── res │ ├── anim-v21 │ ├── anim_right_in.xml │ └── button_elevation.xml │ ├── anim │ ├── anim_alpha_in.xml │ └── layout_anim.xml │ ├── drawable-v21 │ ├── ic_action_share.xml │ ├── ic_fab_top.xml │ └── oval_ripple.xml │ ├── layout-v21 │ └── activity_main.xml │ ├── layout-v4 │ └── activity_main.xml │ ├── layout │ ├── activity_reader.xml │ ├── activity_white_paper.xml │ ├── dialog_file.xml │ ├── dialog_input.xml │ ├── dialog_text.xml │ ├── dialog_text_ask.xml │ └── dialog_unicode.xml │ ├── menu-v11 │ ├── menu_main.xml │ └── menu_reader.xml │ ├── menu-v4 │ ├── menu_main.xml │ └── menu_reader.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── raw │ ├── app_module.const │ ├── ascii.txt │ ├── build_module.const │ ├── cpu_module.const │ ├── display_module.const │ ├── extra_77_694.db │ ├── memory_module.const │ ├── package_module.const │ ├── sensor_module.const │ └── telephony_module.const │ ├── values-v11 │ └── styles.xml │ ├── values-v19 │ └── styles.xml │ ├── values-v21 │ ├── dimens.xml │ └── styles.xml │ ├── values-v4 │ └── styles.xml │ └── values │ ├── arrays.xml │ ├── colors.xml │ ├── dimens.xml │ ├── integers.xml │ └── strings.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.idea/.name: -------------------------------------------------------------------------------- 1 | OSBuild -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 1.7 32 | 33 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | v1.4.9.nightly 2015-11-15 2 | Remove the node "devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/devfreq/" for "MSM8974PRO" CPU in CPU Module. 3 | Check box of "Don't show again." is always visible in dialogs. 4 | Add extra info for more devices (690+). 5 | 6 | v1.4.9.nightly 2015-11-06 7 | Update Google Install Stats in "Constant Reference". 8 | Add extra info for more devices (670+). 9 | 10 | v1.4.8.nightly 2015-10-24 11 | Add some data of release date after the line "SDK_INT" in Build Module. 12 | 13 | v1.4.8.nightly 2015-10-12 14 | Add the node "devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/devfreq/" for "MSM8974PRO" CPU in CPU Module. 15 | 16 | v1.4.8.nightly 2015-10-07 17 | Update Google Install Stats in "Constant Reference". 18 | 19 | v1.4.8.nightly 2015-10-03 20 | Fix the BUG: it crashes when launching OSBuuld Reader with NULL URI. 21 | Fix the BUG: it crashes if the content of text file is empty in OSBuild Reader. 22 | 23 | v1.4.7.nightly 2015-09-26 24 | Fix the BUG: it crashes if the signatures is null in App Module. 25 | 26 | v1.4.7.nightly 2015-09-17 27 | Add the line "minSdkVersion" in App Module. 28 | OSBuild Reader could read AndroidManifest.xml of .apk file. 29 | 30 | v1.4.6.nightly 2015-09-15 31 | Remember what was selected last time in "Installed" of "Check App". 32 | Add the node "PackageManager" and its line "getComponent()" in Primer Module. 33 | 34 | v1.4.5.nightly 2015-09-14 35 | Fix the issue: wrong method to analyse signatures info in the line "getIssuerDN()" (like "Google, Inc" to "Google" and "Inc"). 36 | Add extra info for more devices (500+). 37 | Add unit "mm" after the line "Dimensions" in Primer Module. 38 | Show lightness value in White Paper Activity. 39 | 40 | v1.4.4.nightly 2015-09-13 41 | Hide the line "flags & FLAG_SYSTEM" when the app is not installed in App Module. 42 | 43 | v1.4.4.nightly 2015-09-12 44 | Add the node "/sys/class/kgsl/kgsl-3d0/" in CPU Module. 45 | Show file name as a subtitle on the ActionBar in OSBuild Reader. 46 | 47 | v1.4.3.nightly 2015-09-11 48 | Tap ENTER to perform related operation instead of just closing the soft keyboard in dialogs. 49 | Add the lines "CPU_ABI" and "CPU_ABI2" in Build Module (API 21-). 50 | Fix the issue: wrong method to convert unit of frequency. Fortunately, the result is correct still. 51 | Optimize the launcher icon for mdpi devices. 52 | 53 | v1.4.3.nightly 2015-09-10 54 | Click hard search button (if there is one) to open the dialog "Check App" quickly. 55 | Add the VM type ("Dalvik" or "ART") after the line "getProperty("java.vm.version")" in Build Module. 56 | 57 | v1.4.2.nightly 2015-09-08 58 | Fix the issue: it can't load extra info, execute "Share the Page" and "Share OSBuild" due to full external storage. 59 | Enlarge the database of extra info (up to 41 brands, 276 models). 60 | 61 | v1.4.2.nightly 2015-09-07 62 | Fix the BUG: it crashes because database which saves extra info is not loaded. 63 | 64 | v1.4.2.nightly 2015-09-06 65 | Add the line "Pixel & Screen Area" in Primer Module. 66 | Fix the BUG: wrong value in the line "cpuinfo_min_freq" in CPU Module. 67 | 68 | v1.4.2.nightly 2015-09-05 69 | Add a real value (not calculated) after the line "Diagonal Size" in Display Module. 70 | Add the line "Dimensions" and "Weight" after the node "Extra" in Display Module. 71 | Add a value (diagonal size) after the line "Screen Resolution" in Primer Module. 72 | Add the line "Dimensions" in Primer Module. 73 | 74 | v1.4.1.nightly 2015-09-03 75 | Show modules one by one more smoothly when launching. 76 | 77 | v1.4.1.nightly 2015-09-01 78 | Play animation when showing the FAB. 79 | The steps to get GPU info become more simple and controllable. 80 | 81 | v1.4.1.nightly 2015-08-31 82 | Modify the size of FAB icon from 36dp to 24dp. 83 | 84 | v1.4.0.nightly 2015-08-30 85 | Elimilate the risk: it crashes when clicking the FAB occasionally. 86 | Fix the BUG: It crashed when get telephony info due to "permission denied" in API 23+. 87 | Request for permission in API 23+. 88 | Fix the issue: the style of dialog "What's OSBuild?" is different. 89 | 90 | v1.4.0.nightly 2015-08-29 91 | Remember text size in OSBuild Reader. 92 | Fix the BUG: It crashes when open App Module by apk path on API 13- (because there is a BUG of Android 2.2 to get signature info). 93 | 94 | v1.4.0.nightly 2015-08-28 95 | Fix the BUG: It crashes when open App Module by apk path on Android 2.2 (because there is a BUG of Android 2.2 to get signature info). 96 | 97 | v1.4.0.nightly 2015-08-27 98 | Add lines "getNotBefore()", "getNotAfter()" and "getSigAlgName()" in App Module. 99 | Modify the line "getSubjectDN()" to "getIssuerDN()" in App Module. 100 | 101 | v1.4.0.nightly 2015-08-26 102 | Fix lost "GL_ES_VERSION_UNDEFINED" issue after the line "reqGlEsVersion" in Memory Module. 103 | Add the line "isLowRamDevice()" in Memory Module. 104 | Now OSBuild can check app by its apk path. 105 | 106 | v1.4.0.nightly 2015-08-25 107 | Add the line "targetSdkVersion" in App Module. 108 | Fix the BUG: It crashed when get telephony info due to "permission denied" in API 23+. 109 | Add the line "World Phone" in Primer Module (API 23+). 110 | Add lines "getPhoneCount()", "getDeviceId(0)", "getDeviceId(1)" and "isWorldPhone()" in Display Module (API 23+). 111 | Add the line "getTargetApi()" in App Module. 112 | 113 | v1.4.0.nightly 2015-08-24 114 | Adjust the length of dot line to the width of the page. 115 | 116 | v1.4.0.nightly 2015-08-23 117 | Fix the issue: the dialog "What's OSBuild?" do not show when launching firstly. 118 | Add lines "Hi-Fi", "Fingerprint ID" in Primer Module. 119 | 120 | v1.4.0.nightly 2015-08-22 121 | Fix the issue: the soft keyboard is still showing when open list of charsets dialog in OSBuild Reader. 122 | Remember what was searched last time in "Check Installed App". 123 | 124 | v1.4.0.nightly 2015-08-21 125 | Fix the BUG: OSBuild crashes when reading CPU info in some devices. 126 | 127 | v1.4.0.nightly 2015-08-20 128 | Remove menu options: "LogCat", "Rotation Vector", "Compass" and "PPI Calculator" in menu "Experimentally". 129 | Add color name in the cornor of "White Paper" layout. 130 | Fix the issue: indeterminate progress doesn't show on "OSBuild Reader". 131 | Set self-defined charset in "OSBuild Reader". 132 | Listening scale gesture to scale the text size (only 3: Small, Normal, Large) in "OSBuild Reader". 133 | Show experimental features as default (show the memu option "Experimentally"). So we need not long press button "OK" in dialog "Donate" to unlock it. 134 | Fix the issue: two same dialogs "What's OSBuild?" may show at the same time when launching firstly. 135 | Replace PNG icons to vender drawable described by XML. (API 21+) 136 | 137 | v1.4.0.nightly 2015-08-19 138 | Cancel entering "*" to back up all installed apps in the dialog "Check Installed App". 139 | Add button "List" to list all apps (package name) in the dialog "Check Installed App". 140 | Add vendor name after the line "getSensorList(TYPE_ALL)" in Sensor Module. 141 | 142 | v1.4.0.nightly 2015-08-18 143 | Cancel showing the launcher icon in App Module (for "Check Installed App"). 144 | Fix the BUG: scrolling horizontally skip to other module suddenly in the main page. 145 | Apply the custom color to AlertDialog (API 21+). 146 | Enter "*" to back up all installed apps in the dialog "Check Installed App". 147 | Add the node "BusyBox" in Root Module. 148 | 149 | v1.4.0.nightly 2015-08-17 150 | Update Google Install Stats in "Constant Reference". 151 | Remove menu option "Help Translate" in menu "More". 152 | Add menu option "Raise your voice" in menu "More". 153 | Slide the blank to control the text to scroll horizontally even if the text is not enough to fill the screen in vertical orientation. 154 | Add the line "requestedPermissions" in App Module (for "Check Installed App"). 155 | Add the count number after the line whose elements is a list. 156 | Fix the issue: sensors are not total in Sensor Module. 157 | Polish the article of dialog "Donate". 158 | 159 | v1.4.0.nightly 2015-08-15 160 | Add the line "online" after the node "/sys/devices/system/cpu/" in CPU Module. 161 | 162 | v1.4.0.nightly 2015-08-14 163 | Move Primer Module to the top. 164 | Add the line "Step Counter" in Primer Module. 165 | Adjust type setting slightly. 166 | 167 | v1.3.9.nightly 2015-08-13 168 | Rename menu "Small Tools" to "Experimentally" and "About" to "More". 169 | Long press the button "OK" on the dialog "Donate" to show new menu "Experimentally" directly. 170 | Change developer's E-mail. 171 | Add E-mail address after the line "Developer" in About Module. 172 | Add the line "flags & FLAG_DEBUGGABLE" in App Module (for "Check Installed App"). 173 | 174 | v1.3.9.nightly 2015-08-10 175 | Add the node "X509Certificate" in App Module (for "Check Installed App"). 176 | 177 | v1.3.8.nightly 2015-08-09 178 | Change "Share Installed App" to "Check Installed App" and add App Module. 179 | Add the menu option "Unicode Viewer" in the menu "Small Tools". 180 | 181 | v1.3.7.nightly 2015-08-08 182 | Fix lost "SCREEN_WIDTH_DP_UNDEFINED" issue after the line "screenWidthDp" and "SCREEN_HEIGHT_DP_UNDEFINED" after the line "screenHeightDp" in Display Module. 183 | Add the line "Navigation Bar" after the node "Extra" in Display Module. 184 | 185 | v1.3.6.nightly 2015-08-06 186 | Fix the issue: superfluous "\n" in the end of the file content. 187 | Improve the efficiency of "OSBuild Reader" and add character chooser ("UTF-8", "GBK"). 188 | Check "Dual SIM" more accurately in Primer Module. 189 | Add a number to log the version order after the first line in About Module. 190 | Fix the BUG: in some ROMs, reading "wpa_supplicant.conf" causes crash. 191 | More file explorers can open text file via "OSBuild Reader". 192 | 193 | v1.3.5.nightly 2015-08-05 194 | Add more elements to the line "Absentee(s)" in Primer Module. 195 | Delete some characters in "ascii.txt". 196 | Remove the menu option "Kube" in the menu "Small Tools". 197 | Add the menu option "PPI Calculator" in the menu "Small Tools". 198 | 199 | v1.3.5.nightly 2015-08-04 200 | Remove the node "NfcManager" in Package Module. 201 | Hide the scroll bar of HorizontalScrollView. 202 | 203 | v1.3.4.nightly 2015-08-03 204 | Add the node "ConsumerIrManager" in Package Module. 205 | Add the node "NfcManager" in Package Module. 206 | Add more elements to the line "Absentee(s)" in Primer Module. 207 | Fix the BUG: Wrong method to check "NFC" in Primer Module. Fortunately, the result is still correct before. 208 | 209 | v1.3.3.nightly 2015-08-02 210 | Add new Activity, "OSBuild Reader" so I can open txt file which is made by OSBuild from a File Explorer. 211 | Remove the line "isNetworkRoaming()" in Telephony Module. 212 | Click the FAB to skip over the Primer Module. 213 | 214 | v1.3.3.nightly 2015-08-01 215 | Add the line "getSimOperatorName()" after the node "TelephonyManager" in Telephony Module. 216 | Add the line "isNetworkRoaming()" after the node "TelephonyManager" in Telephony Module. 217 | Add the node "SubscriptionManager" in Telephony Module. 218 | Add the line "Dual SIM" in Primer Module. 219 | 220 | v1.3.2.nightly 2015-07-31 221 | Add more characters to "ascii.txt". 222 | 223 | v1.3.2.nightly 2015-07-29 224 | Add the line "getProperty("os.arch")" after the node "System" in Build Module. 225 | 226 | v1.3.2.nightly 2015-07-28 227 | Click the FAB to skip to certain position of ScrollView. 228 | 229 | v1.3.1.nightly 2015-07-25 230 | Show the line "SUPPORTED_ABIS" more reasonavly by changing to vertical way in Build Module. 231 | Add more elements to the line "Absentee(s)" in Primer Module. 232 | 233 | v1.3.1.nightly 2015-07-24 234 | Fit for Material Design more better, like adding Floating Action Button. 235 | Add the line "Absentee(s)" in Primer Module. However, it was hidden if its value were null. 236 | 237 | v1.3.0.nightly 2015-07-22 238 | Check "Heart Rate Monitor" more accurately in Primer Module. 239 | Add "/values-zh-rCN/" but hide in release version. 240 | 241 | v1.3.0.nightly 2015-07-21 242 | Add sub memus "ASCII Chart" in menu "Small Tools". 243 | Add the line "IR Transmitter" in Primer Module. 244 | Check "NFC" more accurately in Primer Module. 245 | 246 | v1.3.0.nightly 2015-07-20 247 | Add new constants "NETWORK_TYPE_GSM", "NETWORK_TYPE_TD_SCDMA" (@hide) to the line "getNetworkType" in Telephony Module. 248 | Launch firstly to get GPU info and show it. 249 | Add sub memus "Compass" in menu "Small Tools". 250 | Fix lost "CUR_DEVELOPMENT" issue after the line "SDK_INT" in Build Module. 251 | 252 | v1.3.0.nightly 2015-07-16 253 | Add sub menu "Rotation Vector" in menu "Small Tools". 254 | 255 | v1.3.0.nightly 2015-07-15 256 | Add the line "SUPPORTED_ABIS" in Build Module. (API 21) 257 | Add sub memus "White Paper", "Kube" in menu "Small Tools". 258 | 259 | v1.3.0.nightly 2015-07-14 260 | Remove the line "glGetString(GL_VERSION)" in CPU Module. 261 | Check "Gyroscope Sensor" more accurately in Primer Module. 262 | Check the node StorageManager more accurately in Memory Module. 263 | Add the menu "Small Tools" and "Share Installed App" as a sub menu. 264 | Do not rotate by "fullSensor". 265 | Fix the crash BUG of visiting GitHub. 266 | 267 | v1.2.9.nightly 2015-07-10 268 | Add stats to menu option CPU Module. 269 | Share more accurately. 270 | 271 | v1.2.8.nightly 2015-07-09 272 | Add the node "GL10" in CPU Module. 273 | 274 | v1.2.7.nightly 2015-07-08 275 | Rename "Device Brand" to "Brand & Manufacturer" in Primer Module. 276 | Move description of OSBuild from "/assets/desc.txt" to "strings.xml". 277 | Fix wrong Hardware info issue after the node "/proc/cpuinfo" in CPU Module. (In few devices, it's "vendor_id", not "Hardware".) 278 | Improve Primer Module. 279 | Add more sim operators after the line getSimOperator() in Telephony Module. 280 | 281 | v1.2.6.nightly 2015-07-07 282 | Restore "Device Brand" to raw value in Primer Module. 283 | Check more value "unknown" in Build Module. 284 | 285 | v1.2.6.nightly 2015-07-05 286 | Improve Primer Module. 287 | 288 | v1.2.5.nightly 2015-07-04 289 | Improve Primer Module. 290 | Fix lost "ESN" issue after the line "getDeviceId()" in Telephony Module. 291 | 292 | v1.2.4.nightly 2015-07-03 293 | Add BRAND param to shared text file name, like "MOTO_XT882_10__OSBuild_v1.2.4.nightly(150703).info.txt". 294 | Add Primer Module for non developers and place it on the top. 295 | Remove the first way to get cores of cpu from Runtime. 296 | Modify the style of CPU Module. 297 | 298 | v1.2.3.nightly 2015-07-02 299 | Add the line availMem after the node ActivityManager in Memory Module. 300 | Try to add a menu option User Mode. (I called the current mode Developer Mode.) 301 | Fix careless omission: "getVolumePaths()." to "getVolumePaths():". 302 | If the result of two methods to get cores of cpu are not the same, just show the second (by reading "/sys/devices/system/cpu/"). 303 | Remove "getSystemSharedLibraryNames()" after the node "PackageManager" in Package Module. 304 | 305 | v1.2.2.nightly 2015-07-01 306 | Add option "CPU Module" in menu option "Constant Reference". 307 | Move the node "Settings.Secure" from Telephony Module to Build Module. 308 | Try to add a new Activity to show something which is refreshed automatically. 309 | 310 | v1.2.1.nightly 2015-06-30 311 | Add "getSystemSharedLibraryNames()" after the node "PackageManager" in Package Module. 312 | Modify the style of CPU Module and add the line "scaling_governor" after the node "/sys/devices/system/cpu/cpu0/cpufreq/". 313 | Change stratege to read "wpa_supplicant.conf". (Because copying and reading it is not safe before.) 314 | Add the node "System" and lines "getProperty("os.version")", "getProperty("java.vm.version")" in Build Module. 315 | 316 | v1.2.0.nightly 2015-06-28 317 | Add warning dialog before reading "wpa_supplicant.conf". 318 | Fix API level issue: android:textIsSelectable requires API level 11. 319 | Fix API level issue: StorageManager requires API level 11. 320 | 321 | v1.2.0.nightly 2015-06-27 322 | Update "desc.txt". 323 | Open sources on GitHub and add button "GitHub" in dialog "Donate" to link to https://github.com/by-syk/OSBuild. 324 | Add option "bootprof" for devices with MTK chip in menu option "View System Files". 325 | Remove option "scaling_available_frequencies" in menu option "View System Files". 326 | Remove option "version" in menu option "System Settings". 327 | Add the node "Settings.Secure" in Telephony Module. 328 | 329 | v1.2.0.nightly 2015-06-24 330 | Add option "MIUI Cit" for Xiaomi devices in menu option "System Settings". 331 | Fix crash issue when showing description dialog (Activity has been destroyed). 332 | 333 | v1.2.0.nightly 2015-06-23 334 | Cut down padding in land layout. 335 | 336 | v1.2.0.nightly 2015-06-22 337 | Show description about OSBuild when launching firstly. 338 | Add option "wpa_supplicant.conf" in menu option "View System Files". (Need su permission.) 339 | Add the node "StorageManager" in Memory Module. 340 | Add the line "getNetworkType()" in TelephonyManager Module. 341 | Add option "scaling_available_frequencies" in menu option "View System Files". 342 | Make a distinction between file and folder, like /x/y/ (folder), /x/y (file). 343 | 344 | v1.1.9.nightly 2015-06-21 345 | Log launching times. 346 | Add some new resolution format after the line "Width-height Ratio" in Display Module. 347 | 348 | v1.1.8.nightly 2015-06-20 349 | Add mark like "wT" in the file name to indicate that the Telephony info is included. 350 | Fix issue in option "Memory Module" in menu option "Constant Reference". 351 | Remove value (double) after the line "Width-height Ratio" in Display Module. 352 | 353 | v1.1.7.nightly 2015-06-14 354 | Add Google Install Stats to "Constant Reference", including Platform Versions, Screen Sizes and Densities, Open GL Version. 355 | Add the line "reqGlEsVersion" after the node after the node "ActivityManager" in Memory Module. 356 | Remove the line "screenLayout & 48" after the node "Configuration" in Display Module. 357 | 358 | v1.1.7.nightly 2015-06-13 359 | Remove lines "kernel version" and "baseband version" in Build Module. 360 | 361 | v1.1.6.nightly 2015-06-12 362 | Add lines "kernel version" and "baseband version" in Build Module. 363 | Fix wrong Processor info issue after the node "/proc/cpuinfo" in CPU Module. (In Model M463C, it's "model name", not "Processor".) 364 | "Share" with "subject" (just file name). 365 | 366 | v1.1.5.nightly 2015-06-11 367 | Add "ic_menu_share.png" icons in "/mipmap-v21/". 368 | Fix wrong device type to "SCREENLAYOUT_SIZE_LARGE" issue after the line "screenLayout & 15" in Display Module. 369 | 370 | v1.1.4.nightly 2015-06-10 371 | Remove the line "Device Type" and add the line "screenLayout & 15" after the node "Configuration" in Display Module. 372 | Apply the style used in the page to "Donate" dialog. 373 | Add the line "screenLayout & 48" after the node "Configuration" in Display Module. 374 | Fix lost Package Module in shared text file issue. 375 | Remove the second puzzled value after the line "Diagonal Size" in Display Module. 376 | 377 | v1.1.3.nightly 2015-06-09 378 | Fix lost "DENSITY_280" issue after the line "densityDpi" in Display Module. 379 | Fix lost "MEDIA_UNMOUNTABLE" issue after the line "getExternalStorageState()" in Memory Module. 380 | Fix lost "TYPE_ALL" issue after "getSensorList()" in Sensor Module. 381 | Finish menu option "Constant Reference". 382 | Remove vertical mark "+" added in v1.1.1.nightly. 383 | Add another width-height ratio after the line "Width-height Ratio" in Display Module. 384 | Use round-off methed somewhere. 385 | 386 | v1.1.2.nightly 2015-06-08 387 | Add resolution format (like: HVGA) after the line "Width-height Ratio". 388 | Add "changelog.txt" located in "/assets/". 389 | Fix mistaken release date of "ECLAIR", "ECLAIR_0_1" issue after "SDK_INT" in Build Module. 390 | Add menu option "Constant Reference" to list all constants used. Unfinished. 391 | 392 | v1.1.1.nightly 2015-06-07 393 | Fix mistaken space issue. 394 | Add more mark "+". 395 | 396 | v1.1.0 2015-06-06 397 | Initial release. 398 | Based on OSBild(com.By_syk.OSBuild) finished and lost unexpectedly in this winter vocation. 399 | Modules: Build, Display, Telephony, CPU, Memory, Package, Sensor, SuperSu, Time and About. 400 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /OSBuild.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Other/OSBuild_v1.1.0(150606).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.1.0(150606).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.1.4(150610).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.1.4(150610).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.2.0(150628).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.2.0(150628).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.2.7(150708).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.2.7(150708).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.3.0(150723).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.3.0(150723).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.4.0(150830).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.4.0(150830).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.4.3(150911).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.4.3(150911).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.4.7(150928).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.4.7(150928).apk -------------------------------------------------------------------------------- /Other/OSBuild_v1.4.9(151115).apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/OSBuild_v1.4.9(151115).apk -------------------------------------------------------------------------------- /Other/extra_raw_694.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/extra_raw_694.db -------------------------------------------------------------------------------- /Other/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/icon.png -------------------------------------------------------------------------------- /Other/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/Other/screenshot.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OSBuild - FOR ANDROID DEVELOPERS 2 | 3 | ![icon.png](/Other/icon.png) 4 | 5 | Ever wanted to peek inside and know more about your device? Well, **OSBuild**, a simple, lightweight, clean and beautiful app, meets your needs. And it works on all phones running Android 2.2 and above! 6 | 7 | A simple UI and some nice features make it great tool especially for Android developers and learners. 8 | 9 | ### Features 10 | * List **RICH RAW** info about the device with keeping most programming words. 11 | * Provide **RICH** related data, like `19 KITKAT 4.4 2013-10 39.3% 19`. 12 | * List all features the system supported, such as `FEATURE_USB_HOST`. 13 | * Expose details of installed apps, including **SIGNATURE**. 14 | * **OPEN SOURCE**. You can see its source codes on [GitHub](https://github.com/by-syk/OSBuild "GitHub") to get useful code sections. 15 | 16 | ### Modules 17 | * Primer [the outline for average uses] 18 | * Build [`MODEL`, etc.] 19 | * Display [`densityDpi`, etc.] 20 | * Telephony [`getDeviceId()`, etc.] 21 | * CPU [`cpuinfo_max_freq`, etc.] 22 | * Memory [`getVolumePaths()`, etc.] 23 | * Package [`getSystemAvailableFeatures()`, etc.] 24 | * Sensor [`getSensorList(TYPE_ALL)`, etc.] 25 | * Superuser [`BusyBox`, etc.] 26 | * App [`requestedPermissions`, etc.] 27 | * etc. 28 | 29 | ### Example 30 | There is a slice of data which **OSBuild** got from my Android phone: 31 | ``` 32 | /proc/cpuinfo 33 | Processor: ARMv7 Processor rev 1 (v7l) 34 | Hardware: Qualcomm MSM8974PRO-AB 35 | /sys/devices/system/cpu/ 36 | online: 0,2-3 3 37 | cpu[0-9]/ 4 38 | cpu0/cpufreq/ 39 | cpuinfo_min_freq: 300000 300.00MHz 40 | cpuinfo_max_freq: 2265600 2.27GHz 41 | scaling_governor: interactive 42 | javax.microedition.khronos.opengles.GL10. 43 | glGetString(GL_RENDERER): Adreno (TM) 330 44 | glGetString(GL_VENDOR): Qualcomm 45 | /sys/class/kgsl/kgsl-3d0/ 46 | max_gpuclk: 578000000 578.00MHz 47 | ``` 48 | 49 | ### Raise Your Voice 50 | Any BUGs, mistakes, suggestion or confusion, feedback by [E-mail](mailto:By_syk@163.com "Developer's E-mail address") or revise on a market. I would take to heart. 51 | 52 | Your voice can make a difference! 53 | 54 | ### Donate 55 | Not financially. 56 | 57 | Just **Share the Page** to me by E-mail or any other available way. As you can see, only some hardware info about the device (**NO PRIVACY**). 58 | 59 | Each received file helps me expand the **OSBuild** - **DAD (Database of Android Devices)**. 60 | 61 | I've spent plenty of time programming. If you find **OSBuild** useful, please help me a lot. Thank you. 62 | 63 | ### Besides... 64 | Maybe **OSBuild** could help you with smartphone reviews. 65 | 66 | Salute to [Sony Xperia AppXplore](http://developer.sonymobile.com/knowledge-base/tools/download-appxplore-and-learn-more-about-your-apps/ "AppXplore"). 67 | 68 | ### History Versions 69 | [OSBuild_v1.1.0(150606).apk](/Other/OSBuild_v1.1.0(150606).apk) 70 | 71 | [OSBuild_v1.1.4(150610).apk](/Other/OSBuild_v1.1.4(150610).apk) 72 | 73 | [OSBuild_v1.2.0(150628).apk](/Other/OSBuild_v1.2.0(150628).apk) 74 | 75 | [OSBuild_v1.2.7(150708).apk](/Other/OSBuild_v1.2.7(150708).apk) 76 | 77 | [OSBuild_v1.3.0(150723).apk](/Other/OSBuild_v1.3.0(150723).apk) 78 | 79 | [OSBuild_v1.4.0(150830).apk](/Other/OSBuild_v1.4.0(150830).apk) 80 | 81 | [OSBuild_v1.4.3(150911).apk](/Other/OSBuild_v1.4.3(150911).apk) 82 | 83 | [OSBuild_v1.4.7(150928).apk](/Other/OSBuild_v1.4.7(150928).apk) 84 | 85 | [OSBuild_v1.4.9(151115).apk](/Other/OSBuild_v1.4.9(151115).apk) 86 | 87 | ### Screenshots 88 | ![screenshot.png](/Other/screenshot.png) -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.by_syk.osbuild" 9 | minSdkVersion 8 10 | targetSdkVersion 23 11 | versionCode 151115 12 | versionName "1.4.9" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled true 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | } 26 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 32 | 33 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Monaco.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/assets/fonts/Monaco.ttf -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/ReaderActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild; 6 | 7 | import com.by_syk.osbuild.util.C; 8 | import com.by_syk.osbuild.widget.MyTextView; 9 | import com.by_syk.osbuild.util.ExtraUtil; 10 | import com.by_syk.osbuild.util.AndroidManifestUtil; 11 | 12 | import android.app.Activity; 13 | import android.os.Bundle; 14 | import android.net.Uri; 15 | import android.os.AsyncTask; 16 | import java.io.FileNotFoundException; 17 | import android.view.MenuItem; 18 | import android.view.Menu; 19 | import android.content.res.Configuration; 20 | import android.view.ViewGroup; 21 | import android.widget.EditText; 22 | import android.app.AlertDialog; 23 | import android.content.DialogInterface; 24 | import java.nio.charset.Charset; 25 | import android.text.TextUtils; 26 | import java.nio.charset.IllegalCharsetNameException; 27 | import java.util.SortedMap; 28 | import android.view.Window; 29 | import android.view.ScaleGestureDetector; 30 | import android.view.ScaleGestureDetector.OnScaleGestureListener; 31 | import android.view.MotionEvent; 32 | import android.view.View.OnTouchListener; 33 | import android.view.View; 34 | import android.annotation.TargetApi; 35 | import android.os.Handler; 36 | import android.content.SharedPreferences; 37 | import android.widget.Button; 38 | import android.widget.TextView.OnEditorActionListener; 39 | import android.widget.TextView; 40 | import android.view.KeyEvent; 41 | import android.view.inputmethod.EditorInfo; 42 | 43 | public class ReaderActivity extends Activity 44 | { 45 | SharedPreferences sharedPreferences; 46 | 47 | MyTextView mtv_reader; 48 | 49 | //A URI reference of source file. 50 | Uri uri_file = null; 51 | String file_name = null; 52 | 53 | //Text of the file. (Only part if the file is too big.) 54 | String text = ""; 55 | 56 | ScaleGestureDetector scaleGestureDetector = null; 57 | 58 | float scaled_density = 1.0f; 59 | float text_size_dp_default = 14.0f; 60 | 61 | //Default: UTF-8 62 | MyCharset myCharset = null; 63 | 64 | //Mark the status of current Activity, running or not. 65 | boolean isRunning = true; 66 | 67 | @Override 68 | protected void onCreate(Bundle savedInstanceState) 69 | { 70 | super.onCreate(savedInstanceState); 71 | 72 | //Indeterminate progress can be showed on the ActionBar or TitleBar. 73 | requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 74 | 75 | setContentView(R.layout.activity_reader); 76 | 77 | init(); 78 | 79 | //Load data in another thread. 80 | uri_file = getIntent().getData(); 81 | file_name = ExtraUtil.getUriFileName(ReaderActivity.this, uri_file); 82 | 83 | myCharset = new MyCharset(); 84 | 85 | (new LoadDataTask()).execute(); 86 | } 87 | 88 | @Override 89 | protected void onDestroy() 90 | { 91 | super.onDestroy(); 92 | 93 | isRunning = false; 94 | } 95 | 96 | private void init() 97 | { 98 | sharedPreferences = getSharedPreferences(getPackageName(), MODE_PRIVATE); 99 | 100 | mtv_reader = (MyTextView) findViewById(R.id.mtv_reader); 101 | 102 | scaled_density = getResources().getDisplayMetrics().scaledDensity; 103 | text_size_dp_default = mtv_reader.getTextSize() / scaled_density; 104 | 105 | mtv_reader.setTextSize(text_size_dp_default + 106 | sharedPreferences.getFloat("reader_text_size_dp_extra", 0.0f)); 107 | 108 | scaleGestureDetector = new ScaleGestureDetector(this, new OnScaleGestureListener() 109 | { 110 | @Override 111 | public boolean onScale(ScaleGestureDetector p1) 112 | { 113 | return false; 114 | } 115 | 116 | @Override 117 | public boolean onScaleBegin(ScaleGestureDetector p1) 118 | { 119 | return true; 120 | } 121 | 122 | @Override 123 | public void onScaleEnd(ScaleGestureDetector p1) 124 | { 125 | final float SCALE_FACTOR = p1.getScaleFactor(); 126 | if (SCALE_FACTOR >= 0.8f && SCALE_FACTOR <= 1.2f) 127 | { 128 | return; 129 | } 130 | 131 | final float OLD_TEXT_SIZE_DP = mtv_reader.getTextSize() / scaled_density; 132 | if (OLD_TEXT_SIZE_DP <= text_size_dp_default - 4.0f && SCALE_FACTOR <= 1.0f) 133 | { 134 | return; 135 | } 136 | if (OLD_TEXT_SIZE_DP >= text_size_dp_default + 4.0f && SCALE_FACTOR > 1.0f) 137 | { 138 | return; 139 | } 140 | 141 | final float NEW_TEXT_SIZE_DP = SCALE_FACTOR > 1.0f ? (OLD_TEXT_SIZE_DP + 4.0f) 142 | : (OLD_TEXT_SIZE_DP - 4.0f); 143 | 144 | //Unit: dp 145 | sharedPreferences.edit().putFloat("reader_text_size_dp_extra", 146 | NEW_TEXT_SIZE_DP - text_size_dp_default).commit(); 147 | mtv_reader.setTextSize(NEW_TEXT_SIZE_DP); 148 | } 149 | }); 150 | 151 | mtv_reader.setOnTouchListener(new OnTouchListener() 152 | { 153 | @Override 154 | public boolean onTouch(View p1, MotionEvent p2) 155 | { 156 | switch (p2.getPointerCount()) 157 | { 158 | case 2: 159 | { 160 | //Disallow HorizontalScrollView to intercept touch events. 161 | p1.getParent().requestDisallowInterceptTouchEvent(true); 162 | //Disallow ScrollView to intercept touch events. 163 | p1.getParent().getParent().requestDisallowInterceptTouchEvent(true); 164 | return scaleGestureDetector.onTouchEvent(p2); 165 | } 166 | default: 167 | return false; 168 | } 169 | } 170 | }); 171 | } 172 | 173 | @TargetApi(11) 174 | private class LoadDataTask extends AsyncTask 175 | { 176 | @Override 177 | protected void onPreExecute() 178 | { 179 | super.onPreExecute(); 180 | 181 | //Show round progress bar on the ActionBar. 182 | //Notice that, it doesn't work on Android 5.0 and above. 183 | //From the development team: 184 | //"...this is currently working as intended as the progress bar features are not supported 185 | //on Material action bars. This should throw an exception if you try to use them." 186 | setProgressBarIndeterminateVisibility(true); 187 | 188 | if (C.SDK >= 11) 189 | { 190 | //Show the file name on the ActionBar. 191 | //Set to null to disable the subtitle entirely. 192 | getActionBar().setSubtitle(file_name); 193 | } 194 | } 195 | 196 | @Override 197 | protected String doInBackground(String[] p1) 198 | { 199 | //Print file path firstly. 200 | /*StringBuilder stringBuilder = new StringBuilder(); 201 | stringBuilder.append(uri_file.getPath()); 202 | stringBuilder.append("\n\n").append(loadData());*/ 203 | 204 | text = loadData(); 205 | 206 | return null; 207 | } 208 | 209 | @Override 210 | protected void onPostExecute(String result) 211 | { 212 | super.onPostExecute(result); 213 | 214 | //Fill data to text views. 215 | fillData(); 216 | 217 | //Hide round progress bar on the ActionBar. 218 | setProgressBarIndeterminateVisibility(false); 219 | } 220 | } 221 | 222 | private String loadData() 223 | { 224 | String result = ""; 225 | 226 | if (uri_file == null) 227 | { 228 | return result; 229 | } 230 | 231 | //getContentResolver().openInputStream 232 | //Accepts the following URI schemes: 233 | // content (SCHEME_CONTENT) 234 | // android.resource (SCHEME_ANDROID_RESOURCE) 235 | // file (SCHEME_FILE) 236 | try 237 | { 238 | //For testing. 239 | if (file_name != null && file_name.equals("AndroidManifest.xml")) 240 | { 241 | result = AndroidManifestUtil.readAM(getContentResolver() 242 | .openInputStream(uri_file)); 243 | } 244 | /*if (file_name.endsWith(".apk")) 245 | { 246 | result = AXMLPrinter.getManifestXMLFromAPK(uri_file.getPath()); 247 | }*/ 248 | 249 | if (result.length() < 64) 250 | { 251 | //Limit lines of the file to 1024. 252 | result = ExtraUtil.readFile(getContentResolver() 253 | .openInputStream(uri_file), myCharset.charset, 1024); 254 | 255 | /*System.out.println("File: " + uri_file.getPath()); 256 | 257 | long start = System.currentTimeMillis(); 258 | result = ExtraUtil.readFile(getContentResolver() 259 | .openInputStream(uri_file), myCharset.charset); 260 | System.out.println("Read File 1: " + (System.currentTimeMillis() - start)); 261 | 262 | start = System.currentTimeMillis(); 263 | result = ExtraUtil.fileChannelRead(uri_file.getPath()); 264 | System.out.println("Read File 2: " + (System.currentTimeMillis() - start));*/ 265 | } 266 | } 267 | catch (FileNotFoundException e) 268 | { 269 | e.printStackTrace(); 270 | } 271 | 272 | return result; 273 | } 274 | 275 | private void fillData() 276 | { 277 | if (TextUtils.isEmpty(text)) 278 | { 279 | return; 280 | } 281 | mtv_reader.setText(text); 282 | } 283 | 284 | /** 285 | * Dialog: User 286 | * Set self-defining charset. 287 | */ 288 | @TargetApi(11) 289 | private void setCharsetDialog() 290 | { 291 | ViewGroup viewGroup = (ViewGroup) getLayoutInflater().inflate(R.layout.dialog_input, null); 292 | final EditText ET_CHARSET = (EditText) viewGroup.findViewById(R.id.et_text); 293 | ET_CHARSET.setText(myCharset.charsets[2]); 294 | 295 | AlertDialog alertDialog = (C.SDK >= 21 ? (new AlertDialog.Builder(this, 296 | R.style.AlertDialogStyle)) : (new AlertDialog.Builder(this))) 297 | .setTitle(R.string.dia_title_user) 298 | .setView(viewGroup) 299 | .setPositiveButton(R.string.dia_pos_ok, new DialogInterface.OnClickListener() 300 | { 301 | @Override 302 | public void onClick(DialogInterface p1, int p2) 303 | { 304 | if (myCharset.addCharset(ET_CHARSET.getText().toString())) 305 | { 306 | //Load data in another thread. 307 | (new LoadDataTask()).execute(); 308 | 309 | if (C.SDK >= 11) 310 | { 311 | invalidateOptionsMenu(); 312 | } 313 | } 314 | else 315 | { 316 | setCharsetDialog(); 317 | } 318 | } 319 | }) 320 | .setNegativeButton(R.string.dia_neg_cancel, null) 321 | .setNeutralButton(R.string.dia_neu_charsets, new DialogInterface.OnClickListener() 322 | { 323 | @Override 324 | public void onClick(DialogInterface p1, int p2) 325 | { 326 | //In order for system to hide soft keyboard more naturally and effectively. 327 | (new Handler()).postDelayed(new Runnable() 328 | { 329 | public void run() 330 | { 331 | //Check if the app is running to avoid crashing. 332 | if (!isRunning) 333 | { 334 | return; 335 | } 336 | //List all. 337 | setCharsetDialog(myCharset.availCharsets); 338 | } 339 | }, 600); 340 | } 341 | }) 342 | .create(); 343 | alertDialog.show(); 344 | 345 | final Button BT_POS = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); 346 | ET_CHARSET.setOnEditorActionListener(new OnEditorActionListener() 347 | { 348 | @Override 349 | public boolean onEditorAction(TextView p1, int p2, KeyEvent p3) 350 | { 351 | if (p2 == EditorInfo.IME_ACTION_DONE) 352 | { 353 | BT_POS.performClick(); 354 | return true; 355 | } 356 | return false; 357 | } 358 | }); 359 | } 360 | 361 | /** 362 | * Dialog: User 363 | * List all system available charsets. 364 | */ 365 | @TargetApi(11) 366 | private void setCharsetDialog(final String[] CHARSETS) 367 | { 368 | if (CHARSETS == null) 369 | { 370 | setCharsetDialog(); 371 | return; 372 | } 373 | 374 | AlertDialog alertDialog = (C.SDK >= 21 ? (new AlertDialog.Builder(this, 375 | R.style.AlertDialogStyle)) : (new AlertDialog.Builder(this))) 376 | .setTitle(R.string.dia_title_user) 377 | .setItems(CHARSETS, new DialogInterface.OnClickListener() 378 | { 379 | @Override 380 | public void onClick(DialogInterface p1, int p2) 381 | { 382 | if (myCharset.addCharset(CHARSETS[p2])) 383 | { 384 | //Load data in another thread. 385 | (new LoadDataTask()).execute(); 386 | 387 | if (C.SDK >= 11) 388 | { 389 | invalidateOptionsMenu(); 390 | } 391 | } 392 | else 393 | { 394 | setCharsetDialog(); 395 | } 396 | } 397 | }) 398 | .setPositiveButton(R.string.dia_pos_back, new DialogInterface.OnClickListener() 399 | { 400 | @Override 401 | public void onClick(DialogInterface p1, int p2) 402 | { 403 | setCharsetDialog(); 404 | } 405 | }) 406 | .setNegativeButton(R.string.dia_neg_cancel, null) 407 | .create(); 408 | alertDialog.show(); 409 | } 410 | 411 | @Override 412 | public void onConfigurationChanged(Configuration newConfig) 413 | { 414 | super.onConfigurationChanged(newConfig); 415 | } 416 | 417 | @Override 418 | public boolean onCreateOptionsMenu(Menu menu) 419 | { 420 | getMenuInflater().inflate(R.menu.menu_reader, menu); 421 | 422 | return true; 423 | } 424 | 425 | /** 426 | * Call it when expanding the menu every time for API 10-. 427 | * Call only once after calling "onCreateOptionsMenu" for API 11+. 428 | */ 429 | @Override 430 | public boolean onPrepareOptionsMenu(Menu menu) 431 | { 432 | menu.getItem(0).setTitle(myCharset.charset + "..."); 433 | 434 | menu.getItem(0).getSubMenu() 435 | .getItem(myCharset.id_charset).setChecked(true); 436 | 437 | return true; 438 | } 439 | 440 | @Override 441 | @TargetApi(11) 442 | public boolean onOptionsItemSelected(MenuItem item) 443 | { 444 | boolean changed = false; 445 | switch (item.getItemId()) 446 | { 447 | case R.id.action_sub_charset_utf8: 448 | changed = myCharset.setCharset(0); 449 | break; 450 | case R.id.action_sub_charset_gbk: 451 | changed = myCharset.setCharset(1); 452 | break; 453 | case R.id.action_sub_charset_user: 454 | changed = myCharset.setCharset(2); 455 | } 456 | 457 | if (changed) 458 | { 459 | //Load data in another thread. 460 | (new LoadDataTask()).execute(); 461 | 462 | if (C.SDK >= 11) 463 | { 464 | invalidateOptionsMenu(); 465 | } 466 | } 467 | 468 | return true; 469 | } 470 | 471 | private class MyCharset 472 | { 473 | //All system available charsets. 474 | public String[] availCharsets = null; 475 | 476 | //Charsets: 477 | // ISO-8859-1, US-ASCII, UTF-16, UTF-16BE, UTF-16LE, UTF-8 478 | // GB2313, Big5, GBK, GB18030 479 | public String[] charsets = { "UTF-8", "GBK", "" }; 480 | 481 | //Set "UTF-8" as default. 482 | public int id_charset = 0; 483 | public String charset = charsets[0]; 484 | 485 | public MyCharset() 486 | { 487 | //Get all system available charsets. 488 | SortedMap mapAvailCharsets = Charset.availableCharsets(); 489 | availCharsets = new String[mapAvailCharsets.size()]; 490 | int i = 0; 491 | for (SortedMap.Entry entry : Charset.availableCharsets().entrySet()) 492 | { 493 | availCharsets[i ++] = entry.getKey(); 494 | } 495 | } 496 | 497 | public boolean setCharset(int id_charset) 498 | { 499 | if (id_charset == 2) 500 | { 501 | setCharsetDialog(); 502 | return false; 503 | } 504 | 505 | if (id_charset > this.charsets.length - 1 || id_charset == this.id_charset) 506 | { 507 | return false; 508 | } 509 | 510 | this.id_charset = id_charset; 511 | this.charset = this.charsets[id_charset]; 512 | 513 | return true; 514 | } 515 | 516 | public boolean addCharset(String charset) 517 | { 518 | boolean result = false; 519 | if (TextUtils.isEmpty(charset)) 520 | { 521 | return result; 522 | } 523 | 524 | try 525 | { 526 | if (Charset.isSupported(charset)) 527 | { 528 | this.charsets[2] = charset; 529 | this.id_charset = 2; 530 | this.charset = charset; 531 | 532 | result = true; 533 | } 534 | } 535 | catch (IllegalCharsetNameException e) 536 | { 537 | e.printStackTrace(); 538 | } 539 | 540 | return result; 541 | } 542 | } 543 | } 544 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/WhitePaperActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild; 6 | 7 | import com.by_syk.osbuild.widget.MyTextView; 8 | 9 | import android.app.Activity; 10 | import android.os.Bundle; 11 | import android.view.WindowManager; 12 | import android.view.MotionEvent; 13 | import android.content.res.Configuration; 14 | import android.view.Window; 15 | 16 | public class WhitePaperActivity extends Activity 17 | { 18 | MyTextView mtv_lightness; 19 | 20 | Window window = null; 21 | WindowManager.LayoutParams layout_params = null; 22 | 23 | //Used to switch brightness of this window. 24 | boolean max_brightness = false; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) 28 | { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_white_paper); 31 | 32 | init(); 33 | } 34 | 35 | private void init() 36 | { 37 | window = getWindow(); 38 | layout_params = window.getAttributes(); 39 | 40 | /*View decorView = getWindow().getDecorView(); 41 | //Hide both the navigation bar and the status bar. 42 | //SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as 43 | //a general rule, you should design your app to hide the status bar whenever you 44 | //hide the navigation bar. 45 | int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION 46 | | View.SYSTEM_UI_FLAG_FULLSCREEN; 47 | decorView.setSystemUiVisibility(uiOptions);*/ 48 | 49 | mtv_lightness = (MyTextView) findViewById(R.id.mtv_lightness); 50 | } 51 | 52 | @Override 53 | public boolean onTouchEvent(MotionEvent event) 54 | { 55 | switch (event.getAction()) 56 | { 57 | case MotionEvent.ACTION_UP: 58 | { 59 | max_brightness = !max_brightness; 60 | 61 | layout_params.screenBrightness = max_brightness ? 62 | WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL 63 | : WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE; 64 | window.setAttributes(layout_params); 65 | 66 | mtv_lightness.setText(max_brightness 67 | ? "100%" : getString(R.string.light_auto)); 68 | } 69 | } 70 | return true; 71 | } 72 | 73 | @Override 74 | public void onConfigurationChanged(Configuration newConfig) 75 | { 76 | super.onConfigurationChanged(newConfig); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/util/AndroidManifestUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild.util; 6 | 7 | import java.util.jar.JarFile; 8 | import java.io.InputStream; 9 | import java.io.FileInputStream; 10 | import java.io.File; 11 | import java.io.FileNotFoundException; 12 | import java.io.IOException; 13 | 14 | public class AndroidManifestUtil 15 | { 16 | private static String AM_XML = "AndroidManifest.xml"; 17 | 18 | public static String readAM(String xml_path) 19 | { 20 | String result = ""; 21 | if (xml_path == null || !(new File(xml_path)).getName().equals(AM_XML)) 22 | { 23 | return result; 24 | } 25 | 26 | try 27 | { 28 | InputStream inputStream = new FileInputStream(xml_path); 29 | result = readAM(inputStream); 30 | } 31 | catch (FileNotFoundException e) 32 | { 33 | e.printStackTrace(); 34 | } 35 | 36 | return result; 37 | } 38 | 39 | public static String readAMFromAPK(String apk_path) 40 | { 41 | String result = ""; 42 | if (apk_path == null || !apk_path.endsWith(".apk")) 43 | { 44 | return result; 45 | } 46 | 47 | try 48 | { 49 | JarFile jarFile = new JarFile(apk_path); 50 | result = readAM(jarFile.getInputStream(jarFile.getEntry(AM_XML))); 51 | } 52 | catch (IOException e) 53 | { 54 | e.printStackTrace(); 55 | } 56 | 57 | return result; 58 | } 59 | 60 | public static String readAM(InputStream inputStream) 61 | { 62 | String result = ""; 63 | try 64 | { 65 | byte[] buffer = new byte[inputStream.available()]; 66 | if (inputStream.read(buffer) > 0) 67 | { 68 | result = decompressXML(buffer); 69 | } 70 | } 71 | catch (IOException e) 72 | { 73 | e.printStackTrace(); 74 | } 75 | finally 76 | { 77 | if (inputStream != null) 78 | { 79 | try 80 | { 81 | inputStream.close(); 82 | } 83 | catch (IOException e) 84 | {} 85 | } 86 | } 87 | 88 | return result; 89 | } 90 | 91 | private static int END_DOC_TAG = 0x00100101; 92 | private static int START_TAG = 0x00100102; 93 | private static int END_TAG = 0x00100103; 94 | 95 | /** 96 | * Parse the 'compressed' binary form of Android XML docs 97 | * such as for AndroidManifest.xml in .apk files 98 | */ 99 | private static String decompressXML(byte[] bytes_xml) 100 | { 101 | StringBuilder stringBuilder = new StringBuilder(); 102 | 103 | //Compressed XML file/bytes starts with 24x bytes of data, 104 | //9 32 bit words in little endian order (LSB first): 105 | // 0th word is 03 00 08 00 106 | // 3rd word SEEMS TO BE: Offset at then of StringTable 107 | // 4th word is: Number of strings in string table 108 | //WARNING: Sometime I indiscriminently display or refer to word in 109 | //little endian storage format, or in integer format (ie MSB first). 110 | int num_strings = LEW(bytes_xml, 4 * 4); 111 | 112 | //StringIndexTable starts at offset 24x, an array of 32 bit LE offsets 113 | //of the length/string data in the StringTable. 114 | int sit_off = 0x24;//Offset of start of StringIndexTable 115 | 116 | //StringTable, each string is represented with a 16 bit little endian 117 | //character count, followed by that number of 16 bit (LE) (Unicode) chars. 118 | int st_off = sit_off + num_strings * 4;//StringTable follows StrIndexTable 119 | 120 | //XMLTags, The XML tag tree starts after some unknown content after the 121 | //StringTable. There is some unknown data after the StringTable, scan 122 | //forward from this point to the flag for the start of an XML start tag. 123 | int xml_tag_off = LEW(bytes_xml, 3 * 4);//Start from the offset in the 3rd word. 124 | //Scan forward until we find the bytes: 0x02011000(x00100102 in normal int) 125 | for (int i = xml_tag_off, len = bytes_xml.length - 4; i< len; i += 4) 126 | { 127 | if (LEW(bytes_xml, i) == START_TAG) 128 | { 129 | xml_tag_off = i; 130 | break; 131 | } 132 | } 133 | 134 | //XML tags and attributes: 135 | //Every XML start and end tag consists of 6 32 bit words: 136 | // 0th word: 02011000 for startTag and 03011000 for endTag 137 | // 1st word: a flag?, like 38000000 138 | // 2nd word: Line of where this tag appeared in the original source file 139 | // 3rd word: FFFFFFFF ?? 140 | // 4th word: StringIndex of NameSpace name, or FFFFFFFF for default NS 141 | // 5th word: StringIndex of Element Name 142 | //(Note: 01011000 in 0th word means end of XML document, endDocTag) 143 | 144 | //Start tags (not end tags) contain 3 more words: 145 | // 6th word: 14001400 meaning?? 146 | // 7th word: Number of Attributes that follow this tag(follow word 8th) 147 | // 8th word: 00000000 meaning?? 148 | 149 | //Attributes consist of 5 words: 150 | // 0th word: StringIndex of Attribute Name's Namespace, or FFFFFFFF 151 | // 1st word: StringIndex of Attribute Name 152 | // 2nd word: StringIndex of Attribute Value, or FFFFFFF if ResourceId used 153 | // 3rd word: Flags? 154 | // 4th word: str ind of attr value again, or ResourceId of value 155 | 156 | stringBuilder.append(""); 157 | 158 | StringBuffer buffer = new StringBuffer(); 159 | //Step through the XML tree element tags and attributes 160 | int off = xml_tag_off; 161 | int indent = 0; 162 | while (off < bytes_xml.length) 163 | { 164 | int tag0 = LEW(bytes_xml, off); 165 | int name_si = LEW(bytes_xml, off + 5 * 4); 166 | 167 | if (tag0 == START_TAG) 168 | { 169 | int num_attrs = LEW(bytes_xml, off + 7 * 4);//Number of Attributes to follow 170 | off += 9 * 4;//Skip over 6 + 3 words of startTag data 171 | String name = compXmlString(bytes_xml, sit_off, st_off, name_si); 172 | 173 | //Look for the Attributes 174 | buffer.setLength(0); 175 | for (int i = 0; i < num_attrs; ++ i) 176 | { 177 | int attr_name_si = LEW(bytes_xml, off + 1 * 4);//AttrName String Index 178 | int attr_value_si = LEW(bytes_xml, off + 2 * 4);//AttrValue Str Ind, or FFFFFFFF 179 | int attr_res_id = LEW(bytes_xml, off + 4 * 4);//AttrValue ResourceId or dup AttrValue StrInd 180 | off += 5 * 4;//Skip over the 5 words of an attribute 181 | 182 | String attr_name = compXmlString(bytes_xml, sit_off, st_off, attr_name_si); 183 | String attr_value = attr_value_si != -1 184 | ? compXmlString(bytes_xml, sit_off, st_off, attr_value_si) 185 | : String.valueOf(attr_res_id); 186 | buffer.append(String.format(" %1$s=\"%2$s\"", attr_name, attr_value)); 187 | } 188 | stringBuilder.append("\n"); 189 | stringBuilder.append(String.format("%1$s<%2$s%3$s>", getIndent(indent), name, buffer)); 190 | ++ indent; 191 | } 192 | else if (tag0 == END_TAG) 193 | { 194 | -- indent; 195 | off += 6 * 4;//Skip over 6 words of endTag data 196 | String name = compXmlString(bytes_xml, sit_off, st_off, name_si); 197 | stringBuilder.append("\n"); 198 | stringBuilder.append(String.format("%1$s", getIndent(indent), name)); 199 | } 200 | else if (tag0 == END_DOC_TAG) 201 | { 202 | break; 203 | } 204 | } 205 | 206 | return stringBuilder.toString(); 207 | } 208 | 209 | private static String compXmlString(byte[] bytes_xml, int sit_off, int st_off, int str_ind) 210 | { 211 | if (str_ind < 0) 212 | { 213 | return null; 214 | } 215 | int str_off = st_off + LEW(bytes_xml, sit_off + str_ind * 4); 216 | 217 | return compXmlStringAt(bytes_xml, str_off); 218 | } 219 | 220 | private static String getIndent(int indent) 221 | { 222 | final String SPACES = " "; 223 | return SPACES.substring(0, Math.min(indent * 4, SPACES.length())); 224 | } 225 | 226 | /** 227 | * Return the string stored in StringTable format at 228 | * offset strOff. This offset points to the 16 bit string length, which 229 | * is followed by that number of 16 bit (Unicode) chars. 230 | */ 231 | private static String compXmlStringAt(byte[] arr, int str_off) 232 | { 233 | int str_len = arr[str_off + 1] << 8 & 0xff00 | arr[str_off] & 0xff; 234 | byte[] chars = new byte[str_len]; 235 | for (int i = 0; i < str_len; ++ i) 236 | { 237 | chars[i] = arr[str_off + 2 + i * 2]; 238 | } 239 | return new String(chars);//Hack, just use 8 byte chars 240 | } 241 | 242 | /** 243 | * Return value of a Little Endian 32 bit word from the byte array 244 | * at offset off. 245 | */ 246 | private static int LEW(byte[] arr, int off) 247 | { 248 | return arr[off + 3] << 24 & 0xff000000 | arr[off + 2] << 16 & 0xff0000 249 | | arr[off + 1] << 8 & 0xff00 | arr[off] & 0xFF; 250 | } 251 | } 252 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/util/C.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild.util; 6 | 7 | import android.os.Build; 8 | 9 | /** 10 | * Constants 11 | */ 12 | public class C 13 | { 14 | //Android Version 15 | public final static int SDK = Build.VERSION.SDK_INT; 16 | 17 | public final static String L = ""; 18 | public final static String L0 = "\n"; 19 | public final static String L1 = "\n "; 20 | public final static String L2 = "\n "; 21 | public final static String L3 = "\n "; 22 | public final static String NL = "\n"; 23 | public final static String NL1 = "\n\n"; 24 | public final static String NL2 = "\n\n\n"; 25 | public final static String SPACE = " "; 26 | 27 | final public static String TRUE = "TRUE"; 28 | final public static String FALSE = "FALSE"; 29 | final public static String ON = "ON"; 30 | final public static String OFF = "OFF"; 31 | final public static String YES = "YES"; 32 | final public static String NO = "NO"; 33 | final public static String UNKNOWN = "UNKNOWN"; 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/util/ConstUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild.util; 6 | 7 | import android.os.Build; 8 | import android.util.DisplayMetrics; 9 | import android.content.res.Configuration; 10 | import android.hardware.Sensor; 11 | import android.view.Surface; 12 | import android.telephony.TelephonyManager; 13 | import java.util.Locale; 14 | import android.content.pm.PackageManager; 15 | import android.os.Environment; 16 | import android.annotation.TargetApi; 17 | import android.text.TextUtils; 18 | import android.content.pm.ConfigurationInfo; 19 | 20 | public class ConstUtil 21 | { 22 | private static String UNKNOWN = ""; 23 | 24 | /** 25 | * The user-visible SDK version of the framework; 26 | * its possible values are defined in Build.VERSION_CODES. 27 | * @param sdk_int "SDK_INT" 28 | */ 29 | public static String getSDKIntStr(int sdk_int) 30 | { 31 | switch (sdk_int) 32 | { 33 | case Build.VERSION_CODES.BASE://1 34 | return "BASE";//Android 1.0 35 | case Build.VERSION_CODES.BASE_1_1://2 36 | return "BASE_1_1";//Android 1.1 37 | case Build.VERSION_CODES.CUPCAKE://3 38 | return "CUPCAKE";//Android 1.5 39 | case Build.VERSION_CODES.DONUT://4 40 | return "DONUT";//Android 1.6 41 | case Build.VERSION_CODES.ECLAIR://5 42 | return "ECLAIR";//Android 2.0 43 | case Build.VERSION_CODES.ECLAIR_0_1://6 44 | return "ECLAIR_0_1";//Android 2.0.1 45 | case Build.VERSION_CODES.ECLAIR_MR1://7 46 | return "ECLAIR_MR1";//Android 2.1.x 47 | case Build.VERSION_CODES.FROYO://8 48 | return "FROYO";//Android 2.2.x 49 | case Build.VERSION_CODES.GINGERBREAD://9 50 | return "GINGERBREAD";//Android 2.3 Android 2.3.1 Android 2.3.2 51 | case Build.VERSION_CODES.GINGERBREAD_MR1://10 52 | return "GINGERBREAD_MR1";//Android 2.3.3 Android 2.3.4 53 | case Build.VERSION_CODES.HONEYCOMB://11 54 | return "HONEYCOMB";//Android 3.0.x 55 | case Build.VERSION_CODES.HONEYCOMB_MR1://12 56 | return "HONEYCOMB_MR1";//Android 3.1.x 57 | case Build.VERSION_CODES.HONEYCOMB_MR2://13 58 | return "HONEYCOMB_MR2";//Android 3.2 59 | case Build.VERSION_CODES.ICE_CREAM_SANDWICH://14 60 | return "ICE_CREAM_SANDWICH";//Android 4.0 Android 4.0.1 Android 4.0.2 61 | case Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1://15 62 | return "ICE_CREAM_SANDWICH_MR1";//Android 4.0.3 Android 4.0.4 63 | case Build.VERSION_CODES.JELLY_BEAN://16 64 | return "JELLY_BEAN";//Android 4.1 Android 4.1.1 65 | case Build.VERSION_CODES.JELLY_BEAN_MR1://17 66 | return "JELLY_BEAN_MR1";//Android 4.2 Android 4.2.2 67 | case Build.VERSION_CODES.JELLY_BEAN_MR2://18 68 | return "JELLY_BEAN_MR2";//Android 4.3 69 | case Build.VERSION_CODES.KITKAT://19 70 | return "KITKAT";//Android 4.4 71 | case Build.VERSION_CODES.KITKAT_WATCH://20 72 | return "KITKAT_WATCH";//Android 4.4W 73 | case Build.VERSION_CODES.LOLLIPOP://21 74 | return "LOLLIPOP";//Android 5.0 75 | case Build.VERSION_CODES.LOLLIPOP_MR1://22 76 | return "LOLLIPOP_MR1"; 77 | case Build.VERSION_CODES.M://23 78 | return "M"; 79 | //Magic version number for a current development build, 80 | //which has not yet turned into an official release. 81 | case Build.VERSION_CODES.CUR_DEVELOPMENT://1000 82 | return "CUR_DEVELOPMENT"; 83 | default: 84 | return UNKNOWN; 85 | } 86 | } 87 | 88 | /** 89 | * @param sdk_int "SDK_INT" 90 | * @return The date Google release the given Android version. 91 | */ 92 | public static String getSDKIntDateStr(int sdk_int) 93 | { 94 | switch (sdk_int) 95 | { 96 | case Build.VERSION_CODES.BASE://0 97 | return "2008-10";//Android 1.0 98 | case Build.VERSION_CODES.BASE_1_1://1 99 | return "2009-02";//Android 1.1 100 | case Build.VERSION_CODES.CUPCAKE://3 101 | return "2009-05";//Android 1.5 102 | case Build.VERSION_CODES.DONUT://4 103 | return "2009-09";//Android 1.6 104 | case Build.VERSION_CODES.ECLAIR://5 105 | return "2009-11";//Android 2.0 106 | case Build.VERSION_CODES.ECLAIR_0_1://6 107 | return "2009-12";//Android 2.0.1 108 | case Build.VERSION_CODES.ECLAIR_MR1://7 109 | return "2010-01";//Android 2.1.x 110 | case Build.VERSION_CODES.FROYO://8 111 | return "2010-06";//Android 2.2.x 112 | case Build.VERSION_CODES.GINGERBREAD://9 113 | return "2010-11";//Android 2.3 Android 2.3.1 Android 2.3.2 114 | case Build.VERSION_CODES.GINGERBREAD_MR1://10 115 | return "2011-02";//Android 2.3.3 Android 2.3.4 116 | case Build.VERSION_CODES.HONEYCOMB://11 117 | return "2011-02";//Android 3.0.x 118 | case Build.VERSION_CODES.HONEYCOMB_MR1://12 119 | return "2011-05";//Android 3.1.x 120 | case Build.VERSION_CODES.HONEYCOMB_MR2://13 121 | return "2011-06";//Android 3.2 122 | case Build.VERSION_CODES.ICE_CREAM_SANDWICH://14 123 | return "2011-10";//Android 4.0 Android 4.0.1 Android 4.0.2 124 | case Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1://15 125 | return "2011-12";//Android 4.0.3 Android 4.0.4 126 | case Build.VERSION_CODES.JELLY_BEAN://16 127 | return "2012-06";//Android 4.1 Android 4.1.1 128 | case Build.VERSION_CODES.JELLY_BEAN_MR1://17 129 | return "2012-11";//Android 4.2 Android 4.2.2 130 | case Build.VERSION_CODES.JELLY_BEAN_MR2://18 131 | return "2013-07";//Android 4.3 132 | case Build.VERSION_CODES.KITKAT://19 133 | return "2013-10";//Android 4.4 134 | case Build.VERSION_CODES.KITKAT_WATCH://20 135 | return "2014-06";//Android 4.4W 136 | case Build.VERSION_CODES.LOLLIPOP://21 137 | return "2014-11";//Android 5.0 138 | case Build.VERSION_CODES.LOLLIPOP_MR1://22 139 | return "2015-03"; 140 | case Build.VERSION_CODES.M://23 141 | return "2015-10"; 142 | case Build.VERSION_CODES.CUR_DEVELOPMENT://1000 143 | return UNKNOWN; 144 | default: 145 | return UNKNOWN; 146 | } 147 | } 148 | 149 | /** 150 | * The screen density expressed as dots-per-inch. 151 | * @param density_dpi "densityDpi" 152 | */ 153 | public static String getDensityDPIStr(int density_dpi) 154 | { 155 | switch (density_dpi) 156 | { 157 | case DisplayMetrics.DENSITY_LOW://120 158 | return "DENSITY_LOW"; 159 | case DisplayMetrics.DENSITY_MEDIUM://160 160 | return "DENSITY_MEDIUM/DENSITY_DEFAULT"; 161 | //case DisplayMetrics.DENSITY_DEFAULT://160 162 | // return "DENSITY_DEFAULT"; 163 | case DisplayMetrics.DENSITY_TV://213 164 | return "DENSITY_TV"; 165 | case DisplayMetrics.DENSITY_HIGH://240 166 | return "DENSITY_HIGH"; 167 | case DisplayMetrics.DENSITY_280://280 168 | return "DENSITY_280"; 169 | case DisplayMetrics.DENSITY_XHIGH://320 170 | return "DENSITY_XHIGH"; 171 | case DisplayMetrics.DENSITY_360://360 172 | return "DENSITY_360"; 173 | case DisplayMetrics.DENSITY_400://400 174 | return "DENSITY_400"; 175 | case DisplayMetrics.DENSITY_420://420 176 | return "DENSITY_420"; 177 | case DisplayMetrics.DENSITY_XXHIGH://480 178 | return "DENSITY_XXHDPI"; 179 | case DisplayMetrics.DENSITY_560://560 180 | return "DENSITY_560"; 181 | case DisplayMetrics.DENSITY_XXXHIGH://640 182 | return "DENSITY_XXXHDPI"; 183 | default: 184 | return UNKNOWN; 185 | } 186 | } 187 | 188 | /** 189 | * Overall orientation of the screen. 190 | * @param orientation "orientation" 191 | */ 192 | @SuppressWarnings("deprecation") 193 | public static String getOrientationStr(int orientation) 194 | { 195 | switch (orientation) 196 | { 197 | case Configuration.ORIENTATION_UNDEFINED://0 198 | return "ORIENTATION_UNDEFINED"; 199 | case Configuration.ORIENTATION_PORTRAIT://1 200 | return "ORIENTATION_PORTRAIT"; 201 | case Configuration.ORIENTATION_LANDSCAPE://2 202 | return "ORIENTATION_LANDSCAPE"; 203 | case Configuration.ORIENTATION_SQUARE://3 204 | return "ORIENTATION_SQUARE"; 205 | default: 206 | return UNKNOWN; 207 | } 208 | } 209 | 210 | @SuppressWarnings("deprecation") 211 | public static String getSensorTypeStr(int type) 212 | { 213 | switch (type) 214 | { 215 | case Sensor.TYPE_ALL://-1 216 | return "TYPE_ALL"; 217 | //Accelerometer sensor type 218 | case Sensor.TYPE_ACCELEROMETER://1 219 | return "TYPE_ACCELEROMETER"; 220 | //Magnetic field sensor type 221 | case Sensor.TYPE_MAGNETIC_FIELD://2 222 | return "TYPE_MAGNETIC_FIELD"; 223 | //Orientation sensor type 224 | case Sensor.TYPE_ORIENTATION://3 225 | return "TYPE_ORIENTATION"; 226 | //Gyroscope sensor type 227 | case Sensor.TYPE_GYROSCOPE://4 228 | return "TYPE_GYROSCOPE"; 229 | //Light sensor type 230 | case Sensor.TYPE_LIGHT://5 231 | return "TYPE_LIGHT"; 232 | //Pressure sensor type 233 | case Sensor.TYPE_PRESSURE://6 234 | return "TYPE_PRESSURE"; 235 | //Temperature sensor type 236 | case Sensor.TYPE_TEMPERATURE://7 237 | return "TYPE_TEMPERATURE"; 238 | //Proximity sensor type 239 | case Sensor.TYPE_PROXIMITY://8 240 | return "TYPE_PROXIMITY"; 241 | //Gravity sensor type 242 | case Sensor.TYPE_GRAVITY://9 243 | return "TYPE_GRAVITY"; 244 | //Linear acceleration sensor type 245 | case Sensor.TYPE_LINEAR_ACCELERATION://10 246 | return "TYPE_LINEAR_ACCELERATION"; 247 | //Rotation vector sensor type 248 | case Sensor.TYPE_ROTATION_VECTOR://11 249 | return "TYPE_ROTATION_VECTOR"; 250 | //Relative humidity sensor type 251 | case Sensor.TYPE_RELATIVE_HUMIDITY://12 252 | return "TYPE_RELATIVE_HUMIDITY"; 253 | //Ambient temperature sensor type 254 | case Sensor.TYPE_AMBIENT_TEMPERATURE://13 255 | return "TYPE_AMBIENT_TEMPERATURE"; 256 | //Uncalibrated magnetic field sensor type 257 | case Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED://14 258 | return "TYPE_MAGNETIC_FIELD_UNCALIBRATED"; 259 | //Uncalibrated rotation vector sensor type 260 | case Sensor.TYPE_GAME_ROTATION_VECTOR://15 261 | return "TYPE_GAME_ROTATION_VECTOR"; 262 | //Uncalibreted gyroscope sensor type 263 | case Sensor.TYPE_GYROSCOPE_UNCALIBRATED://16 264 | return "TYPE_GYROSCOPE_UNCALIBRATED"; 265 | //Significant motion trigger sensor 266 | case Sensor.TYPE_SIGNIFICANT_MOTION://17 267 | return "TYPE_SIGNIFICANT_MOTION"; 268 | //Step detector sensor 269 | case Sensor.TYPE_STEP_DETECTOR://18 270 | return "TYPE_STEP_DETECTOR"; 271 | //Step counter sensor 272 | case Sensor.TYPE_STEP_COUNTER://19 273 | return "TYPE_STEP_COUNTER"; 274 | //Geo-magnetic rotation vector 275 | case Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR://20 276 | return "TYPE_GEOMAGNETIC_ROTATION_VECTOR"; 277 | //Heart rate monitor 278 | case Sensor.TYPE_HEART_RATE://21 279 | return "TYPE_HEART_RATE"; 280 | default: 281 | return UNKNOWN; 282 | } 283 | } 284 | 285 | /** 286 | * Returns the rotation of the screen from its "natural" orientation. 287 | * Notice: ANTICLOCKWISE 288 | * @param rotation "getRotation()" 289 | */ 290 | public static String getRotationStr(int rotation) 291 | { 292 | switch (rotation) 293 | { 294 | //Natural orientation 295 | case Surface.ROTATION_0://0 296 | return "ROTATION_0"; 297 | case Surface.ROTATION_90://1 298 | return "ROTATION_90"; 299 | case Surface.ROTATION_180://2 300 | return "ROTATION_180"; 301 | case Surface.ROTATION_270://3 302 | return "ROTATION_270"; 303 | default: 304 | return UNKNOWN; 305 | } 306 | } 307 | 308 | /** 309 | * Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 310 | * 5 or 6 decimal digits. 311 | * Notice: Only SIM operators in China are supported currently. 312 | * @param sim_operator "getSimOperator()" 313 | */ 314 | public static String getSimOperator(String sim_operator) 315 | { 316 | if (sim_operator == null || sim_operator.length() < 5) 317 | { 318 | return UNKNOWN; 319 | } 320 | 321 | int mcc = UnitUtil.toIntSafely(sim_operator.substring(0, 3)); 322 | int mnc = UnitUtil.toIntSafely(sim_operator.substring(3)); 323 | 324 | switch (mcc) 325 | { 326 | case 454: 327 | switch (mcc) 328 | { 329 | default: 330 | return "Hong Kong"; 331 | } 332 | case 455: 333 | switch (mcc) 334 | { 335 | default: 336 | return "Macao"; 337 | } 338 | case 460: 339 | switch (mnc) 340 | { 341 | case 0: 342 | case 2: 343 | case 7: 344 | //00 for TD of China Mobile; 02 for GSM of China Mobile. 345 | return "China Mobile"; 346 | case 1: 347 | case 6: 348 | //01 for GSM of China Unicom. 349 | return "China Unicom"; 350 | case 3: 351 | case 5: 352 | //03 for CDMA of China Telecom. 353 | return "China Telecom"; 354 | case 20: 355 | return "China Tietong"; 356 | default: 357 | return UNKNOWN; 358 | } 359 | case 466: 360 | switch (mcc) 361 | { 362 | default: 363 | return "Taiwan"; 364 | } 365 | default: 366 | return UNKNOWN; 367 | } 368 | } 369 | 370 | /** 371 | * Returns the current state of the storage device that provides the given path. 372 | * @param state "getExternalStorageState()" 373 | */ 374 | public static String getExternalStorageState(String state) 375 | { 376 | if (TextUtils.isEmpty(state)) 377 | { 378 | return UNKNOWN; 379 | } 380 | 381 | switch (state) 382 | { 383 | case Environment.MEDIA_BAD_REMOVAL://bad_removal 384 | return "MEDIA_BAD_REMOVAL"; 385 | case Environment.MEDIA_CHECKING://checking 386 | return "MEDIA_CHECKING"; 387 | case Environment.MEDIA_EJECTING://ejecting 388 | return "MEDIA_EJECTING"; 389 | case Environment.MEDIA_MOUNTED://mounted 390 | return "MEDIA_MOUNTED"; 391 | case Environment.MEDIA_MOUNTED_READ_ONLY://mounted_read_only 392 | return "MEDIA_MOUNTED_READ_ONLY"; 393 | case Environment.MEDIA_NOFS://nofs 394 | return "MEDIA_NOFS"; 395 | case Environment.MEDIA_REMOVED://removed 396 | return "MEDIA_REMOVED"; 397 | case Environment.MEDIA_SHARED://shared 398 | return "MEDIA_SHARED"; 399 | case Environment.MEDIA_UNKNOWN://unknown 400 | return "MEDIA_UNKNOWN"; 401 | case Environment.MEDIA_UNMOUNTABLE://unmountable 402 | return "MEDIA_UNMOUNTABLE"; 403 | case Environment.MEDIA_UNMOUNTED://unmounted 404 | return "MEDIA_UNMOUNTED"; 405 | default: 406 | return UNKNOWN; 407 | } 408 | } 409 | 410 | /** 411 | * Returns a constant indicating the device phone type. 412 | * This indicates the type of radio used to transmit voice calls. 413 | * @param phone_type "getPhoneType()" 414 | */ 415 | public static String getPhoneTypeStr(int phone_type) 416 | { 417 | switch (phone_type) 418 | { 419 | case TelephonyManager.PHONE_TYPE_NONE://0 420 | return "PHONE_TYPE_NONE"; 421 | case TelephonyManager.PHONE_TYPE_GSM://1 422 | return "PHONE_TYPE_GSM"; 423 | case TelephonyManager.PHONE_TYPE_CDMA://2 424 | return "PHONE_TYPE_CDMA"; 425 | case TelephonyManager.PHONE_TYPE_SIP://3 426 | return "PHONE_TYPE_SIP";//API 11 427 | default: 428 | return UNKNOWN; 429 | } 430 | } 431 | 432 | /** 433 | * @param phone_type "getPhoneType()" 434 | * @param id_length Length of device id string. 435 | * @return The date Google release the given Android version. 436 | */ 437 | public static String getDeviceIdType(int phone_type, int id_length) 438 | { 439 | switch (phone_type) 440 | { 441 | case TelephonyManager.PHONE_TYPE_GSM://1 442 | return "IMEI"; 443 | case TelephonyManager.PHONE_TYPE_CDMA://2 444 | if (id_length == 8) 445 | { 446 | return "ESN"; 447 | } 448 | return "MEID"; 449 | default: 450 | return UNKNOWN; 451 | } 452 | } 453 | 454 | /** 455 | * Returns a constant indicating the state of the default SIM card. 456 | * @param sim_state "getSimState()" 457 | */ 458 | public static String getSimStateStr(int sim_state) 459 | { 460 | switch (sim_state) 461 | { 462 | case TelephonyManager.SIM_STATE_UNKNOWN://0 463 | return "SIM_STATE_UNKNOWN"; 464 | case TelephonyManager.SIM_STATE_ABSENT://1 465 | return "SIM_STATE_ABSENT"; 466 | case TelephonyManager.SIM_STATE_PIN_REQUIRED://2 467 | return "SIM_STATE_PIN_REQUIRED"; 468 | case TelephonyManager.SIM_STATE_PUK_REQUIRED://3 469 | return "SIM_STATE_PUK_REQUIRED"; 470 | case TelephonyManager.SIM_STATE_NETWORK_LOCKED://4 471 | return "SIM_STATE_NETWORK_LOCKED"; 472 | case TelephonyManager.SIM_STATE_READY://5 473 | return "SIM_STATE_READY"; 474 | default: 475 | return UNKNOWN; 476 | } 477 | } 478 | 479 | /** 480 | * Current user preference for the locale, corresponding to locale resource qualifier. 481 | * @param locale "locale" 482 | */ 483 | @TargetApi(9) 484 | public static String getLocale(Locale locale) 485 | { 486 | if (C.SDK >= 9 && locale.equals(Locale.ROOT))//null 487 | { 488 | return "ROOT"; 489 | } 490 | else if (locale.equals(Locale.GERMAN))//de 491 | { 492 | return "GERMAN"; 493 | } 494 | else if (locale.equals(Locale.GERMANY))//de_DE 495 | { 496 | return "GERMANY"; 497 | } 498 | else if (locale.equals(Locale.ENGLISH))//en 499 | { 500 | return "ENGLISH"; 501 | } 502 | else if (locale.equals(Locale.CANADA))//en_CA 503 | { 504 | return "CANADA"; 505 | } 506 | else if (locale.equals(Locale.UK))//en_GB 507 | { 508 | return "UK"; 509 | } 510 | else if (locale.equals(Locale.US))//en_US 511 | { 512 | return "US"; 513 | } 514 | else if (locale.equals(Locale.FRENCH))//fr 515 | { 516 | return "FRENCH"; 517 | } 518 | else if (locale.equals(Locale.CANADA_FRENCH))//fr_CA 519 | { 520 | return "CANADA_FRENCH"; 521 | } 522 | else if (locale.equals(Locale.FRANCE))//fr_FR 523 | { 524 | return "FRANCE"; 525 | } 526 | else if (locale.equals(Locale.ITALIAN))//it 527 | { 528 | return "ITALIAN"; 529 | } 530 | else if (locale.equals(Locale.ITALY))//it_IT 531 | { 532 | return "ITALY"; 533 | } 534 | else if (locale.equals(Locale.JAPANESE))//ja 535 | { 536 | return "JAPANESE"; 537 | } 538 | else if (locale.equals(Locale.JAPAN))//ja_JP 539 | { 540 | return "JAPAN"; 541 | } 542 | else if (locale.equals(Locale.KOREAN))//ko 543 | { 544 | return "KOREAN"; 545 | } 546 | else if (locale.equals(Locale.KOREA))//ko_KR 547 | { 548 | return "KOREA"; 549 | } 550 | else if (locale.equals(Locale.CHINESE))//zh 551 | { 552 | return "CHINESE"; 553 | } 554 | else if (locale.equals(Locale.SIMPLIFIED_CHINESE))//zh_CN 555 | { 556 | return "SIMPLIFIED_CHINESE/CHINA/PRC"; 557 | } 558 | /*else if (locale.equals(Locale.CHINA))//zh_CN 559 | { 560 | return "CHINA"; 561 | }*/ 562 | /*else if (locale.equals(Locale.PRC))//zh_CN 563 | { 564 | return "PRC"; 565 | }*/ 566 | else if (locale.equals(Locale.TRADITIONAL_CHINESE))//zh_TW 567 | { 568 | return "TRADITIONAL_CHINESE/TAIWAN"; 569 | } 570 | /*else if (locale.equals(Locale.TAIWAN))//zh_TW 571 | { 572 | return "TRADITIONAL_TAIWAN"; 573 | }*/ 574 | return UNKNOWN; 575 | } 576 | 577 | /** 578 | * A single feature that can be requested by an application. 579 | * This corresponds to information collected from the AndroidManifest.xml's tag. 580 | * @param feature "FeatureInfo" 581 | */ 582 | @SuppressWarnings("deprecation") 583 | public static String getFeature(String feature) 584 | { 585 | if (TextUtils.isEmpty(feature)) 586 | { 587 | return UNKNOWN; 588 | } 589 | 590 | switch (feature) 591 | { 592 | case PackageManager.FEATURE_APP_WIDGETS://android.software.app_widgets 593 | return "FEATURE_APP_WIDGETS"; 594 | case PackageManager.FEATURE_AUDIO_LOW_LATENCY://android.hardware.audio.low_latency 595 | return "FEATURE_AUDIO_LOW_LATENCY"; 596 | case PackageManager.FEATURE_AUDIO_OUTPUT://android.hardware.audio.output 597 | return "FEATURE_AUDIO_OUTPUT"; 598 | case PackageManager.FEATURE_AUDIO_PRO://android.hardware.audio.pro 599 | return "FEATURE_AUDIO_PRO";//API 23 600 | case PackageManager.FEATURE_AUTOMOTIVE://android.hardware.type.automotive 601 | return "FEATURE_AUTOMOTIVE";//API 23 602 | case PackageManager.FEATURE_BACKUP://android.software.backup 603 | return "FEATURE_BACKUP"; 604 | case PackageManager.FEATURE_BLUETOOTH://android.hardware.bluetooth 605 | return "FEATURE_BLUETOOTH"; 606 | case PackageManager.FEATURE_BLUETOOTH_LE://android.hardware.bluetooth_le 607 | return "FEATURE_BLUETOOTH_LE"; 608 | case PackageManager.FEATURE_CAMERA://android.hardware.camera 609 | return "FEATURE_CAMERA"; 610 | case PackageManager.FEATURE_CAMERA_ANY://android.hardware.camera.any 611 | return "FEATURE_CAMERA_ANY"; 612 | case PackageManager.FEATURE_CAMERA_AUTOFOCUS://android.hardware.camera.autofocus 613 | return "FEATURE_CAMERA_AUTOFOCUS"; 614 | case PackageManager.FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING://android.hardware.camera.capability.manual_post_processing 615 | return "FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING"; 616 | case PackageManager.FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR://android.hardware.camera.capability.manual_sensor 617 | return "FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR"; 618 | case PackageManager.FEATURE_CAMERA_CAPABILITY_RAW://android.hardware.camera.capability.raw 619 | return "FEATURE_CAMERA_CAPABILITY_RAW"; 620 | case PackageManager.FEATURE_CAMERA_EXTERNAL://android.hardware.camera.external 621 | return "FEATURE_CAMERA_EXTERNAL"; 622 | case PackageManager.FEATURE_CAMERA_FLASH://android.hardware.camera.flash 623 | return "FEATURE_CAMERA_FLASH"; 624 | case PackageManager.FEATURE_CAMERA_FRONT://android.hardware.camera.front 625 | return "FEATURE_CAMERA_FRONT"; 626 | case PackageManager.FEATURE_CAMERA_LEVEL_FULL://android.hardware.camera.level.full 627 | return "FEATURE_CAMERA_LEVEL_FULL"; 628 | case PackageManager.FEATURE_CONNECTION_SERVICE://android.software.connectionservice 629 | return "FEATURE_CONNECTION_SERVICE"; 630 | case PackageManager.FEATURE_CONSUMER_IR://android.hardware.consumerir 631 | return "FEATURE_CONSUMER_IR"; 632 | case PackageManager.FEATURE_DEVICE_ADMIN://android.software.device_admin 633 | return "FEATURE_DEVICE_ADMIN"; 634 | case PackageManager.FEATURE_FAKETOUCH://android.hardware.faketouch 635 | return "FEATURE_FAKETOUCH"; 636 | case PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT://android.hardware.faketouch.multitouch.distinct 637 | return "FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT"; 638 | case PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND://android.hardware.faketouch.multitouch.jazzhand 639 | return "FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND"; 640 | case PackageManager.FEATURE_FINGERPRINT://android.hardware.fingerprint 641 | return "FEATURE_FINGERPRINT";//API 23 642 | case PackageManager.FEATURE_GAMEPAD://android.hardware.gamepad 643 | return "FEATURE_GAMEPAD"; 644 | case PackageManager.FEATURE_HIFI_SENSORS://android.hardware.sensor.hifi_sensors 645 | return "FEATURE_HIFI_SENSORS";//API 23 646 | case PackageManager.FEATURE_HOME_SCREEN://android.software.home_screen 647 | return "FEATURE_HOME_SCREEN"; 648 | case PackageManager.FEATURE_INPUT_METHODS://android.software.input_methods 649 | return "FEATURE_INPUT_METHODS"; 650 | case PackageManager.FEATURE_LEANBACK://android.software.leanback 651 | return "FEATURE_LEANBACK"; 652 | case PackageManager.FEATURE_LIVE_TV://android.software.live_tv 653 | return "FEATURE_LIVE_TV"; 654 | case PackageManager.FEATURE_LIVE_WALLPAPER://android.software.live_wallpaper 655 | return "FEATURE_LIVE_WALLPAPER"; 656 | case PackageManager.FEATURE_LOCATION://android.hardware.location 657 | return "FEATURE_LOCATION"; 658 | case PackageManager.FEATURE_LOCATION_GPS://android.hardware.location.gps 659 | return "FEATURE_LOCATION_GPS"; 660 | case PackageManager.FEATURE_LOCATION_NETWORK://android.hardware.location.network 661 | return "FEATURE_LOCATION_NETWORK"; 662 | case PackageManager.FEATURE_MANAGED_USERS://android.software.managed_users 663 | return "FEATURE_MANAGED_USERS"; 664 | case PackageManager.FEATURE_MICROPHONE://android.hardware.microphone 665 | return "FEATURE_MICROPHONE"; 666 | case PackageManager.FEATURE_MIDI://android.software.midi 667 | return "FEATURE_MIDI";//API 23 668 | case PackageManager.FEATURE_NFC://android.hardware.nfc 669 | return "FEATURE_NFC"; 670 | case PackageManager.FEATURE_NFC_HOST_CARD_EMULATION://android.hardware.nfc.hce 671 | return "FEATURE_NFC_HOST_CARD_EMULATION"; 672 | case PackageManager.FEATURE_OPENGLES_EXTENSION_PACK://android.hardware.opengles.aep 673 | return "FEATURE_OPENGLES_EXTENSION_PACK"; 674 | case PackageManager.FEATURE_PRINTING://android.software.print 675 | return "FEATURE_PRINTING"; 676 | case PackageManager.FEATURE_SCREEN_LANDSCAPE://android.hardware.screen.landscape 677 | return "FEATURE_SCREEN_LANDSCAPE"; 678 | case PackageManager.FEATURE_SCREEN_PORTRAIT://android.hardware.screen.portrait 679 | return "FEATURE_SCREEN_PORTRAIT"; 680 | case PackageManager.FEATURE_SECURELY_REMOVES_USERS://android.software.securely_removes_users 681 | return "FEATURE_SECURELY_REMOVES_USERS"; 682 | case PackageManager.FEATURE_SENSOR_ACCELEROMETER://android.hardware.sensor.accelerometer 683 | return "FEATURE_SENSOR_ACCELEROMETER"; 684 | case PackageManager.FEATURE_SENSOR_AMBIENT_TEMPERATURE://android.hardware.sensor.ambient_temperature 685 | return "FEATURE_SENSOR_AMBIENT_TEMPERATURE"; 686 | case PackageManager.FEATURE_SENSOR_BAROMETER://android.hardware.sensor.barometer 687 | return "FEATURE_SENSOR_BAROMETER"; 688 | case PackageManager.FEATURE_SENSOR_COMPASS://android.hardware.sensor.compass 689 | return "FEATURE_SENSOR_COMPASS"; 690 | case PackageManager.FEATURE_SENSOR_GYROSCOPE://android.hardware.sensor.gyroscope 691 | return "FEATURE_SENSOR_GYROSCOPE"; 692 | case PackageManager.FEATURE_SENSOR_HEART_RATE://android.hardware.sensor.heartrate 693 | return "FEATURE_SENSOR_HEART_RATE"; 694 | case PackageManager.FEATURE_SENSOR_HEART_RATE_ECG://android.hardware.sensor.heartrate.ecg 695 | return "FEATURE_SENSOR_HEART_RATE_ECG"; 696 | case PackageManager.FEATURE_SENSOR_LIGHT://android.hardware.sensor.light 697 | return "FEATURE_SENSOR_LIGHT"; 698 | case PackageManager.FEATURE_SENSOR_PROXIMITY://android.hardware.sensor.proximity 699 | return "FEATURE_SENSOR_PROXIMITY"; 700 | case PackageManager.FEATURE_SENSOR_RELATIVE_HUMIDITY://android.hardware.sensor.relative_humidity 701 | return "FEATURE_SENSOR_RELATIVE_HUMIDITY"; 702 | case PackageManager.FEATURE_SENSOR_STEP_COUNTER://android.hardware.sensor.stepcounter 703 | return "FEATURE_SENSOR_STEP_COUNTER"; 704 | case PackageManager.FEATURE_SENSOR_STEP_DETECTOR://android.hardware.sensor.stepdetector 705 | return "FEATURE_SENSOR_STEP_DETECTOR"; 706 | case PackageManager.FEATURE_SIP://android.software.sip 707 | return "FEATURE_SIP"; 708 | case PackageManager.FEATURE_SIP_VOIP://android.software.sip.voip 709 | return "FEATURE_SIP_VOIP"; 710 | case PackageManager.FEATURE_TELEPHONY://android.hardware.telephony 711 | return "FEATURE_TELEPHONY"; 712 | case PackageManager.FEATURE_TELEPHONY_CDMA://android.hardware.telephony.cdma 713 | return "FEATURE_TELEPHONY_CDMA"; 714 | case PackageManager.FEATURE_TELEPHONY_GSM://android.hardware.telephony.gsm 715 | return "FEATURE_TELEPHONY_GSM"; 716 | case PackageManager.FEATURE_TELEVISION://android.hardware.type.television 717 | return "FEATURE_TELEVISION"; 718 | case PackageManager.FEATURE_TOUCHSCREEN://android.hardware.touchscreen 719 | return "FEATURE_TOUCHSCREEN"; 720 | case PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH://android.hardware.touchscreen.multitouch 721 | return "FEATURE_TOUCHSCREEN_MULTITOUCH"; 722 | case PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT://android.hardware.touchscreen.multitouch.distinct 723 | return "FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT"; 724 | case PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND://android.hardware.touchscreen.multitouch.jazzhand 725 | return "FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND"; 726 | case PackageManager.FEATURE_USB_ACCESSORY://android.hardware.usb.accessory 727 | return "FEATURE_USB_ACCESSORY"; 728 | case PackageManager.FEATURE_USB_HOST://android.hardware.usb.host 729 | return "FEATURE_USB_HOST"; 730 | case PackageManager.FEATURE_VERIFIED_BOOT://android.software.verified_boot 731 | return "FEATURE_VERIFIED_BOOT"; 732 | case PackageManager.FEATURE_WATCH://android.hardware.type.watch 733 | return "FEATURE_WATCH"; 734 | case PackageManager.FEATURE_WEBVIEW://android.software.webview 735 | return "FEATURE_WEBVIEW"; 736 | case PackageManager.FEATURE_WIFI://android.hardware.wifi 737 | return "FEATURE_WIFI"; 738 | case PackageManager.FEATURE_WIFI_DIRECT://android.hardware.wifi.direct 739 | return "FEATURE_WIFI_DIRECT"; 740 | default: 741 | return UNKNOWN; 742 | } 743 | } 744 | 745 | /** 746 | * @param width Physical width of screen 747 | * @param height Physical height of screen 748 | * @return The resolution format, like QVGA. 749 | */ 750 | public static String getResolutionFormat(int width, int height) 751 | { 752 | //Total pixels 753 | int pixels = width * height; 754 | //Pixels of the short side 755 | int min = width <= height ? width : height; 756 | switch (pixels) 757 | { 758 | /* 759 | * Video Graphics Array 760 | */ 761 | case 240 * 320://76800 762 | return "QVGA";//Quarter VGA 763 | case 240 * 400://96000 764 | return "WQVGA";//Wide QVGA, like Samsung I5800 765 | case 320 * 480://153600 766 | return "HVGA";//Half-size VGA 767 | case 480 * 640://307200 768 | return "VGA";//Video Graphics Array, like Motorola ME632 769 | case 640 * 960://614400 770 | if (min == 600)//case 600 * 1024://614400 771 | { 772 | return "WSVGA 2"; 773 | } 774 | return "DVGA";//Double-size VGA, like Meizu MX 775 | case 480 * 800://384000 776 | return "WVGA";//Wide VGA 777 | case 480 * 854://409920 778 | return "FWVGA";//Full WVGA 779 | case 600 * 800://480000 780 | return "SVGA";//Super VGA, like ONDA Vi30W 781 | //case 576 * 1024://589824 782 | // return "WSVGA 1";//Wide SVGA 783 | //case 600 * 1024://614400 784 | // return "WSVGA 2";//Like CUBE U25GT 785 | /* 786 | * Extended Graphics Array 787 | */ 788 | case 768 * 1024://786432 789 | return "XGA";//Extended Graphics Array 790 | case 768 * 1280://983040 791 | return "WXGA 1";//Wide XGA, like Google Nexus 4 792 | case 800 * 1280://1024000 793 | return "WXGA 2";//Like Google Nexus 7 794 | //case 1200 * 1600://1920000 795 | // return "UXGA";//Ultra XGA 796 | case 1200 * 1920://2304000 797 | return "WUXGA";//Widescreen UXGA, like Google Nexus 7 Ⅱ 798 | case 1536 * 2048://3145728 799 | return "QXGA";//Quad XGA, like Google Nexus 9 800 | case 1600 * 2560://4096000 801 | return "WQXGA";//Wide QXGA, like Google Nexus 10 802 | /* 803 | * High-Definition 804 | */ 805 | case 540 * 960://518400 806 | return "QHD";//Quarter HD 807 | case 720 * 1280://921600 808 | return "HD";//High-Definition 809 | //case 900 * 1600://1440000 810 | // return "HD+";//HD Plus 811 | case 1080 * 1920://2073600 812 | return "FHD";//Full HD 813 | //case 1080 * 2048://2211840 814 | // return "2K"; 815 | case 1440 * 2560://3686400 816 | return "QHD";//Quad HD, also WQHD, 2K, like Google Nexus 6 817 | case 2160 * 3840://8294400 818 | return "UHD";//Ultra HD, also 4K 819 | //case 2160 * 4096://8847360 820 | // return "4K"; 821 | /* 822 | * Other 823 | */ 824 | case 480 * 960://460800 825 | return UNKNOWN;//Like Coolpad 9900 826 | case 1080 * 1800://1944000 827 | return UNKNOWN;//Like Meizu MX 3 828 | case 1152 * 1920://2211840 829 | return UNKNOWN;//Like Meizu MX 4 830 | case 1536 * 2560://3932160 831 | return UNKNOWN;//Like Meizu MX 4 Pro 832 | default: 833 | return UNKNOWN; 834 | } 835 | } 836 | 837 | /** 838 | * Constant for screenLayout: bits that encode the size. 839 | * @param sl_size_mask "screenLayout & SCREENLAYOUT_SIZE_MASK" 840 | */ 841 | public static String getSLSizeMaskStr(int sl_size_mask) 842 | { 843 | switch (sl_size_mask) 844 | { 845 | case Configuration.SCREENLAYOUT_SIZE_UNDEFINED://0 846 | return "SCREENLAYOUT_SIZE_UNDEFINED"; 847 | case Configuration.SCREENLAYOUT_SIZE_SMALL://1 848 | return "SCREENLAYOUT_SIZE_SMALL"; 849 | case Configuration.SCREENLAYOUT_SIZE_NORMAL://2 850 | return "SCREENLAYOUT_SIZE_NORMAL"; 851 | case Configuration.SCREENLAYOUT_SIZE_LARGE://3 852 | return "SCREENLAYOUT_SIZE_LARGE"; 853 | case Configuration.SCREENLAYOUT_SIZE_XLARGE://4 854 | return "SCREENLAYOUT_SIZE_XLARGE"; 855 | default: 856 | return UNKNOWN; 857 | } 858 | } 859 | 860 | /** 861 | * Constant for screenLayout: bits that encode the size. 862 | * @param sl_size_mask "screenLayout & SCREENLAYOUT_SIZE_MASK" 863 | * @return Device type by screen size, "Handset" or "Tablet". 864 | */ 865 | public static String getDeviceTypeStr(int sl_size_mask) 866 | { 867 | switch (sl_size_mask) 868 | { 869 | case Configuration.SCREENLAYOUT_SIZE_SMALL://1 870 | case Configuration.SCREENLAYOUT_SIZE_NORMAL://2 871 | return "Handset"; 872 | case Configuration.SCREENLAYOUT_SIZE_LARGE://3 873 | case Configuration.SCREENLAYOUT_SIZE_XLARGE://4 874 | return "Tablet"; 875 | default: 876 | return UNKNOWN; 877 | } 878 | } 879 | 880 | /** 881 | * The GLES version used by an application. 882 | * The upper order 16 bits represent the major version and the lower order 16 bits the minor version. 883 | * @param gles_version "reqGlEsVersion" 884 | * @return Readable version of OpenGL ES, like 0x00030000 - 3.0 885 | */ 886 | public static String getGlEsVersion(int gles_version) 887 | { 888 | switch (gles_version) 889 | { 890 | case ConfigurationInfo.GL_ES_VERSION_UNDEFINED://0 891 | return "GL_ES_VERSION_UNDEFINED"; 892 | default: 893 | return String.format("%1$d.%2$d", gles_version >> 16, gles_version & 0x00001111); 894 | } 895 | } 896 | 897 | /** 898 | * The NETWORK_TYPE_xxxx for current data connection. 899 | * @param network_type "getNetworkType()" 900 | */ 901 | public static String getNetworkTypeStr(int network_type) 902 | { 903 | switch (network_type) 904 | { 905 | case TelephonyManager.NETWORK_TYPE_UNKNOWN://0 906 | return "NETWORK_TYPE_UNKNOWN"; 907 | //GPRS (2.5G) 908 | case TelephonyManager.NETWORK_TYPE_GPRS://1 909 | return "NETWORK_TYPE_GPRS"; 910 | //EDGE (2.75G) 911 | case TelephonyManager.NETWORK_TYPE_EDGE://2 912 | return "NETWORK_TYPE_EDGE"; 913 | //UMTS (3G) 914 | case TelephonyManager.NETWORK_TYPE_UMTS://3 915 | return "NETWORK_TYPE_UMTS"; 916 | //CDMA: Either IS95A or IS95B, also cdmaOne (2G) 917 | case TelephonyManager.NETWORK_TYPE_CDMA://4 918 | return "NETWORK_TYPE_CDMA"; 919 | //EVDO revision 0 (3G) 920 | case TelephonyManager.NETWORK_TYPE_EVDO_0://5 921 | return "NETWORK_TYPE_EVDO_0"; 922 | //EVDO revision A (3G) 923 | case TelephonyManager.NETWORK_TYPE_EVDO_A://6 924 | return "NETWORK_TYPE_EVDO_A"; 925 | //1xRTT, also CDMA2000 1x (2.5G/2.75G) 926 | case TelephonyManager.NETWORK_TYPE_1xRTT://7 927 | return "NETWORK_TYPE_1xRTT"; 928 | //HSDPA, also W-CDMA R5 (3.5G) 929 | case TelephonyManager.NETWORK_TYPE_HSDPA://8 930 | return "NETWORK_TYPE_HSDPA"; 931 | //HSUPA, also W-CDMA R6 (3.5G) 932 | case TelephonyManager.NETWORK_TYPE_HSUPA://9 933 | return "NETWORK_TYPE_HSUPA"; 934 | //HSPA also W-CDMA R5/R6 (3G) 935 | case TelephonyManager.NETWORK_TYPE_HSPA://10 936 | return "NETWORK_TYPE_HSPA"; 937 | //iDEN (2G) 938 | case TelephonyManager.NETWORK_TYPE_IDEN://11 939 | return "NETWORK_TYPE_IDEN"; 940 | //EVDO revision B (3G) 941 | case TelephonyManager.NETWORK_TYPE_EVDO_B://12 942 | return "NETWORK_TYPE_EVDO_B"; 943 | //LTE (4G) 944 | case TelephonyManager.NETWORK_TYPE_LTE://13 945 | return "NETWORK_TYPE_LTE"; 946 | //eHRPD, also Enhanced 1xEVDO (3G) 947 | case TelephonyManager.NETWORK_TYPE_EHRPD://14 948 | return "NETWORK_TYPE_EHRPD"; 949 | //HSPA+, also W-CDMA R7 (3.75G) 950 | case TelephonyManager.NETWORK_TYPE_HSPAP://15 951 | return "NETWORK_TYPE_HSPAP"; 952 | //GSM (2G) 953 | //This is marked with "@hide". 954 | case 16://TelephonyManager.NETWORK_TYPE_GSM 955 | return "NETWORK_TYPE_GSM"; 956 | //TD-SCDMA (3G) 957 | //This is marked with "@hide". 958 | case 17://TelephonyManager.NETWORK_TYPE_TD_SCDMA 959 | return "NETWORK_TYPE_TD_SCDMA"; 960 | default: 961 | return UNKNOWN; 962 | } 963 | } 964 | 965 | /** 966 | * @return An explicit MIME data type. 967 | */ 968 | public static String getMIMEType(String file_name) 969 | { 970 | if (file_name.endsWith(".txt")) 971 | { 972 | return "text/plain"; 973 | } 974 | else if (file_name.endsWith(".apk")) 975 | { 976 | return "application/vnd.android.package-archive"; 977 | } 978 | else 979 | { 980 | return "*/*"; 981 | } 982 | } 983 | 984 | /** 985 | * The current width of the available screen space, in dp units. 986 | * @param screen_width_dp "screenWidthDp" 987 | */ 988 | public static String getScreenWidthDpStr(int screen_width_dp) 989 | { 990 | switch (screen_width_dp) 991 | { 992 | case Configuration.SCREEN_WIDTH_DP_UNDEFINED://0 993 | return "SCREEN_WIDTH_DP_UNDEFINED"; 994 | default: 995 | return UNKNOWN; 996 | } 997 | } 998 | 999 | /** 1000 | * The current height of the available screen space, in dp units. 1001 | * @param screen_height_dp "screenHeightDp" 1002 | */ 1003 | public static String getScreenHeightDpStr(int screen_height_dp) 1004 | { 1005 | switch (screen_height_dp) 1006 | { 1007 | case Configuration.SCREEN_HEIGHT_DP_UNDEFINED://0 1008 | return "SCREEN_HEIGHT_DP_UNDEFINED"; 1009 | default: 1010 | return UNKNOWN; 1011 | } 1012 | } 1013 | 1014 | /** 1015 | * You can verify which runtime is in use by calling System.getProperty("java.vm.version"). 1016 | * If ART is in use, the property's value is "2.0.0" or higher. 1017 | * @param java_vm_version "getProperty("java.vm.version")" 1018 | */ 1019 | public static String getVMType(String java_vm_version) 1020 | { 1021 | if (java_vm_version.startsWith("2.")) 1022 | { 1023 | return "ART"; 1024 | } 1025 | return "Dalvik"; 1026 | } 1027 | } 1028 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/util/MinSDKVersionUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild.util; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import org.xmlpull.v1.XmlPullParserException; 10 | import java.lang.reflect.Method; 11 | import java.lang.reflect.InvocationTargetException; 12 | import android.content.res.XmlResourceParser; 13 | import org.xmlpull.v1.XmlPullParser; 14 | import android.content.res.AssetManager; 15 | 16 | public class MinSDKVersionUtil 17 | { 18 | /** 19 | * Parses AndroidManifest.xml of the given apkFile and returns the value of 20 | * minSdkVersion using undocumented API which is marked as 21 | * "not to be used by applications" 22 | * 23 | * @return minSdkVersion or -1 if not found in AndroidManifest.xml 24 | */ 25 | public static int getMinSdkVersion(File apkFile) 26 | { 27 | if (apkFile == null) 28 | { 29 | return -1; 30 | } 31 | 32 | try 33 | { 34 | XmlResourceParser parser = getParserForManifest(apkFile); 35 | if (parser == null) 36 | { 37 | return -1; 38 | } 39 | while (parser.next() != XmlPullParser.END_DOCUMENT) 40 | { 41 | if (parser.getEventType() == XmlPullParser.START_TAG 42 | && parser.getName().equals("uses-sdk")) 43 | { 44 | for (int i = 0; i < parser.getAttributeCount(); ++ i) 45 | { 46 | if (parser.getAttributeName(i).equals("minSdkVersion")) 47 | { 48 | return parser.getAttributeIntValue(i, -1); 49 | } 50 | } 51 | } 52 | } 53 | } 54 | catch (XmlPullParserException e) 55 | { 56 | e.printStackTrace(); 57 | } 58 | catch (IOException e) 59 | { 60 | e.printStackTrace(); 61 | } 62 | 63 | return -1; 64 | } 65 | 66 | public static int getMinSdkVersion(String apk_path) 67 | { 68 | if (apk_path == null) 69 | { 70 | return -1; 71 | } 72 | return getMinSdkVersion(new File(apk_path)); 73 | } 74 | 75 | /** 76 | * Tries to get the parser for the given apkFile from {@link AssetManager} 77 | * using undocumented API which is marked as 78 | * "not to be used by applications" 79 | * 80 | * @throws IOException 81 | */ 82 | private static XmlResourceParser getParserForManifest(final File APKFILE) throws IOException 83 | { 84 | final Object ASSETMANAGERINSTANCE = getAssetManager(); 85 | final int COOKIE = addAssets(APKFILE, ASSETMANAGERINSTANCE); 86 | return ((AssetManager)ASSETMANAGERINSTANCE) 87 | .openXmlResourceParser(COOKIE, "AndroidManifest.xml"); 88 | } 89 | 90 | /** 91 | * Get the cookie of an asset using an undocumented API call that is marked 92 | * as "no to be used by applications" in its source code 93 | * 94 | * @see AssetManager.java#612 95 | * @return the cookie 96 | */ 97 | private static int addAssets(final File APKFILE, final Object ASSETMANAGERINSTANCE) 98 | { 99 | try 100 | { 101 | Method addAssetPath = ASSETMANAGERINSTANCE.getClass() 102 | .getMethod("addAssetPath", new Class[] { String.class }); 103 | return (Integer)addAssetPath.invoke(ASSETMANAGERINSTANCE, 104 | APKFILE.getAbsolutePath()); 105 | } 106 | catch (NoSuchMethodException e) 107 | { 108 | e.printStackTrace(); 109 | } 110 | catch (InvocationTargetException e) 111 | { 112 | e.printStackTrace(); 113 | } 114 | catch (IllegalAccessException e) 115 | { 116 | e.printStackTrace(); 117 | } 118 | 119 | return -1; 120 | } 121 | 122 | /** 123 | * Get {@link AssetManager} using reflection 124 | */ 125 | private static Object getAssetManager() 126 | { 127 | Class assetManagerClass = null; 128 | try 129 | { 130 | assetManagerClass = Class 131 | .forName("android.content.res.AssetManager"); 132 | return assetManagerClass.newInstance(); 133 | } 134 | catch (ClassNotFoundException e) 135 | { 136 | e.printStackTrace(); 137 | } 138 | catch (InstantiationException e) 139 | { 140 | e.printStackTrace(); 141 | } 142 | catch (IllegalAccessException e) 143 | { 144 | e.printStackTrace(); 145 | } 146 | 147 | return null; 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/util/UnitUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild.util; 6 | 7 | import java.text.DecimalFormat; 8 | 9 | public class UnitUtil 10 | { 11 | private static String UNKNOWN = ""; 12 | 13 | /** 14 | * About CPU frequency. 15 | * @param freq Unit: Hz 16 | */ 17 | public static String toFreq(long freq) 18 | { 19 | if (freq >= 1e9) 20 | { 21 | return String.format("%.2fGHz", (double)freq / (1e9)); 22 | } 23 | else if (freq >= 1e6) 24 | { 25 | return String.format("%.2fMHz", (double)freq / 1e6); 26 | } 27 | else if (freq >= 1e3) 28 | { 29 | return String.format("%.2fKHz", (double)freq / 1e3); 30 | } 31 | else 32 | { 33 | return freq + "Hz"; 34 | } 35 | } 36 | 37 | /** 38 | * About file size. 39 | * @param size Unit: byte 40 | */ 41 | public static String toMemory(long size) 42 | { 43 | if (size >= 1024 * 1024 * 1024) 44 | { 45 | return String.format("%.2fGB", (double)size / (1024 * 1024 * 1024)); 46 | } 47 | else if (size >= 1024 * 1024) 48 | { 49 | return String.format("%.2fMB", (double)size / (1024 * 1024)); 50 | } 51 | else if (size >= 1024) 52 | { 53 | return String.format("%.2fKB", (double)size / 1024); 54 | } 55 | else 56 | { 57 | return size + "B"; 58 | } 59 | } 60 | 61 | /** 62 | * Process dp value. 63 | */ 64 | public static String toDp(double size) 65 | { 66 | //Rounding-off method. Remain 1 decimal number. 67 | DecimalFormat decimalFormat = new DecimalFormat("#0.0dp"); 68 | 69 | return decimalFormat.format(size); 70 | } 71 | 72 | /** 73 | * Process inch value. 74 | */ 75 | public static String toInch(double size) 76 | { 77 | //Rounding-off method. Remain 2 decimal number. 78 | DecimalFormat decimalFormat = new DecimalFormat("#0.00\""); 79 | 80 | return decimalFormat.format(size); 81 | } 82 | 83 | /** 84 | * Convert to percentage and drop out decimal number. 85 | * @param usage Array like [total, available] 86 | */ 87 | public static String toPercent(long[] usage) 88 | { 89 | return toPercent(usage[0], usage[1]); 90 | } 91 | 92 | /** 93 | * Convert to percentage and drop out decimal number. 94 | */ 95 | public static String toPercent(long total, long avail) 96 | { 97 | return toPercent(total, avail, 0); 98 | } 99 | 100 | /** 101 | * Convert to percentage. 102 | * @param precision How many decimal number to remain. 103 | */ 104 | public static String toPercent(long total, long avail, int precision) 105 | { 106 | if (total <= 0) 107 | { 108 | return UNKNOWN; 109 | } 110 | return toPercent((double)avail / total, precision); 111 | } 112 | 113 | /** 114 | * @param precision How many decimal number to remain. 115 | */ 116 | public static String toPercent(double value, int precision) 117 | { 118 | return String.format("%." + precision + "f%%", value * 100.0); 119 | } 120 | 121 | /** 122 | * Convert milliseconds to readable time. 123 | */ 124 | public static String toTime(long millis) 125 | { 126 | long day = millis / (24 * 60 * 60 * 1000); 127 | millis %= (24 * 60 * 60 * 1000); 128 | long hour = millis / (60 * 60 * 1000); 129 | millis %= (60 * 60 * 1000); 130 | long minute = millis / (60 * 1000); 131 | millis %= (60 * 1000); 132 | long second = millis / 1000; 133 | 134 | if (day > 0) 135 | { 136 | return String.format("%1$03d:%2$02d:%3$02d:%4$02d", day, hour, minute, second); 137 | } 138 | return String.format("%1$02d:%2$02d:%3$02d", hour, minute, second); 139 | } 140 | 141 | /** 142 | * Convert decimalism to other. 143 | * @param decimal Value in decimalism. 144 | * @param radix Which system to convert. (Only 2, 8, 16) 145 | */ 146 | public static String toBits(int decimal, int radix) 147 | { 148 | String num; 149 | switch (radix) 150 | { 151 | case 2: 152 | num = "00000000000000000000000000000000" + Integer.toBinaryString(decimal); 153 | return "0b" + num.substring(num.length() - 32); 154 | case 8: 155 | num = "00000000000" + Integer.toOctalString(decimal); 156 | return "0" + num.substring(num.length() - 11); 157 | case 16: 158 | num = "00000000" + Integer.toHexString(decimal); 159 | return "0x" + num.substring(num.length() - 8); 160 | default: 161 | return UNKNOWN; 162 | } 163 | } 164 | 165 | /** 166 | * Convert integer wraped in string to int safely. 167 | */ 168 | public static int toIntSafely(String text) 169 | { 170 | int result = -1; 171 | 172 | text = text.trim(); 173 | try 174 | { 175 | result = Integer.parseInt(text); 176 | } 177 | catch (NumberFormatException e) 178 | { 179 | e.printStackTrace(); 180 | } 181 | 182 | return result; 183 | } 184 | 185 | /** 186 | * Convert float value wraped in string to float safely. 187 | */ 188 | public static float toFloatSafely(String text) 189 | { 190 | float result = -1.0f; 191 | 192 | text = text.trim(); 193 | try 194 | { 195 | result = Float.parseFloat(text); 196 | } 197 | catch (NumberFormatException e) 198 | { 199 | e.printStackTrace(); 200 | } 201 | 202 | return result; 203 | } 204 | 205 | /** 206 | * Process ppi value. 207 | * @param ppi Unit: pixels 208 | */ 209 | public static String toPPI(double ppi) 210 | { 211 | return String.format("%.0fppi", ppi); 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /app/src/main/java/com/by_syk/osbuild/widget/MyTextView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author By_syk 3 | */ 4 | 5 | package com.by_syk.osbuild.widget; 6 | 7 | import com.by_syk.osbuild.R; 8 | import com.by_syk.osbuild.util.C; 9 | 10 | import android.content.Context; 11 | import android.graphics.Typeface; 12 | import android.util.AttributeSet; 13 | import android.widget.TextView; 14 | import android.annotation.TargetApi; 15 | 16 | public class MyTextView extends TextView 17 | { 18 | public MyTextView(Context context) 19 | { 20 | super(context, null); 21 | } 22 | 23 | public MyTextView(Context context, AttributeSet attrs) 24 | { 25 | super(context, attrs); 26 | 27 | init(context); 28 | } 29 | 30 | @TargetApi(16) 31 | private void init(Context context) 32 | { 33 | //Modify typeface to Monaco, a monospaced font from Apple Mac. 34 | super.setTypeface(Typeface 35 | .createFromAsset(context.getAssets(), "fonts/Monaco.ttf")); 36 | 37 | //Set line space to 1.4 times. 38 | super.setLineSpacing(0f, 1.4f); 39 | 40 | //Set edge distance of page. 41 | int padding_page = getResources().getDimensionPixelSize(R.dimen.padding_text); 42 | if (C.SDK >= 16) 43 | { 44 | super.setPaddingRelative(padding_page, padding_page, padding_page, padding_page); 45 | } 46 | else 47 | { 48 | super.setPadding(padding_page, padding_page, padding_page, padding_page); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/res/anim-v21/anim_right_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim-v21/button_elevation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/anim/anim_alpha_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/layout_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_action_share.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_fab_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/oval_ripple.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout-v21/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 27 | 28 | 33 | 34 | 39 | 40 | 46 | 47 | 53 | 54 | 60 | 61 | 67 | 68 | 74 | 75 | 81 | 82 | 88 | 89 | 95 | 96 | 102 | 103 | 109 | 110 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /app/src/main/res/layout-v4/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 25 | 26 | 31 | 32 | 37 | 38 | 44 | 45 | 51 | 52 | 58 | 59 | 65 | 66 | 72 | 73 | 79 | 80 | 86 | 87 | 93 | 94 | 100 | 101 | 107 | 108 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_reader.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_white_paper.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_text_ask.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_unicode.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/menu-v11/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 22 | 23 | 27 | 28 | 32 | 33 | 36 | 37 | 40 | 43 | 46 | 49 | 50 | 51 | 52 | 55 | 56 | 59 | 62 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /app/src/main/res/menu-v11/menu_reader.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 12 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/menu-v4/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 14 | 15 | 16 | 17 | 21 | 22 | 26 | 27 | 31 | 32 | 35 | 36 | 39 | 42 | 45 | 48 | 49 | 50 | 51 | 54 | 55 | 58 | 61 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /app/src/main/res/menu-v4/menu_reader.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 12 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/raw/app_module.const: -------------------------------------------------------------------------------- 1 | android.content.pm.PackageInfo. 2 | requestedPermissions: Value (API Level) 3 | android.permission.ACCESS_CHECKIN_PROPERTIES 1 4 | android.permission.ACCESS_COARSE_LOCATION 1 5 | android.permission.ACCESS_FINE_LOCATION 1 6 | android.permission.ACCESS_LOCATION_EXTRA_COMMANDS 1 7 | android.permission.ACCESS_NETWORK_STATE 1 8 | android.permission.ACCESS_NOTIFICATION_POLICY 23 9 | android.permission.ACCESS_WIFI_STATE 1 10 | android.permission.ACCOUNT_MANAGER 5 11 | android.permission.BATTERY_STATS 1 12 | android.permission.BIND_ACCESSIBILITY_SERVICE 16 13 | android.permission.BIND_APPWIDGET 3 14 | android.permission.BIND_CARRIER_MESSAGING_SERVICE 22 23 15 | android.permission.BIND_CARRIER_SERVICES 23 16 | android.permission.BIND_CHOOSER_TARGET_SERVICE 23 17 | android.permission.BIND_DEVICE_ADMIN 8 18 | android.permission.BIND_DREAM_SERVICE 21 19 | android.permission.BIND_INCALL_SERVICE 23 20 | android.permission.BIND_INPUT_METHOD 3 21 | android.permission.BIND_MIDI_DEVICE_SERVICE 23 22 | android.permission.BIND_NFC_SERVICE 19 23 | android.permission.BIND_NOTIFICATION_LISTENER_SERVICE 18 24 | android.permission.BIND_PRINT_SERVICE 19 25 | android.permission.BIND_REMOTEVIEWS 11 26 | android.permission.BIND_TELECOM_CONNECTION_SERVICE 23 27 | android.permission.BIND_TEXT_SERVICE 14 28 | android.permission.BIND_TV_INPUT 21 29 | android.permission.BIND_VOICE_INTERACTION 21 30 | android.permission.BIND_VPN_SERVICE 14 31 | android.permission.BIND_WALLPAPER 8 32 | android.permission.BLUETOOTH 1 33 | android.permission.BLUETOOTH_ADMIN 1 34 | android.permission.BLUETOOTH_PRIVILEGED 19 35 | android.permission.BODY_SENSORS 20 36 | android.permission.BROADCAST_PACKAGE_REMOVED 1 37 | android.permission.BROADCAST_SMS 2 38 | android.permission.BROADCAST_STICKY 1 39 | android.permission.BROADCAST_WAP_PUSH 2 40 | android.permission.CALL_PHONE 1 41 | android.permission.CALL_PRIVILEGED 1 42 | android.permission.CAMERA 1 43 | android.permission.CAPTURE_AUDIO_OUTPUT 19 44 | android.permission.CAPTURE_SECURE_VIDEO_OUTPUT 19 45 | android.permission.CAPTURE_VIDEO_OUTPUT 19 46 | android.permission.CHANGE_COMPONENT_ENABLED_STATE 1 47 | android.permission.CHANGE_CONFIGURATION 1 48 | android.permission.CHANGE_NETWORK_STATE 1 49 | android.permission.CHANGE_WIFI_MULTICAST_STATE 4 50 | android.permission.CHANGE_WIFI_STATE 1 51 | android.permission.CLEAR_APP_CACHE 1 52 | android.permission.CONTROL_LOCATION_UPDATES 1 53 | android.permission.DELETE_CACHE_FILES 1 54 | android.permission.DELETE_PACKAGES 1 55 | android.permission.DIAGNOSTIC 1 56 | android.permission.DISABLE_KEYGUARD 1 57 | android.permission.DUMP 1 58 | android.permission.EXPAND_STATUS_BAR 1 59 | android.permission.FACTORY_TEST 1 60 | android.permission.FLASHLIGHT 1 61 | android.permission.GET_ACCOUNTS 1 62 | android.permission.GET_PACKAGE_SIZE 1 63 | android.permission.GET_TASKS 1 21 64 | android.permission.GET_TOP_ACTIVITY_INFO 18 65 | android.permission.GLOBAL_SEARCH 4 66 | android.permission.INJECT_EVENTS 1 67 | android.permission.INSTALL_LOCATION_PROVIDER 4 68 | android.permission.INSTALL_PACKAGES 1 69 | android.permission.INTERNET 1 70 | android.permission.KILL_BACKGROUND_PROCESSES 8 71 | android.permission.LOCATION_HARDWARE 18 72 | android.permission.MANAGE_DOCUMENTS 19 73 | android.permission.MASTER_CLEAR 1 74 | android.permission.MEDIA_CONTENT_CONTROL 19 75 | android.permission.MODIFY_AUDIO_SETTINGS 1 76 | android.permission.MODIFY_PHONE_STATE 1 77 | android.permission.MOUNT_FORMAT_FILESYSTEMS 3 78 | android.permission.MOUNT_UNMOUNT_FILESYSTEMS 1 79 | android.permission.NFC 9 80 | android.permission.PACKAGE_USAGE_STATS 23 81 | android.permission.PERSISTENT_ACTIVITY 1 9 82 | android.permission.PROCESS_OUTGOING_CALLS 1 83 | android.permission.READ_CALENDAR 1 84 | android.permission.READ_CALL_LOG 16 85 | android.permission.READ_CONTACTS 1 86 | android.permission.READ_EXTERNAL_STORAGE 16 87 | android.permission.READ_FRAME_BUFFER 1 88 | android.permission.READ_INPUT_STATE 1 16 89 | android.permission.READ_LOGS 1 90 | android.permission.READ_PHONE_STATE 1 91 | android.permission.READ_SMS 1 92 | android.permission.READ_SYNC_SETTINGS 1 93 | android.permission.READ_SYNC_STATS 1 94 | android.permission.READ_USER_DICTIONARY 16 95 | android.permission.REBOOT 1 96 | android.permission.RECEIVE_BOOT_COMPLETED 1 97 | android.permission.RECEIVE_MMS 1 98 | android.permission.RECEIVE_SMS 1 99 | android.permission.RECEIVE_WAP_PUSH 1 100 | android.permission.RECORD_AUDIO 1 101 | android.permission.REORDER_TASKS 1 102 | android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS 23 103 | android.permission.REQUEST_INSTALL_PACKAGES 23 104 | android.permission.RESTART_PACKAGES 1 8 105 | android.permission.SEND_RESPOND_VIA_MESSAGE 18 106 | android.permission.SEND_SMS 1 107 | android.permission.SET_ALWAYS_FINISH 1 108 | android.permission.SET_ANIMATION_SCALE 1 109 | android.permission.SET_DEBUG_APP 1 110 | android.permission.SET_PREFERRED_APPLICATIONS 1 7 111 | android.permission.SET_PROCESS_LIMIT 1 112 | android.permission.SET_TIME 8 113 | android.permission.SET_TIME_ZONE 1 114 | android.permission.SET_WALLPAPER 1 115 | android.permission.SET_WALLPAPER_HINTS 1 116 | android.permission.SIGNAL_PERSISTENT_PROCESSES 1 117 | android.permission.STATUS_BAR 1 118 | android.permission.SYSTEM_ALERT_WINDOW 1 119 | android.permission.TRANSMIT_IR 19 120 | android.permission.UPDATE_DEVICE_STATS 3 121 | android.permission.USE_FINGERPRINT 23 122 | android.permission.USE_SIP 9 123 | android.permission.VIBRATE 1 124 | android.permission.WAKE_LOCK 1 125 | android.permission.WRITE_APN_SETTINGS 1 126 | android.permission.WRITE_CALENDAR 1 127 | android.permission.WRITE_CALL_LOG 16 128 | android.permission.WRITE_CONTACTS 1 129 | android.permission.WRITE_EXTERNAL_STORAGE 4 130 | android.permission.WRITE_GSERVICES 1 131 | android.permission.WRITE_SECURE_SETTINGS 3 132 | android.permission.WRITE_SETTINGS 1 133 | android.permission.WRITE_SYNC_SETTINGS 1 134 | com.android.alarm.permission.SET_ALARM 9 135 | com.android.launcher.permission.INSTALL_SHORTCUT 19 136 | com.android.launcher.permission.UNINSTALL_SHORTCUT 19 137 | com.android.voicemail.permission.ADD_VOICEMAIL 14 138 | com.android.voicemail.permission.READ_VOICEMAIL 21 139 | com.android.voicemail.permission.WRITE_VOICEMAIL 21 140 | 141 | (From: API docs of level 23, https://developer.android.com/reference) 142 | -------------------------------------------------------------------------------- /app/src/main/res/raw/ascii.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 4 5 6 7 2 | 0 NUL DLE 0 @ P ` p 3 | 1 SOH DC1 ! 1 A Q a q 4 | 2 STX DC2 " 2 B R b r 5 | 3 ETX DC3 # 3 C S c s 6 | 4 EOT DC4 $ 4 D T d t 7 | 5 ENQ NAK % 5 E U e u 8 | 6 ACK SYN & 6 F V f v 9 | 7 BEL ETB ' 7 G W g w 10 | 8 BS CAN ( 8 H X h x 11 | 9 HT EM ) 9 I Y i y 12 | A LF SUB * : J Z j z 13 | B VT ESC + ; K [ k { 14 | C FF FS , < L \ l | 15 | D CR GS - = M ] m } 16 | E SO RS . > N ^ n ~ 17 | F SI US / ? O _ o DEL 18 | 19 | 20 | 21 | NUL: null 22 | SOH: start of headling 23 | STX: start of text 24 | ETX: end of text 25 | EOT: end of transmission 26 | ENQ: enquiry 27 | ACK: acknowledge 28 | BEL: bell 29 | BS: backspace 30 | HT: horizontal TAB 31 | LF: NL (new line) line feed 32 | VT: vertical TAB 33 | FF: NP (new page) form feed 34 | CR: carriage return 35 | SO: shift out 36 | SI: shift in 37 | DLE: data link escape 38 | DC1: device control 1 39 | DC2: device control 2 40 | DC3: device cobtrol 3 41 | DC4: device control 4 42 | NAK: negative acknowledge 43 | SYN: synchronous idle 44 | ETB: end of trans. block 45 | CAN: cancel 46 | EM: end of medium 47 | SUB: substitude 48 | ESC: escape 49 | FS: file separator 50 | GS: group separator 51 | RS: record separator 52 | US: unit separator 53 | DEL: delete 54 | -------------------------------------------------------------------------------- /app/src/main/res/raw/build_module.const: -------------------------------------------------------------------------------- 1 | android.os.Build. 2 | VERSION_SDK. 3 | SDK_INT: Value Name (Version) Release Date (Statistics) (API Level) 4 | 1 BASE 1.0 2008-10 null 4 5 | 2 BASE_1_1 1.1 2009-02 null 4 6 | 3 CUPCAKE 1.5 2009-05 null 4 7 | 4 DONUT 1.6 2009-09 null 4 8 | 5 ECLAIR 2.0 2009-11 null 5 9 | 6 ECLAIR_0_1 2.0.1 2009-12 null 6 10 | 7 ECLAIR_MR1 2.1.x 2010-01 null 7 11 | 8 FROYO 2.2.x 2010-06 0.2% 8 12 | 9 GINGERBREAD 2.3/2.3.1/2.3.2 2010-11 null 9 13 | 10 GINGERBREAD_MR1 2.3.3/2.3.4 2011-02 3.8% 10 14 | 11 HONEYCOMB 3.0.x 2011-02 null 11 15 | 12 HONEYCOMB_MR1 3.1.x 2011-05 null 12 16 | 13 HONEYCOMB_MR2 3.2 2011-06 null 13 17 | 14 ICE_CREAM_SANDWICH 4.0/4.0.1/4.0.2 2011-10 null 14 18 | 15 ICE_CREAM_SANDWICH_MR1 4.0.3/4.0.4 2011-12 3.3% 15 19 | 16 JELLY_BEAN 4.1/4.1.1 2012-06 11.0% 16 20 | 17 JELLY_BEAN_MR1 4.2/4.2.2 2012-11 13.9% 17 21 | 18 JELLY_BEAN_MR2 4.3 2013-07 4.1% 18 22 | 19 KITKAT 4.4 2013-10 37.8% 19 23 | 20 KITKAT_WATCH 4.4W 2014-06 null 20 24 | 21 LOLLIPOP 5.0 2014-11 15.5% 21 25 | 22 LOLLIPOP_MR1 5.1 2015-03 10.1% 22 26 | 23 M 6.0 2015-10 0.3% 23 27 | 1000 CUR_DEVELOPMENT null null null null 28 | 29 | [Statistics: Data collected from Google Play during a 7-day period ending on November 2, 2015.] 30 | (From: API docs of level 23, https://developer.android.com/reference, partly) 31 | -------------------------------------------------------------------------------- /app/src/main/res/raw/cpu_module.const: -------------------------------------------------------------------------------- 1 | /sys/devices/system/cpu/ 2 | cpu0/cpufreq/ 3 | scaling_governor: Value (Statistics) 4 | ondemand 51.7% 5 | interactive 21.3% 6 | hotplug 15.2% 7 | pegasusq 5.2% 8 | hybird 2.4% 9 | k3hotplug 1.4% 10 | performance 0.9% 11 | pwrctrl_hotplug 0.9% 12 | conservative 0.5% 13 | april 0.5% 14 | 15 | [Statistics: Not officially. Data collected from about 200 devices on Testin by developer on July 10, 2015.] 16 | -------------------------------------------------------------------------------- /app/src/main/res/raw/display_module.const: -------------------------------------------------------------------------------- 1 | android.view.Display. 2 | getRotation(): Value Name (API Level) 3 | 0 ROTATION_0 1 4 | 90 ROTATION_90 1 5 | 180 ROTATION_180 1 6 | 270 ROTATION_270 1 7 | android.util.DisplayMetrics. 8 | densityDpi: Value Name (Statistics) (API Level) 9 | 120 DENSITY_LOW 3.4% 4 10 | 160 DENSITY_MEDIUM/DENSITY_DEFAULT 13.8% 4 11 | 213 DENSITY_TV 2.3% 13 12 | 240 DENSITY_HIGH 42.2% 4 13 | 280 DENSITY_280 null 22 14 | 320 DENSITY_XHIGH 23.0% 9 15 | 360 DENSITY_360 null 23 16 | 400 DENSITY_400 null 19 17 | 420 DENSITY_420 null 23 18 | 480 DENSITY_XXHIGH 15.3% 16 19 | 560 DENSITY_560 null 21 20 | 640 DENSITY_XXXHIGH null 18 21 | android.content.res.Configuration. 22 | orientation: Value Name (API Level) 23 | 0 ORIENTATION_UNDEFINED 1 24 | 1 ORIENTATION_PORTRAIT 1 25 | 2 ORIENTATION_LANDSCAPE 1 26 | 3 ORIENTATION_SQUARE 1 16 27 | screenLayout & SCREENLAYOUT_SIZE_MASK: Value Name Device Type (Statistics) (API Level) 28 | 0 SCREENLAYOUT_SIZE_UNDEFINED null null 4 29 | 1 SCREENLAYOUT_SIZE_SMALL Handset 3.1% 4 30 | 2 SCREENLAYOUT_SIZE_NORMAL Handset 84.5% 4 31 | 3 SCREENLAYOUT_SIZE_LARGE Tablet 8.4% 4 32 | 4 SCREENLAYOUT_SIZE_XLARGE Tablet 4.0% 9 33 | locale: Value Name (API Level) 34 | null ROOT 9 35 | de GERMAN 1 36 | de_DE GERMANY 1 37 | en ENGLISH 1 38 | en_CA CANADA 1 39 | en_GB UK 1 40 | en_US US 1 41 | fr FRENCH 1 42 | fr_CA CANADA_FRENCH 1 43 | fr_FR FRANCE 1 44 | it ITALIAN 1 45 | it_IT ITALY 1 46 | ja JAPANESE 1 47 | ja_JP JAPAN 1 48 | ko KOREAN 1 49 | ko_KR KOREA 1 50 | zh CHINESE 1 51 | zh_CN SIMPLIFIED_CHINESE/CHINA/PRC 1 52 | zh_TW TRADITIONAL_CHINESE/TAIWAN 1 53 | Extra: 54 | Width-height Ratio: (Ratio 1) Ratio 2 (Resolution) (Total Pixels) Resolution Format 55 | 0.750 3:4 240*320 77K QVGA 56 | 0.600 3:5 240*400 96K WQVGA 57 | 0.667 2:3 320*480 154K HVGA 58 | 0.750 3:4 480*640 307K VGA 59 | 0.667 2:3 640*960 614K DVGA 60 | 0.600 3:5 480*800 384K WVGA 61 | 0.562 240:427 480*854 410K FWVGA 62 | 0.750 3:4 600*800 480K SVGA 63 | 0.586 75:128 600*1024 614K WSVGA 2 64 | 0.750 3:4 768*1024 786K XGA 65 | 0.600 3:5 768*1280 983K WXGA 1 66 | 0.625 5:8 800*1280 1024K WXGA 2 67 | 0.625 5:8 1200*1920 2304K WUXGA 68 | 0.750 3:4 1536*2048 3146K QXGA 69 | 0.625 5:8 1600*2560 4096K WQXGA 70 | 0.563 9:16 540*960 518K QHD 71 | 0.563 9:16 720*1280 922K HD 72 | 0.563 9:16 1080*1920 2074K FHD 73 | 0.563 9:16 1440*2560 3686K QHD (2K) 74 | 0.563 9:16 2160*3840 8294K UHD (4K) 75 | 0.500 1:2 480*960 461K ? 76 | 0.600 3:5 1080*1800 1944K ? 77 | 0.600 3:5 1152*1920 2212K ? 78 | 0.600 3:5 1536*2560 3932K ? 79 | 80 | [Statistics: Data collected from Google Play during a 7-day period ending on November 2, 2015.] 81 | (From: API docs of level 23, https://developer.android.com/reference, partly) 82 | -------------------------------------------------------------------------------- /app/src/main/res/raw/extra_77_694.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/by-syk/OSBuild/98008568eef32f1cc90077b6aa432cdb4c48fc7f/app/src/main/res/raw/extra_77_694.db -------------------------------------------------------------------------------- /app/src/main/res/raw/memory_module.const: -------------------------------------------------------------------------------- 1 | android.app.ActivityManager. 2 | getDeviceConfigurationInfo(). 3 | reqGlEsVersion: Value Name (Statistics) (API Level) 4 | 0x00010000 1.0 null 1 5 | 0x00010001 1.1 null 1 6 | 0x00020000 2.0 56.6% 8 7 | 0x00030000 3.0 38.2% 18 8 | 0x00030001 3.1 5.2% 21 9 | android.os.Environment. 10 | getExternalStorageState(): Value Name (API Level) 11 | bad_removal MEDIA_BAD_REMOVAL 1 12 | checking MEDIA_CHECKING 3 13 | ejecting MEDIA_EJECTING 23 14 | mounted MEDIA_MOUNTED 1 15 | mounted_read_only MEDIA_MOUNTED_READ_ONLY 1 16 | nofs MEDIA_NOFS 3 17 | removed MEDIA_REMOVED 1 18 | shared MEDIA_SHARED 1 19 | unknown MEDIA_UNKNOWN 19 20 | unmountable MEDIA_UNMOUNTABLE 1 21 | unmounted MEDIA_UNMOUNTED 1 22 | 23 | [Statistics: Data collected from Google Play during a 7-day period ending on November 2, 2015.] 24 | (From: API docs of level 23, https://developer.android.com/reference) 25 | -------------------------------------------------------------------------------- /app/src/main/res/raw/package_module.const: -------------------------------------------------------------------------------- 1 | android.content.pm.PackageManager. 2 | getSystemAvailableFeatures(): Value Name (API Level) 3 | android.hardware.audio.low_latency FEATURE_AUDIO_LOW_LATENCY 9 4 | android.hardware.audio.output FEATURE_AUDIO_OUTPUT 21 5 | android.hardware.audio.pro FEATURE_AUDIO_PRO 23 6 | android.hardware.bluetooth FEATURE_BLUETOOTH 8 7 | android.hardware.bluetooth_le FEATURE_BLUETOOTH_LE 18 8 | android.hardware.camera FEATURE_CAMERA 7 9 | android.hardware.camera.any FEATURE_CAMERA_ANY 17 10 | android.hardware.camera.autofocus FEATURE_CAMERA_AUTOFOCUS 7 11 | android.hardware.camera.capability.manual_post_processing FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING 21 12 | android.hardware.camera.capability.manual_sensor FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR 21 13 | android.hardware.camera.capability.raw FEATURE_CAMERA_CAPABILITY_RAW 21 14 | android.hardware.camera.external FEATURE_CAMERA_EXTERNAL 20 15 | android.hardware.camera.flash FEATURE_CAMERA_FLASH 7 16 | android.hardware.camera.front FEATURE_CAMERA_FRONT 9 17 | android.hardware.camera.level.full FEATURE_CAMERA_LEVEL_FULL 21 18 | android.hardware.consumerir FEATURE_CONSUMER_IR 19 19 | android.hardware.faketouch FEATURE_FAKETOUCH 11 20 | android.hardware.faketouch.multitouch.distinct FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT 13 21 | android.hardware.faketouch.multitouch.jazzhand FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND 13 22 | android.hardware.fingerprint FEATURE_FINGERPRINT 23 23 | android.hardware.gamepad FEATURE_GAMEPAD 21 24 | android.hardware.location FEATURE_LOCATION 8 25 | android.hardware.location.gps FEATURE_LOCATION_GPS 8 26 | android.hardware.location.network FEATURE_LOCATION_NETWORK 8 27 | android.hardware.microphone FEATURE_MICROPHONE 8 28 | android.hardware.nfc FEATURE_NFC 9 29 | android.hardware.nfc.hce FEATURE_NFC_HOST_CARD_EMULATION 19 30 | android.hardware.opengles.aep FEATURE_OPENGLES_EXTENSION_PACK 21 31 | android.hardware.screen.landscape FEATURE_SCREEN_LANDSCAPE 13 32 | android.hardware.screen.portrait FEATURE_SCREEN_PORTRAIT 13 33 | android.hardware.sensor.accelerometer FEATURE_SENSOR_ACCELEROMETER 8 34 | android.hardware.sensor.ambient_temperature FEATURE_SENSOR_AMBIENT_TEMPERATURE 21 35 | android.hardware.sensor.barometer FEATURE_SENSOR_BAROMETER 9 36 | android.hardware.sensor.compass FEATURE_SENSOR_COMPASS 8 37 | android.hardware.sensor.gyroscope FEATURE_SENSOR_GYROSCOPE 9 38 | android.hardware.sensor.heartrate FEATURE_SENSOR_HEART_RATE 20 39 | android.hardware.sensor.heartrate.ecg FEATURE_SENSOR_HEART_RATE_ECG 21 40 | android.hardware.sensor.hifi_sensors FEATURE_HIFI_SENSORS 23 41 | android.hardware.sensor.light FEATURE_SENSOR_LIGHT 7 42 | android.hardware.sensor.proximity FEATURE_SENSOR_PROXIMITY 7 43 | android.hardware.sensor.relative_humidity FEATURE_SENSOR_RELATIVE_HUMIDITY 21 44 | android.hardware.sensor.stepcounter FEATURE_SENSOR_STEP_COUNTER 19 45 | android.hardware.sensor.stepdetector FEATURE_SENSOR_STEP_DETECTOR 19 46 | android.hardware.telephony FEATURE_TELEPHONY 7 47 | android.hardware.telephony.cdma FEATURE_TELEPHONY_CDMA 7 48 | android.hardware.telephony.gsm FEATURE_TELEPHONY_GSM 7 49 | android.hardware.type.automotive FEATURE_AUTOMOTIVE 23 50 | android.hardware.type.television FEATURE_TELEVISION 19 21 51 | android.hardware.touchscreen FEATURE_TOUCHSCREEN 8 52 | android.hardware.touchscreen.multitouch FEATURE_TOUCHSCREEN_MULTITOUCH 7 53 | android.hardware.touchscreen.multitouch.distinct FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT 8 54 | android.hardware.touchscreen.multitouch.jazzhand FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND 9 55 | android.hardware.type.watch FEATURE_WATCH 20 56 | android.hardware.usb.accessory FEATURE_USB_ACCESSORY 12 57 | android.hardware.usb.host FEATURE_USB_HOST 12 58 | android.hardware.wifi FEATURE_WIFI 8 59 | android.hardware.wifi.direct FEATURE_WIFI_DIRECT 14 60 | android.software.app_widgets FEATURE_APP_WIDGETS 18 61 | android.software.backup FEATURE_BACKUP 20 62 | android.software.connectionservice FEATURE_CONNECTION_SERVICE 21 63 | android.software.device_admin FEATURE_DEVICE_ADMIN 19 64 | android.software.home_screen FEATURE_HOME_SCREEN 18 65 | android.software.input_methods FEATURE_INPUT_METHODS 18 66 | android.software.leanback FEATURE_LEANBACK 21 67 | android.software.live_tv FEATURE_LIVE_TV 21 68 | android.software.live_wallpaper FEATURE_LIVE_WALLPAPER 7 69 | android.software.managed_users FEATURE_MANAGED_USERS 21 70 | android.software.midi FEATURE_MIDI 23 71 | android.software.print FEATURE_PRINTING 20 72 | android.software.securely_removes_users FEATURE_SECURELY_REMOVES_USERS 21 73 | android.software.sip FEATURE_SIP 9 74 | android.software.sip.voip FEATURE_SIP_VOIP 9 75 | android.software.verified_boot FEATURE_VERIFIED_BOOT 21 76 | android.software.webview FEATURE_WEBVIEW 20 77 | 78 | (From: API docs of level 23, https://developer.android.com/reference) 79 | -------------------------------------------------------------------------------- /app/src/main/res/raw/sensor_module.const: -------------------------------------------------------------------------------- 1 | android.hardware.SensorManager. 2 | getSensorList(TYPE_ALL): Value Name _ _ (API Level) 3 | -1 TYPE_ALL _ _ 3 4 | 1 TYPE_ACCELEROMETER _ _ 3 5 | 2 TYPE_MAGNETIC_FIELD _ _ 3 6 | 3 TYPE_ORIENTATION _ _ 3 8 7 | 4 TYPE_GYROSCOPE _ _ 3 8 | 5 TYPE_LIGHT _ _ 3 9 | 6 TYPE_PRESSURE _ _ 3 10 | 7 TYPE_TEMPERATURE _ _ 3 14 11 | 8 TYPE_PROXIMITY _ _ 3 12 | 9 TYPE_GRAVITY _ _ 9 13 | 10 TYPE_LINEAR_ACCELERATION _ _ 9 14 | 11 TYPE_ROTATION_VECTOR _ _ 9 15 | 12 TYPE_RELATIVE_HUMIDITY _ _ 14 16 | 13 TYPE_AMBIENT_TEMPERATURE _ _ 14 17 | 14 TYPE_MAGNETIC_FIELD_UNCALIBRATED _ _ 18 18 | 15 TYPE_GAME_ROTATION_VECTOR _ _ 18 19 | 16 TYPE_GYROSCOPE_UNCALIBRATED _ _ 18 20 | 17 TYPE_SIGNIFICANT_MOTION _ _ 18 21 | 18 TYPE_STEP_DETECTOR _ _ 19 22 | 19 TYPE_STEP_COUNTER _ _ 19 23 | 20 TYPE_GEOMAGNETIC_ROTATION_VECTOR _ _ 19 24 | 21 TYPE_HEART_RATE _ _ 20 25 | 26 | (From: API docs of level 23, https://developer.android.com/reference) 27 | -------------------------------------------------------------------------------- /app/src/main/res/raw/telephony_module.const: -------------------------------------------------------------------------------- 1 | android.telephony.TelephonyManager. 2 | getPhoneType(): Value Name (API Level) 3 | 0 PHONE_TYPE_NONE 1 4 | 1 PHONE_TYPE_GSM 1 5 | 2 PHONE_TYPE_CDMA 4 6 | 3 PHONE_TYPE_SIP 11 7 | getDeviceId(): _ (ID Length) (Phone Type) ID Type 8 | _ 15 PHONE_TYPE_GSM IMEI 9 | _ 8 PHONE_TYPE_CDMA ESN 10 | _ 14 PHONE_TYPE_CDMA MEID 11 | _ 15 PHONE_TYPE_CDMA MEID 12 | getSimState(): Value Name (API Level) 13 | 0 SIM_STATE_UNKNOWN 1 14 | 1 SIM_STATE_ABSENT 1 15 | 2 SIM_STATE_PIN_REQUIRED 1 16 | 3 SIM_STATE_PUK_REQUIRED 1 17 | 4 SIM_STATE_NETWORK_LOCKED 1 18 | 5 SIM_STATE_READY 1 19 | getSimOperator(): Value Sim Operator 20 | 454xx Hong Kong 21 | 455xx Macao 22 | 46000 China Mobile 23 | 46001 China Unicom 24 | 46002 China Mobile 25 | 46003 China Telecom 26 | 46005 China Telecom 27 | 46006 China Unicom 28 | 46007 China Mobile 29 | 46020 China Tietong 30 | 466xx Taiwan 31 | getNetworkType(): Value Name (Generation) (API Level) 32 | 0 NETWORK_TYPE_UNKNOWN null 1 33 | 1 NETWORK_TYPE_GPRS 2.5G 1 34 | 2 NETWORK_TYPE_EDGE 2.75G 1 35 | 3 NETWORK_TYPE_UMTS 3G 1 36 | 4 NETWORK_TYPE_CDMA 2G 4 37 | 5 NETWORK_TYPE_EVDO_0 3G 4 38 | 6 NETWORK_TYPE_EVDO_A 3G 4 39 | 7 NETWORK_TYPE_1xRTT 2.5G/2.75G 4 40 | 8 NETWORK_TYPE_HSDPA 3.5G 5 41 | 9 NETWORK_TYPE_HSUPA 3.5G 5 42 | 10 NETWORK_TYPE_HSPA 3G 5 43 | 11 NETWORK_TYPE_IDEN 2G 8 44 | 12 NETWORK_TYPE_EVDO_B 3G 9 45 | 13 NETWORK_TYPE_LTE 4G 11 46 | 14 NETWORK_TYPE_EHRPD 3G 11 47 | 15 NETWORK_TYPE_HSPAP 3.75G 13 48 | 16 NETWORK_TYPE_GSM 2G ? 49 | 17 NETWORK_TYPE_TD_SCDMA 3G ? 50 | 51 | (From: API docs of level 23, https://developer.android.com/reference, partly) 52 | -------------------------------------------------------------------------------- /app/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 56dp 5 | 40dp 6 | 1dp 7 | 4dp 8 | 16dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 21 | 22 | 27 | 28 |