├── .gitattributes ├── APK-Info.ini ├── icons ├── adb.bmp ├── exit.bmp ├── new.bmp ├── open.bmp ├── play.bmp ├── text.bmp ├── web.bmp ├── rename.bmp ├── update.bmp └── virustotal.bmp ├── screenshot.png ├── Application-source ├── APK-Info.ico └── APK-Info.au3 ├── APK-Info-Shell-Integration.bat ├── Documents ├── Readme.txt └── Changelog.txt └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ini diff 2 | -------------------------------------------------------------------------------- /APK-Info.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/APK-Info.ini -------------------------------------------------------------------------------- /icons/adb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/adb.bmp -------------------------------------------------------------------------------- /icons/exit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/exit.bmp -------------------------------------------------------------------------------- /icons/new.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/new.bmp -------------------------------------------------------------------------------- /icons/open.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/open.bmp -------------------------------------------------------------------------------- /icons/play.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/play.bmp -------------------------------------------------------------------------------- /icons/text.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/text.bmp -------------------------------------------------------------------------------- /icons/web.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/web.bmp -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/screenshot.png -------------------------------------------------------------------------------- /icons/rename.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/rename.bmp -------------------------------------------------------------------------------- /icons/update.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/update.bmp -------------------------------------------------------------------------------- /icons/virustotal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/icons/virustotal.bmp -------------------------------------------------------------------------------- /Application-source/APK-Info.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Enyby/APK-Info/HEAD/Application-source/APK-Info.ico -------------------------------------------------------------------------------- /APK-Info-Shell-Integration.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | ECHO APK-Info shell integration... 4 | ECHO. 5 | 6 | for %%H in (HKCU) do ( 7 | REG ADD "%%H\SOFTWARE\Classes\.apk" /ve /t REG_SZ /d "APK-Info" /f >nul 2>nul 8 | REG ADD "%%H\SOFTWARE\Classes\APK-Info\DefaultIcon" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\"" /f >nul 2>nul 9 | REG ADD "%%H\SOFTWARE\Classes\APK-Info\shell\open" /ve /t REG_SZ /d "APK-Info" /f >nul 2>nul 10 | REG ADD "%%H\SOFTWARE\Classes\APK-Info\shell\open\command" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\" \"%%1\"" /f >nul 2>nul 11 | 12 | REG ADD "%%H\SOFTWARE\Classes\SystemFileAssociations\.apk\Shell\APK-Info\Command" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\" \"%%1\"" /f >nul 2>nul 13 | ) 14 | 15 | ECHO APK-Info shell integration completed! 16 | ECHO. 17 | ECHO. 18 | ECHO **** Press any key to exit **** 19 | pause > NUL 20 | -------------------------------------------------------------------------------- /Documents/Readme.txt: -------------------------------------------------------------------------------- 1 | ***************************************************** Show OS GUI language 2 | Setting ShowOSLanguage=1 (default ShowOSLanguage=0) in the program title 3 | you can show the OSLang code. 4 | 5 | 6 | ***************************************************** Show command line option 7 | 8 | Setting ShowCmdLine=1 (default ShowCmdLine=0) in the program title 9 | you can show the parametrs passed to batch/command line to APK-Info.exe. 10 | 11 | 12 | ***************************************************** APK-Info shell integration 13 | 14 | It's included a registry setting to enable sAPK.Info shell integration. 15 | BEFORE to run it to activate shell integration, please edit the .reg. 16 | You can do it with ex. Notepad++ and set the right path for APK-Info.exe (path without space) 17 | 18 | 19 | ********************************************** Multilanguage Info 20 | 21 | The strings used by APK-Info GUI are located in APK-Info.ini file. 22 | If you want add new translation - use section [Strings-en] as source. 23 | Copy it and translate. 24 | 25 | To create french translation add [String-fr] section 26 | 27 | To create dutch translation add [String-nl] section 28 | 29 | To create norwegian translation add [String-no] section 30 | 31 | To create polish translation add [String-pl] section 32 | 33 | To create portoguese translation add [String-pt] section 34 | 35 | To create swedish translation add [String-sw] section 36 | 37 | 38 | One time create new section copy and paste in the new section the messages 39 | of [Strings-en] section and translate it. 40 | 41 | For more info about OSLang code please see on 42 | 43 | https://www.autoitscript.com/autoit3/docs/appendix/OSLangCodes.htm 44 | 45 | The language codes already enabled as automatic detection are 46 | 47 | ID = 0403 - Language_code="ca" 48 | ID = 0409 - Language_code="zh-TW" 49 | ID = 0409 - Language_code="en" 50 | ID = 040c - Language_code="fr" 51 | ID = 040e - Language_code="hu" 52 | ID = 0410 - Language_code="it" 53 | ID = 0413 - Language_code="nl" 54 | ID = 0415 - Language_code="pl" 55 | ID = 0416 - Language_code="pt-br" 56 | ID = 0419 - Language_code="ru" 57 | ID = 041b - Language_code="sk" 58 | ID = 0421 - Language_code="id" 59 | ID = 0429 - Language_code="fa" 60 | ID = 0804 - Language_code="zh-CN" 61 | ID = 0807 - Language_code="de" 62 | ID = 080a - Language_code="sp" 63 | 64 | Language strings already included in the program are for language 65 | ca,de,en,fa,fr,hu,id,it,nl,pl,pt-br,ru,sk,sp,zh-CN,zh-TW 66 | 67 | 68 | *****************************************************Forced GUI language 69 | 70 | ForceGUILanguage in APK-Info.ini 71 | 72 | Setting a value for ForcedGUILanguage (default ForcedGUILanguage=0 means auto detect) 73 | you can force a specifc language for test. Ex 74 | 75 | ForcedGUILanguage=fr force GUI language to French. 76 | 77 | If the language strings for the language forced are nota availabel it will show in English. 78 | 79 | 80 | *****************************************************APK-Info GUI translatorForced 81 | 82 | Catalan - 83 | Simplified Chinese - Li Guiquan 84 | Dutch - 85 | English - bovirus 86 | Farsi - HesamEdin 87 | French - Yoanf_26 88 | German - mosu 89 | Hungarian - gidano 90 | Indonesian - exodius48 91 | Italian - bovirus 92 | Polish - Eselter 93 | Portuguese (Brasilan) - 41ui7i0 94 | Russian - Kevin31 95 | Spanish - Ksawery 96 | Slovak - Ja_som 97 | Taiwanese - Li Bibo 98 | 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # APK-Info 2 | APK-Info is a Windows tool to get detailed info about an apk file. 3 | 4 | The app was originally created by ZoSTeR and posted on [Total Commander Forum](https://www.ghisler.ch/board/viewtopic.php?t=32908) 5 | 6 | Then was updated by jazzruby and this is the [original jazzruby thread on XDA](https://forum.xda-developers.com/showthread.php?t=2359373) 7 | 8 | Then was updated by bovirus and this is the [reworked thread on XDA](https://forum.xda-developers.com/showthread.php?t=3614970) 9 | 10 | ![APK-Info](https://github.com/Enyby/APK-Info/blob/master/screenshot.png?raw=true "APK-Info") 11 | 12 | Allows you to view: 13 | - application icon 14 | - package name 15 | - name (in all languages) 16 | - version 17 | - build number 18 | - the minimum, maximum, and target version of the SDK (Android) 19 | - supported density (DPI) and screen size 20 | - architecture (ABI) 21 | - supported textures 22 | - permissions 23 | - features 24 | - signature 25 | - OpenGL ES version 26 | - whether app supports Android TV, Wear OS, and/or Android Auto 27 | - locales 28 | - a variety of hashes (MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512) 29 | - and a lot of other information 30 | 31 | The application is currently translated into 86 languages. 32 | The language is selected automatically based on the language of the operating system, but you can specify the language in the settings file. 33 | 34 | The app allows you to go to Google Play, a custom store (APKPure by default) and VirusTotal. 35 | 36 | You can rename an APK file using a pre-defined pattern with substitutions. 37 | 38 | You can also install or remove this APK file on a device or emulator connected via ADB. 39 | 40 | There is integration in the Windows shell. 41 | 42 | # False positive report about a virus on APK-Info.exe 43 | 44 | Some antivirus may recognize APK-Info.exe as a virus. 45 | It's a wrong report (false positive). 46 | Please ignore it. 47 | The application doesn't contain any viruses. See [#4](https://github.com/Enyby/APK-Info/issues/4) 48 | 49 | # APK-Info features 50 | - Supports latest API levels available 51 | - SDK levels is defined in external ini file 52 | - Multilingual GUI (to add a new language, just edit the external ini file) 53 | - Automatic recognition of OS language, and setting the right GUI language (86 languages currently available) 54 | - Option in configuration file to force a specific GUI language 55 | - Option in configuration file to define pattern for renaming filename 56 | - Windows shell integration (optional) 57 | - Support Drag'n'Drop APK to the program window 58 | 59 | # Using 60 | You can open the APK file in APK-Info using one of the following methods: 61 | - Start APK-Info, and then select the APK file in the dialog. 62 | - Open the APK file by clicking on the open button in the dialog. 63 | - Drag the APK file to APK-Info.exe or its shortcut. 64 | - Drag the APK file into the running APK-Info window. 65 | - Open the APK file by double-clicking, after installing APK-Info, as a program for opening APK files (via explorer or attached .cmd file). 66 | 67 | # Download 68 | [Latest releases](https://github.com/Enyby/APK-Info/releases) 69 | 70 | [Library of old APK-Info versions](https://mega.nz/#F!DNZxjaAb!2Xx8Y_CO6PYwGDnLRgS5_g) 71 | 72 | # How to build the latest version 73 | 74 | 1. Download [the latest release](https://github.com/Enyby/APK-Info/releases/latest). 75 | 2. Download [the source from github](https://github.com/Enyby/APK-Info/archive/master.zip). 76 | 3. Unpack the source on top of the release. 77 | 4. Open the `Application-source\APK-Info.au3` file in the [SciTE4AutoIt3 editor](https://www.autoitscript.com/site/autoit-script-editor/downloads/). 78 | 5. Press F7. The `Apk-Info.exe` file will be updated. 79 | 80 | # API Levels supported 81 | ``` 82 | Level 1 = Base 83 | Level 2 = Base 1.1 84 | Level 3 = Cupcake 85 | Level 4 = Donut 86 | Level 5 = Eclair 87 | Level 6 = Eclair 0.1 88 | Level 7 = Eclair MR1 89 | Level 8 = Froyo 90 | Level 9 = Gingerbread 91 | Level 10 = Gingerbread MR1 92 | Level 11 = Honeycomb 93 | Level 12 = Honeycomb MR1 94 | Level 13 = Honeycomb MR2 95 | Level 14 = Ice Cream Sandwich 96 | Level 15 = Ice Cream Sandwich MR1 97 | Level 16 = Jelly Bean 98 | Level 17 = Jelly Bean MR1 99 | Level 18 = Jelly Bean MR2 100 | Level 19 = KitKat 101 | Level 20 = KitKat Watch 102 | Level 21 = Lollipop 103 | Level 22 = Lollipop MR1 104 | Level 23 = Marshmallow 105 | Level 24 = Nougat 106 | Level 25 = Nougat MR1 107 | Level 26 = Oreo 108 | Level 27 = Oreo MR1 109 | Level 28 = Pie 110 | Level 29 = 10 111 | Level 30 = 11 112 | Level 31 = 12 113 | ``` 114 | 115 | # Additional info 116 | [Android API version](https://developer.android.com/studio/releases/platforms) 117 | 118 | # APK-Info Changelog 119 | [Changelog](Documents/Changelog.txt) 120 | -------------------------------------------------------------------------------- /Documents/Changelog.txt: -------------------------------------------------------------------------------- 1 | *** APK-Info 1.35 (03.07.2019) 2 | 3 | - Revert bugged aapt binary. 4 | - Fix work on Windows XP. 5 | 6 | *** APK-Info 1.34 (02.07.2019) 7 | 8 | - Add option JavaPath. 9 | - Fixed bugs. 10 | 11 | *** APK-Info 1.33 (28.06.2019) 12 | 13 | - Updated binaries for adb and aapt. 14 | - Fixed bugs. 15 | 16 | *** APK-Info 1.32 (08.12.2018) 17 | 18 | - Updated binaries for adb and aapt. 19 | - Improved work with unicode in apk name. 20 | - Improved shell integration. 21 | - Add additional command in context menu Explorer. 22 | - Update translations. Thanks to @Li Bibo 23 | - Fixed bugs. 24 | 25 | *** APK-Info 1.31 (26.10.2018) 26 | 27 | - Added "Install + Start" button for ADB dialog. 28 | - Improved work with timeout for ADB. 29 | - Added check for APK update. 30 | - Fixed bugs. 31 | 32 | *** APK-Info 1.30 (29.08.2018) 33 | 34 | - Added short names for textures. 35 | - Add 'Start' button for adb dialog. 36 | - Sort permissions. 37 | - Bugs fixes. 38 | - Update translations. Thanks to @Li Bibo 39 | 40 | *** APK-Info 1.29 (14.08.2018) 41 | 42 | - Add option TextInfo. 43 | - Add button for text information by pattern. 44 | - Add open button. 45 | - Bugs fixes. 46 | - Add info about activities in features. 47 | - Add filename in the window title. 48 | - Speed up get signature info. 49 | - Improved placeholders. 50 | - Update translations. 51 | 52 | *** APK-Info 1.28 (07.07.2018) 53 | 54 | - Improved APK info. 55 | - Bugs fixes. 56 | - Improved option CheckNewVersion. 57 | - Improved show progress on load. 58 | - Remove option ShowLog. 59 | - Add option DebugLog. 60 | 61 | *** APK-Info 1.27 (05.07.2018) 62 | 63 | - Improved load APK icon. 64 | - Improved APK info. 65 | - Updated translations. Thanks to @bovirus 66 | - Added option AdbTimeout. 67 | - Add support user.ini for custom settings. 68 | - Add option LocalizeName. 69 | - Add check for a new version and option CheckNewVersion. 70 | - Updated aapt binary. 71 | 72 | *** APK-Info 1.26 (01.07.2018) 73 | 74 | - Improved texts. 75 | - Updated translations. 76 | - Added detection of density 'any'. 77 | - Improved lists of permissions and features. 78 | - Added hotkey Ctrl+A to select all text in the text area. 79 | - Added button 'more' to display text from text areas in a large field. 80 | - Fixed the size of dialogs. 81 | - Improved GUI layout. 82 | - Improved detection of OpenGL ES. 83 | 84 | *** APK-Info 1.25 (29.06.2018) 85 | 86 | - Fix dialogs position and size. 87 | - Fix the main windows position bug. 88 | - Improved ABIs list. 89 | - Improved GUI layout. 90 | - Updated translations. 91 | - Add placeholders for rename. 92 | - Increased APK icon size. 93 | - Improved quality of APK icon in some cases. 94 | - Add VirusTotal button and OldVirusTotal option. 95 | - Improved placeholders for CustomStore. 96 | - Updated ADB binaries. 97 | 98 | *** APK-Info 1.24 (25.06.2018) 99 | 100 | - Fix Android names. Thanks to @Displax 101 | - Remove duplicate signature name. Thanks to @tilks 102 | - Select current locale in the list and scroll to it. 103 | - Improved GUI. 104 | - Updated translations. Thanks to @bovirus 105 | - Improved changelog. Thanks to @Displax 106 | - Allow resize GUI. 107 | - Add option RestoreGUI. 108 | 109 | *** APK-Info 1.23 (24.06.2018) 110 | 111 | - Improved GUI. 112 | - Improved select ADB device. 113 | - Improved load APK icon. 114 | - Add support for webp icons. 115 | - Show all different labels for locales from APK. 116 | - Show names for most famous signatures. Thanks to @tilks. 117 | - Add icons for buttons. 118 | - Move tools to subdir. 119 | - Remove unused files. 120 | - Improved support low screens like 800*600. 121 | - Reworked SDK levels in config. 122 | - Add Max SDK and Compile SDK. 123 | - Add options: CustomStore, SignatureNames, AdbInit, AdbKill. Read config for details. 124 | 125 | *** APK-Info 1.22 (23.06.2018) 126 | 127 | - Improved load label. 128 | - Improved load icon. 129 | - Load localized label. 130 | - Added many placeholders into rename pattern. 131 | - Added hash support - optional field and placeholders in rename pattern. 132 | - Improved rename. 133 | - Added install/uninstall via adb. 134 | - Bugs fixes. 135 | 136 | *** APK-Info 1.21 (22.06.2018) 137 | 138 | - Add support for Unicode in the APK filename. 139 | - Improved loading progress bar. 140 | - Improved translations. 141 | 142 | *** APK-Info 1.20 (20.06.2018) 143 | 144 | - Improved load APK icons. 145 | - Add in APK-Info.ini a FileNamePattern option for rename APK. 146 | - Add support for Unicode. 147 | - Fix load features. 148 | - Improved features list. 149 | - Improved GUI. 150 | - Show locales from the APK. 151 | - Show OpenGL ES version and textures formats. 152 | - Show support for TV, Watch, Auto. 153 | 154 | *** APK-Info 1.19 (19.06.2018) 155 | 156 | - Improved load APK icons. 157 | - Add in APK.Info.ini a FileNameWithBuild option to switch off adding build number to new file name of apk, default value is 0 (do not add). 158 | 159 | *** APK-Info 1.18 (16.06.2018) 160 | 161 | - Fixed bug with update fields on drag&drop. 162 | - Fixed Spanish translation. 163 | 164 | *** APK-Info 1.17 (16.06.2018) 165 | 166 | - Improved source code. 167 | - Improved load APK icons. 168 | - Update translations and add a lot new translations. 169 | - On/off signature check via GUI. 170 | 171 | *** APK-Info 1.16 (15.06.2018) 172 | 173 | - Added option CheckSignature. 174 | - Added progress bar. 175 | 176 | *** APK-Info 1.15 (14.06.2018) 177 | 178 | - Improved load icon from the apk. 179 | 180 | *** APK-Info 1.14 (14.06.2018) 181 | 182 | - Added drag&drop .apk to the main form. 183 | 184 | *** APK-Info 1.13 (11.06.2018) 185 | 186 | - Added option for replace spaces in filename on rename. 187 | 188 | *** APK-Info 1.12 (10.06.2018) 189 | 190 | - Displays the status of the debug version in the build field. 191 | - Improved read signature. 192 | 193 | *** APK-Info 1.11 (10.06.2018) 194 | 195 | - Added Ukrainian language and improved application icons. Thanks to @Alex72b 196 | 197 | *** APK-Info 1.10 (09.06.2018) 198 | 199 | - Fixed bug with load apk icon. 200 | 201 | *** APK-Info 1.09 (09.06.2018) 202 | 203 | - Fixed a bug with loading an icon from another APK, if several copies of applications are running and the name of the icon is the same. 204 | - Fixed cleaning temporary folder. 205 | 206 | *** APK-Info 1.08 (09.06.2018) 207 | 208 | - Improved GUI layout. 209 | - Improved ru translation. 210 | 211 | *** APK-Info 1.07 (09.06.2018) 212 | 213 | - Added apk ABIs. 214 | - Added apk Signature check and info (need java in PATH). 215 | - Reworked GUI creation for less pain on add new items. 216 | 217 | *** APK-Info 1.06 (09.06.2018) 218 | 219 | - Updated Android build Tool (v 28.0.0) to support Android P (Pistachio Ice Cream) 220 | - Modified INI file to include detection of Android P (Pistachio Ice Cream) final. 221 | 222 | *** APK-Info 1.05 (11.05.2018) 223 | 224 | - Updated Android build Tool (v 28.0.RC2) to support Android P (Pistachio Ice Cream) 225 | - Modified INI file to include detection of Android P (Pistachio Ice Cream) Preview. 226 | 227 | *** APK-Info 1.04 (27.01.2018) 228 | 229 | - Set blank space as default for PrefixFilename 230 | - Disable by default extended Log (ShowLog=0) 231 | - Minor bug fixing 232 | 233 | *** APK-Info 1.03 (30.12.2017) 234 | 235 | - Updated Android build Tool (v. 27.0.3) to support Oreo 8.1 apk 236 | - Minor bug fixing 237 | 238 | *** APK-Info 1.02 (30.10.2017) 239 | 240 | - Modified ini to support Oreo (8.0) 241 | - Updated Android build Tool to support Oreo 8.0 apk 242 | - Minor bug fixing 243 | 244 | *** APK-Info 1.01 (19.06.2017) 245 | 246 | - Minor bug fixing 247 | 248 | *** APK-Info 1.00 (10.06.2017) 249 | 250 | - Updated aapt.exe to version 26.00 stable 251 | - Added Portuguese (Brasilan) translation - Thanks to 41ui7i0 252 | 253 | *** APK-Info 0.7Q (05.06.2017) 254 | 255 | - Move LastFolder (used) variable in APK-Info.LastFolder.ini (first was in APK-Info.ini) 256 | 257 | *** APK-Info 0.7Q (02.06.2017) 258 | 259 | - Added by default Info about OSLanguage code and LanguageName ion the right below icon app. 260 | useful info to develop and test new language. 261 | The info can be disabled using ShowOSLanguage=0 in APK-Info.ini 262 | - Remove option to change APK-Info version and date in APK-Info.ini 263 | 264 | *** APK-Info 0.7Q (01.06.2017) 265 | 266 | - Added Russian translation - thanks to Kevin31 267 | - Added SDK level 25 (Android 7.0 MR1) - thanks to tetsuo55 268 | - Updated Android Build Tool aapt.exe (v. 26.0.RC2) 269 | - Remove "Browse" button (was not really operative) 270 | Increased button width for Play store page/Rename/Exit button 271 | - Revised Android OS name classification - thanks to tetsuo55 272 | - Added by default ShowLangCode=1 (can be disable with setting in APK-Info.ini) 273 | It show OSLangCode and Language code in the program title after program version and date. 274 | - Changed log file name to 'APK-Info.log.txt' 275 | 276 | *** APK-Info 0.7P (29.08.2016) 277 | 278 | - Replace aapt 24.0.0 with 23.0.6 for compatibility problem with apk name. 279 | - Add support for SDK 24 (Android 6.0.1) / SDK 25 (Android 7.0) 280 | 281 | *** APK-Info 0.7O (23.06.2016) 282 | 283 | - Update Android Build Tool (aapt.exe) with new version 24.0.0 284 | 285 | *** APK-Info 0.7N (15.05.2016) 286 | 287 | - Add options in APK-Info to change version/date without recompile source (just for new translation) 288 | - Added Chinese (Taiwan) language (thanks to Li Bibo) 289 | 290 | *** APK-Info 0.7M (17.04.2016) 291 | 292 | - Added Farsi language (thanks to HesamEdin). 293 | - Added French language (thanks to Yoanf_26) 294 | - Added German language (thanks to mosu) 295 | - Updated aapt (Android Build Tool) to 23.0.3 296 | 297 | *** APK-Info 0.7L (29.01.2016) 298 | 299 | - Added Spanish language (thanks to Ksawery). 300 | - Added Chinese language (thanks to Li Guiquan). 301 | 302 | *** APK-Info 0.7K (23.01.2016) 303 | 304 | - Added Polish translation (thanks to Eselter). 305 | 306 | *** APK-Info 0.7I (20.12.2015) 307 | 308 | * Fix 309 | - Fix rename function 310 | * Improvements 311 | - Enable use of new variable in APK-Info.ini. ShowLog=1 (default). 312 | It replace use in ini file of variables like ShowCmdline and ShowUILanguage (now by default it save this kind of info in APK-Info-Log.ini) 313 | ShowLog enables to save in APK-Info-Log.ini many info about variable use internally from the program/OS language info/path used etc. 314 | * Know problem 315 | - If you load a new file from Browse the icon remain unchanged. 316 | - If the filename or app name use character like Japanese are not supported. 317 | 318 | *** APK-Info 0.7H (18.12.2015) 319 | 320 | - Fix problem about big icon (now is always max 48x48piexls) 321 | - Fixed a problem regarding Browse command that didn't update filename 322 | - Know problems 323 | - Using special character (ex. Japanese) for filename/app name are not supported 324 | - Using browser command to load another apk, the icon didn't change. 325 | - Added Indonesian translation (thanks to exodius48) 326 | 327 | *** APK-Info 0.7G (12.12.2015) 328 | 329 | - Added Hungarian strings (thanks to gidano) 330 | - Change GUI strings name (APK-Info-GUI.ini). Text file format UTF16. 331 | - Add strings in APK-Info-GUI.ini for SDK version and code name. Now to add a new SDK detection is not required change to program code. 332 | - Add OS Language code detection table in APK-GUI.ini. Now to add a new language detection is not required change to program code. 333 | 334 | *** APK-Info 0.7E (09.12.2015) 335 | 336 | - Solved problem recognizing KitKat (SDK 19). 337 | - Increase Window width (for text space) 338 | - Add option in APK-Info.ini to enable special language not detected automatically 339 | - Fix problem regarding batch run with APK-Info [PathToINIFile] [AppFilename.apk] 340 | - Add Slovak language file (thanks to Ja_som) 341 | - Add French language file (thanks to Yoanf_26). 342 | Note: The language file should be in UTF16 for special characters. 343 | - Add program option in APK-Info.ini to show command line parameters. 344 | More detail in Readme.txt text file. 345 | 346 | *** APK-Info 0.7D (08.12.2015) 347 | 348 | - Fixed problem about SK 21/22/23. 349 | - Made also some changes to the app. 350 | - The strings about program GUI are moved from APK-Info.ini to APK-Info-GUI-strings.ini 351 | - The APK-Info.ini file now contain just program settings (and not strings) 352 | - DI fixed the problem related to read FilenamePrefix/Suffix in APK.Info.ini. 353 | - Added automatic sk language recognition. 354 | - Fixed the problem about recognize SDK21/22/23 Android OS name. 355 | * Problem not solved 356 | - Recognize apk file name with Chinese characters. 357 | 358 | *** APK-Info 0.7C (07.12.2015) 359 | 360 | - Replace appt.exe with new version compatible with SDK23 (Android 6.x) 361 | 362 | *** APK-Info 0.7B (22.09.2015) 363 | 364 | - Update aapt (build tool) 365 | - Multilingual (see APK-Info.ini) 366 | - Added option to select Prefix/suffix characters for file renaming (check APK-Info.ini) 367 | - Added option to enable/disable show OSLangCode (for help in translation) 368 | - If anyone want to show the program in specific language please edit english strings in APK-Info.ini and post here the specific language -------------------------------------------------------------------------------- /Application-source/APK-Info.au3: -------------------------------------------------------------------------------- 1 | #Region ;**** Directives created by AutoIt3Wrapper_GUI **** 2 | #AutoIt3Wrapper_OutFile=..\APK-Info.exe 3 | #AutoIt3Wrapper_icon=APK-Info.ico 4 | #AutoIt3Wrapper_UseUpx=n 5 | #AutoIt3Wrapper_UseX64=n 6 | #AutoIt3Wrapper_Res_Comment=Shows info about Android Package Files (APK) 7 | #AutoIt3Wrapper_Res_Description=APK-Info 8 | #AutoIt3Wrapper_Res_LegalCopyright=zoster 9 | #AutoIt3Wrapper_Res_Fileversion=1.35.0.0 10 | #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** 11 | #pragma compile(AutoItExecuteAllowed True) 12 | 13 | $ProgramVersion = "1.35" 14 | $ProgramReleaseDate = "03.07.2019" 15 | $ProgramName = 'APK-Info' 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | ;#include 32 | 33 | Opt("TrayMenuMode", 1) 34 | Opt("TrayIconHide", 1) 35 | 36 | $Debug = False 37 | ;$Debug = True ; Debug 38 | 39 | $ScriptDir = @ScriptDir 40 | If @Compiled == 0 Then $ScriptDir &= '\..' 41 | 42 | Global $apk_Label, $apk_Labels, $apk_Icons, $apk_IconPath, $apk_IconPathBg, $apk_PkgName, $apk_Build, $apk_Version, $apk_Support 43 | Global $apk_Permissions, $apk_Features, $hGraphic, $hImage, $hImage_bg, $apk_MinSDK, $apk_MaxSDK, $apk_TargetSDK, $apk_CompileSDK 44 | Global $apk_Screens, $apk_Densities, $apk_ABIs, $apk_Signature, $apk_SignatureName, $apk_Debuggable 45 | Global $apk_Locales, $apk_OpenGLES, $apk_Textures 46 | Global $tempPath = @TempDir & "\APK-Info\" & @AutoItPID 47 | Global $toolsDir = $ScriptDir & '\tools\' 48 | Global $Inidir, $ProgramVersion, $ProgramReleaseDate, $ForceGUILanguage 49 | Global $IniUser 50 | Global $tmpArrBadge, $dirAPK, $fileAPK, $fullPathAPK 51 | Global $sNewFilenameAPK, $searchPngCache, $hashCache 52 | Global $progress = 0 53 | Global $progressMax = 1 54 | 55 | Global $nbsp = ChrW(0xA0) 56 | 57 | $Inidir = $ScriptDir & "\" 58 | 59 | $IniFile = $Inidir & "APK-Info.ini" 60 | $IniUser = $Inidir & "user.ini" 61 | 62 | ; $aCmdLine[0] = number of parametrs passed to exe file 63 | ; $aCmdLine[1] = first parameter (optional) passed to exe file (apk file name) 64 | 65 | ; https://www.autoitscript.com/autoit3/docs/intro/running.htm 66 | ; An alternative to the limitation of $CmdLine[] only being able to return a maximum of 63 parameters. 67 | Local $aCmdLine = _WinAPI_CommandLineToArgv($CmdLineRaw) 68 | ; Uncomment it to Show all cmdline parameters 69 | ;_ArrayDisplay($aCmdLine) 70 | 71 | Local $tmp_Filename = '' 72 | If $aCmdLine[0] > 0 Then $tmp_Filename = $aCmdLine[1] 73 | 74 | Local $tmp = _StringExplode($tmp_Filename, ':', 2) 75 | If $tmp[0] == 'debug' Then 76 | $tmp_Filename = $tmp[2] 77 | $ProgramReleaseDate &= ' Log: ' & _getDebugFile($tmp[1]) 78 | ElseIf _readSettings("DebugLog", "0") == '1' Then 79 | $cmd = @ComSpec & ' /c ""' & $ScriptDir & '\' & @ScriptName & '" "debug:' & @AutoItPID & ':' & $tmp_Filename & '" > "' & _getDebugFile(@AutoItPID) & '""' 80 | RunWait($cmd, $ScriptDir, @SW_HIDE) 81 | Exit 82 | EndIf 83 | 84 | Func _getDebugFile($pid) 85 | Return $ScriptDir & '\log,' & $pid & '.txt' 86 | EndFunc ;==>_getDebugFile 87 | 88 | ; more info on country code 89 | ; https://www.autoitscript.com/autoit3/docs/appendix/OSLangCodes.htm 90 | 91 | $ForcedGUILanguage = _readSettings("ForcedGUILanguage", "auto") 92 | $OSLanguageCode = @OSLang 93 | If $ForcedGUILanguage == "auto" Then 94 | $Language_code = IniRead($IniFile, "OSLanguage", @OSLang, "en") 95 | Else 96 | $Language_code = $ForcedGUILanguage 97 | EndIf 98 | 99 | $LocalizeName = _readSettings("LocalizeName", "1") 100 | $CheckSignature = _readSettings("CheckSignature", "1") 101 | $FileNamePattern = _readSettings("FileNamePattern", "%label% %version%.%build%") 102 | $ShowHash = _readSettings("ShowHash", '') 103 | $CustomStore = _readSettings("CustomStore", '') 104 | $SignatureNames = _readSettings("SignatureNames", '') 105 | 106 | $TextInfo = _readSettings("TextInfo", '') 107 | 108 | $JavaPath = _readSettings("JavaPath", '') 109 | 110 | $AdbInit = _readSettings("AdbInit", '') 111 | $AdbKill = _readSettings("AdbKill", '0') 112 | $AdbTimeout = _readSettings("AdbTimeout", '15') 113 | 114 | $RestoreGUI = _readSettings("RestoreGUI", '0') 115 | 116 | $OldVirusTotal = _readSettings("OldVirusTotal", '0') 117 | 118 | $CheckNewVersion = _readSettings("CheckNewVersion", '1') 119 | 120 | $ShowLangCode = _readSettings("ShowLangCode", "1") 121 | 122 | Local $space = 'space' 123 | $FileNameSpace = _readSettings("FileNameSpace", $space) 124 | If $FileNameSpace == $space Then $FileNameSpace = ' ' 125 | $LastFolder = IniRead($IniUser, "State", "LastFolder", @WorkingDir) 126 | 127 | Local $LastTop = IniRead($IniUser, "State", "LastTop", 0) 128 | Local $LastLeft = IniRead($IniUser, "State", "LastLeft", 0) 129 | Local $LastWidth = IniRead($IniUser, "State", "LastWidth", 0) 130 | Local $LastHeight = IniRead($IniUser, "State", "LastHeight", 0) 131 | 132 | Local $LangSection = "Strings-" & $Language_code 133 | 134 | $strLabel = IniRead($IniFile, $LangSection, "Application", "Application") 135 | $strVersion = IniRead($IniFile, $LangSection, "Version", "Version") 136 | $strBuild = IniRead($IniFile, $LangSection, "Build", "Build") 137 | $strPkg = IniRead($IniFile, $LangSection, "Package", "Package") 138 | $strScreens = IniRead($IniFile, $LangSection, "ScreenSizes", "Screen Sizes") 139 | $strDensities = IniRead($IniFile, $LangSection, "Densities", "Densities") 140 | $strPermissions = IniRead($IniFile, $LangSection, "Permissions", "Permissions") 141 | $strFeatures = IniRead($IniFile, $LangSection, "Features", "Features") 142 | $strFilename = IniRead($IniFile, $LangSection, "CurrentName", "Current Name") 143 | $strNewFilename = IniRead($IniFile, $LangSection, "NewName", "New Name") 144 | $strPlayStore = IniRead($IniFile, $LangSection, "PlayStore", "Play Store") 145 | $strRename = IniRead($IniFile, $LangSection, "RenameFile", "Rename File") 146 | $strExit = IniRead($IniFile, $LangSection, "Exit", "Exit") 147 | $strRenameAPK = IniRead($IniFile, $LangSection, "RenameAPKFile", "Rename APK File") 148 | $strNewName = IniRead($IniFile, $LangSection, "NewAPKFilename", "New APK Filename") 149 | $strError = IniRead($IniFile, $LangSection, "Error", "Error!") 150 | $strRenameFail = IniRead($IniFile, $LangSection, "RenameFail", "APK File could not be renamed.") 151 | $strSelectAPK = IniRead($IniFile, $LangSection, "SelectAPKFile", "Select APK file") 152 | $strCurDev = IniRead($IniFile, $LangSection, "CurDev", "Cur_Dev") 153 | $strCurDevBuild = IniRead($IniFile, $LangSection, "CurDevBuild", "Current Dev. Build") 154 | $strUnknown = IniRead($IniFile, $LangSection, "Unknown", "Unknown") 155 | $strABIs = IniRead($IniFile, $LangSection, "ABIs", "ABIs") 156 | $strSignature = IniRead($IniFile, $LangSection, "Signature", "Signature") 157 | $strIcon = IniRead($IniFile, $LangSection, "Icon", "Icon") 158 | $strLoading = IniRead($IniFile, $LangSection, "Loading", "Loading") 159 | $strTextures = IniRead($IniFile, $LangSection, "Textures", "Textures") 160 | $strHash = IniRead($IniFile, $LangSection, "Hash", "Hash") 161 | $strInstall = IniRead($IniFile, $LangSection, "Install", "Install") 162 | $strUninstall = IniRead($IniFile, $LangSection, "Uninstall", "Uninstall") 163 | $strLocales = IniRead($IniFile, $LangSection, "Locales", "Locales") 164 | $strClose = IniRead($IniFile, $LangSection, "Close", "Close") 165 | $strNoAdbDevices = IniRead($IniFile, $LangSection, "NoAdbDevicesFound", "No ADB devices found.") 166 | $strMinMaxSDK = IniRead($IniFile, $LangSection, "MinMaxSDK", "Min. / Max. SDK") 167 | $strMaxSDK = IniRead($IniFile, $LangSection, "MaxSDK", "Max. SDK") 168 | $strTargetCompileSDK = IniRead($IniFile, $LangSection, "TargetCompileSDK", "Target / Compile SDK") 169 | $strCompileSDK = IniRead($IniFile, $LangSection, "CompileSDK", "Compile SDK") 170 | $strLanguage = IniRead($IniFile, $LangSection, "Language", "Language") 171 | $strSupport = IniRead($IniFile, $LangSection, "Support", "Support") 172 | $strDebuggable = IniRead($IniFile, $LangSection, "Debuggable", "Debuggable") 173 | $strLabelInLocales = IniRead($IniFile, $LangSection, "LabelInLocales", "Application name in different locales") 174 | $strNewVersionIsAvailable = IniRead($IniFile, $LangSection, "NewVersionIsAvailable", "A new version is available") 175 | $strTextInformation = IniRead($IniFile, $LangSection, "TextInformation", "Text information") 176 | $strLoadSignature = IniRead($IniFile, $LangSection, "LoadSignature", "Load signature") 177 | $strStart = IniRead($IniFile, $LangSection, "Start", "Start") 178 | $strExceededTimeout = IniRead($IniFile, $LangSection, "ExceededTimeout", "Exceeded timeout response from the command") 179 | $strCheckUpdate = IniRead($IniFile, $LangSection, "CheckUpdate", "Check update") 180 | $strYes = IniRead($IniFile, $LangSection, "Yes", "Yes") 181 | $strNo = IniRead($IniFile, $LangSection, "No", "No") 182 | $strNotFound = IniRead($IniFile, $LangSection, "NotFound", "Not found") 183 | $strNoUpdatesFound = IniRead($IniFile, $LangSection, "NoUpdatesFound", "No updates found") 184 | $strNeedJava = IniRead($IniFile, $LangSection, "NeedJava", 'Need Java 1.8 or higher.') 185 | 186 | $strUses = IniRead($IniFile, $LangSection, "Uses", "uses") 187 | $strImplied = IniRead($IniFile, $LangSection, "Implied", "implied") 188 | $strNotRequired = IniRead($IniFile, $LangSection, "NotRequired", "not required") 189 | $strOthers = IniRead($IniFile, $LangSection, "Others", "others") 190 | 191 | $strWinCode = 'WinCode' 192 | $strOpenGLES = 'OpenGL ES ' 193 | $strTV = 'Android TV' 194 | $strWatch = 'Wear OS' 195 | $strAuto = 'Android Auto' 196 | $strAndroid = 'Android' 197 | $strVirusTotal = 'VirusTotal' 198 | $strAdb = 'ADB' 199 | 200 | $urlUpdate = 'https://github.com/Enyby/APK-Info/releases/latest' 201 | 202 | $URLPlayStore = IniRead($IniFile, $LangSection, "URLPlaystore", "https://play.google.com/store/apps/details?id=") 203 | 204 | $playStoreUrl = "https://play.google.com/store/apps/details?hl=en&id=" 205 | $apkPureUrl = "https://apkpure.com/apk-info/" 206 | $strApkPure = "APKPure" 207 | 208 | $PlayStoreLanguage = IniRead($IniFile, $LangSection, "PlayStoreLanguage", $Language_code) 209 | 210 | Dim $sMinAndroidString, $sTgtAndroidString 211 | 212 | Global $iconProgress = 5 213 | 214 | ;================== GUI =========================== 215 | 216 | ProgressOn($strLoading & "...", $ProgramName) 217 | 218 | $ProgramTitle = $ProgramName & ' ' & $ProgramVersion & " (" & $ProgramReleaseDate & ")" 219 | 220 | $rightColumnWidth = 100 221 | 222 | $fieldHeight = 24 223 | $bigFieldHeight = 89 224 | 225 | $labelStart = 5 226 | $labelWidth = 126 227 | $labelTop = 3 228 | 229 | $inputStart = $labelStart + $labelWidth + 5 230 | $inputWidth = 445 231 | $inputHeight = 20 232 | $inputFlags = BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY) 233 | $abiRatio = 1.25 234 | Local $halfWidth = ($inputWidth - 5) / 2 235 | Local $abiWidth = $halfWidth * $abiRatio 236 | 237 | $editWidth = $inputWidth + 5 + $rightColumnWidth 238 | $editHeight = 85 239 | $editFlags = BitOR($ES_READONLY, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $WS_VSCROLL, $ES_WANTRETURN) 240 | 241 | $offsetHeight = 5 242 | 243 | $rightColumnStart = $inputStart + $inputWidth + 5 244 | 245 | Local $fields = 11 246 | If $ShowHash <> '' Then $fields += 1 247 | 248 | $INFO_LBL = 0 249 | $INFO_BTN = 1 250 | 251 | $edits = 3 252 | Global $edtInfo[$edits][2] 253 | 254 | $fullWidth = $rightColumnStart + $rightColumnWidth + 5 255 | $fullHeight = $offsetHeight + $fieldHeight * $fields + $bigFieldHeight * $edits 256 | 257 | $localesWidth = 60 258 | $localesStart = $fullWidth 259 | 260 | $fullWidth += $localesWidth + 5 261 | 262 | $btnIconSize = 40 263 | $btnGap = 10 264 | $btnStart = $fullWidth 265 | 266 | $fullWidth += $btnIconSize + 5 267 | 268 | $hGUI = GUICreate($ProgramTitle, $fullWidth, $fullHeight, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX), $WS_EX_ACCEPTFILES) 269 | 270 | GUICtrlCreateLabel("", 0, 0, $fullWidth, $fullHeight, $WS_CLIPSIBLINGS) ; for accept drag & drop 271 | GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) 272 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) 273 | ;GUICtrlSetBkColor(-1, $COLOR_RED) 274 | 275 | $globalStyle = $GUI_DROPACCEPTED + $GUI_ONTOP 276 | $globalInputStyle = $GUI_ONTOP 277 | 278 | $iconSize = 72 279 | Local $placeHeight = 5 + $fieldHeight * 3 280 | $lblIcon = GUICtrlCreateLabel('', $rightColumnStart + ($rightColumnWidth - $iconSize) / 2, ($placeHeight - $iconSize) / 2, $iconSize, $iconSize) 281 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 282 | 283 | GUICtrlCreateLabel($strLocales & ':', $localesStart, $offsetHeight, $localesWidth, $inputHeight) 284 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 285 | GUICtrlSetState(-1, $globalStyle) 286 | Local $top = $offsetHeight + $inputHeight 287 | $edtLocales = GUICtrlCreateEdit('', $localesStart, $top, $localesWidth, $fullHeight - 5 - $top, $editFlags + $ES_NOHIDESEL) 288 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKBOTTOM + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 289 | GUICtrlSetState(-1, $globalInputStyle) 290 | GUICtrlSetTip(-1, $strLocales) 291 | 292 | $btnLabels = GUICtrlCreateButton('...', $inputStart - $inputHeight, $offsetHeight, $inputHeight, $inputHeight) 293 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKLEFT + $GUI_DOCKTOP) 294 | GUICtrlSetState(-1, $globalStyle) 295 | GUICtrlSetTip(-1, $strLabelInLocales) 296 | $inpLabel = _makeField($strLabel) 297 | Local $buildWidth = 70 298 | $inpBuild = GUICtrlCreateInput('', $inputStart + $inputWidth - $buildWidth, $offsetHeight, $buildWidth, $inputHeight, $inputFlags) 299 | GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 300 | GUICtrlSetState(-1, $globalInputStyle) 301 | GUICtrlSetTip(-1, $strBuild) 302 | $inpVersion = _makeField($strVersion & ' / ' & $strBuild, 0, $inputWidth - 5 - $buildWidth) 303 | $inpPkg = _makeField($strPkg) 304 | 305 | _makeLangLabel($strWinCode & ': ' & $OSLanguageCode) 306 | $inpMaxSDK = GUICtrlCreateInput('', $inputStart + $inputWidth - $halfWidth, $offsetHeight, $halfWidth, $inputHeight, $inputFlags) 307 | GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 308 | GUICtrlSetState(-1, $globalInputStyle) 309 | GUICtrlSetTip(-1, $strMaxSDK) 310 | $inpMinSDK = _makeField($strMinMaxSDK, 0, $inputWidth - 5 - $halfWidth) 311 | 312 | _makeLangLabel($strLanguage & ': ' & $Language_code) 313 | $inpCompileSDK = GUICtrlCreateInput('', $inputStart + $inputWidth - $halfWidth, $offsetHeight, $halfWidth, $inputHeight, $inputFlags) 314 | GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 315 | GUICtrlSetState(-1, $globalInputStyle) 316 | GUICtrlSetTip(-1, $strCompileSDK) 317 | $inpTargetSDK = _makeField($strTargetCompileSDK, 0, $inputWidth - 5 - $halfWidth) 318 | 319 | $lblDebug = GUICtrlCreateLabel('', $rightColumnStart, $offsetHeight + $labelTop, $rightColumnWidth, $inputHeight, $SS_CENTER) 320 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 321 | GUICtrlSetState(-1, $globalStyle) 322 | $inpScreens = _makeField($strScreens) 323 | $lblOpenGL = GUICtrlCreateLabel('', $rightColumnStart, $offsetHeight + $labelTop, $rightColumnWidth, $inputHeight + $fieldHeight, $SS_CENTER) 324 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 325 | GUICtrlSetState(-1, $globalStyle) 326 | GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) 327 | $inpDensities = _makeField($strDensities) 328 | $lblSupport = GUICtrlCreateLabel('', $inputStart + $abiWidth + 5, $offsetHeight + $labelTop, $inputWidth - $abiWidth - 5 + 5 + $rightColumnWidth, $inputHeight) 329 | GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 330 | GUICtrlSetState(-1, $globalStyle) 331 | GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) 332 | $inpABIs = _makeField($strABIs, 0, $abiWidth) 333 | $inpTextures = _makeField($strTextures, 0, $editWidth) 334 | 335 | $edtPermissions = _makeField($strPermissions, 1, 0) 336 | $edtFeatures = _makeField($strFeatures & @CRLF & @CRLF & "+ = " & $strUses & @CRLF & "# = " & $strImplied & @CRLF & "- = " & $strNotRequired & @CRLF & "@ = " & $strOthers, 2, 0, 0, $strFeatures) 337 | 338 | $chSignature = GUICtrlCreateCheckbox($strSignature, $labelStart, $offsetHeight + $labelTop, $labelWidth, $inputHeight) 339 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKLEFT) 340 | Local $tmpStyle = $globalStyle 341 | If $CheckSignature == 1 Then 342 | $tmpStyle = $tmpStyle + $GUI_CHECKED 343 | Else 344 | $tmpStyle = $tmpStyle + $GUI_UNCHECKED 345 | EndIf 346 | GUICtrlSetState(-1, $tmpStyle) 347 | 348 | $btnSignatureLoad = GUICtrlCreateButton('->', $inputStart - $inputHeight, $offsetHeight + $fieldHeight, $inputHeight, $inputHeight) 349 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKLEFT) 350 | GUICtrlSetState(-1, $globalStyle) 351 | GUICtrlSetTip(-1, $strLoadSignature) 352 | 353 | $lblSignature = GUICtrlCreateLabel('', $labelStart, $offsetHeight + $labelTop + $fieldHeight, $labelWidth, $editHeight - $fieldHeight) 354 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKLEFT) 355 | GUICtrlSetState(-1, $globalStyle) 356 | GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) 357 | 358 | $edtSignature = _makeField(False, 3, 0, 0, $strSignature) 359 | 360 | $inpHash = False 361 | If $ShowHash <> '' Then $inpHash = _makeField($strHash, 0, $editWidth, $GUI_DOCKBOTTOM) 362 | 363 | $inpName = _makeField($strFilename, 0, $editWidth, $GUI_DOCKBOTTOM) 364 | $inpNewName = _makeField($strNewFilename, 0, $editWidth, $GUI_DOCKBOTTOM) 365 | 366 | $offsetHeight = 5 367 | 368 | $offsetWidth = $btnGap 369 | $gBtn_Open = _makeButton($strSelectAPK, "open.bmp") 370 | $gBtn_Play = _makeButton($strPlayStore, "play.bmp") 371 | $gBtn_CustomStore = -1000 372 | If $CustomStore <> '' Then 373 | $store = _StringExplode($CustomStore, '|', 1) 374 | If UBound($store) == 2 Then 375 | $gBtn_CustomStore = _makeButton($store[0], "web.bmp") 376 | Else 377 | $CustomStore = '' 378 | EndIf 379 | EndIf 380 | $gBtn_CheckUpdate = _makeButton($strCheckUpdate, "update.bmp") 381 | $gBtn_VirusTotal = _makeButton($strVirusTotal, "virustotal.bmp") 382 | $gBtn_Rename = _makeButton($strRename, "rename.bmp") 383 | $gBtn_Adb = _makeButton($strAdb, "adb.bmp") 384 | 385 | $gBtn_TextInfo = -1002 386 | If $TextInfo <> '' Then $gBtn_TextInfo = _makeButton($strTextInformation, "text.bmp") 387 | 388 | $newVersion = _checkNewVersion() 389 | $gBtn_Update = -1001 390 | If $newVersion Then $gBtn_Update = _makeButton($strNewVersionIsAvailable & ': ' & $newVersion, "new.bmp") 391 | 392 | $gBtn_Exit = _makeButton($strExit, "exit.bmp") 393 | 394 | $gSelAll = _initSelAll($hGUI) 395 | 396 | _GDIPlus_Startup() 397 | $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) 398 | 399 | $defBkColor = 0 400 | $bkgColor = 0 401 | 402 | _OpenNewFile($tmp_Filename, False) 403 | 404 | GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT") 405 | GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO") 406 | 407 | $minSize = WinGetPos($hGUI) 408 | 409 | If $RestoreGUI <> '0' And $LastWidth And $LastHeight Then 410 | Local $repos = True 411 | If BitAND($RestoreGUI, 0x1) == 0 Then 412 | $LastLeft = $minSize[0] - ($LastWidth - $minSize[2]) / 2 413 | If $LastWidth < $minSize[2] Then $repos = False 414 | $LastTop = $minSize[1] - ($LastHeight - $minSize[3]) / 2 415 | If $LastHeight < $minSize[3] Then $repos = False 416 | EndIf 417 | 418 | Local $gap = 200 419 | Local $desktopWidth = _WinAPI_GetSystemMetrics(78) ; SM_CXVIRTUALSCREEN 420 | Local $desktopHeight = _WinAPI_GetSystemMetrics(79) ; SM_CYVIRTUALSCREEN 421 | 422 | If $repos Then 423 | Local $min = -$minSize[2] + $gap 424 | If $LastLeft < $min Then $LastLeft = $min 425 | Local $max = $desktopWidth - $gap 426 | If $LastLeft > $max Then $LastLeft = $max 427 | 428 | Local $min = -$minSize[3] + $gap 429 | If $LastTop < $min Then $LastTop = $min 430 | Local $max = $desktopHeight - $gap 431 | If $LastTop > $max Then $LastTop = $max 432 | 433 | WinMove($hGUI, '', $LastLeft, $LastTop) 434 | EndIf 435 | GUISetState(@SW_SHOW, $hGUI) 436 | If BitAND($RestoreGUI, 0x2) <> 0 Then 437 | If $LastWidth == 1 Then 438 | GUISetState(@SW_MAXIMIZE, $hGUI) 439 | Else 440 | Local $max = $desktopWidth + $gap 441 | If $LastLeft > $max Then $LastLeft = $max 442 | Local $max = $desktopHeight + $gap 443 | If $LastTop > $max Then $LastTop = $max 444 | WinMove($hGUI, '', Default, Default, $LastWidth, $LastHeight) 445 | EndIf 446 | _OnResize() 447 | EndIf 448 | Else 449 | GUISetState(@SW_SHOW, $hGUI) 450 | EndIf 451 | 452 | _OnShow() 453 | _saveGUIPos() 454 | 455 | ProgressOff() 456 | 457 | Local $whGap = ' ' 458 | 459 | While 1 460 | $nMsg = GUIGetMsg() 461 | Switch $nMsg 462 | Case $gSelAll 463 | _SelAll() 464 | 465 | Case $gBtn_Play 466 | ShellExecute($URLPlayStore & $apk_PkgName & '&hl=' & $PlayStoreLanguage) 467 | 468 | Case $gBtn_Update 469 | ShellExecute($urlUpdate) 470 | 471 | Case $gBtn_CustomStore 472 | If $CustomStore <> '' Then 473 | ShellExecute(_ReplacePlaceholders(_StringExplode($CustomStore, '|', 1)[1])) 474 | EndIf 475 | 476 | Case $gBtn_CheckUpdate 477 | _checkUpdate() 478 | 479 | Case $gBtn_VirusTotal 480 | If $OldVirusTotal == '0' Then 481 | $url = 'https://www.virustotal.com/#/file/%sha256%/detection' 482 | Else 483 | If StringInStr(',ca,da,de,en,es,fr,hr,it,hu,nl,nb,pt,pl,sk,uk,vi,tr,ru,sr,bg,he,ka,ar,fa,zh-CN,zh-TW,ja,ko,', ',' & $Language_code & ',') Then 484 | $lang = $Language_code 485 | Else 486 | $lang = 'en' 487 | EndIf 488 | $url = 'https://www.virustotal.com/' & $lang & '/file/%sha256%/analysis/' 489 | EndIf 490 | ShellExecute(_ReplacePlaceholders($url)) 491 | 492 | Case $GUI_EVENT_DROPPED 493 | _OpenNewFile(@GUI_DragFile) 494 | MY_WM_PAINT(0, 0, 0, 0) 495 | 496 | Case $gBtn_Open 497 | _OpenNewFile('') 498 | MY_WM_PAINT(0, 0, 0, 0) 499 | 500 | Case $btnLabels 501 | _showText($strLabel & ': ' & $fileAPK, $strLabelInLocales, $apk_Labels) 502 | 503 | Case $gBtn_TextInfo 504 | _showText($strLabel & ': ' & $fileAPK, $strTextInformation, _ReplacePlaceholders($TextInfo)) 505 | 506 | Case $chSignature 507 | If BitAND(GUICtrlRead($chSignature), $GUI_CHECKED) = $GUI_CHECKED Then 508 | $CheckSignature = 1 509 | Else 510 | $CheckSignature = 0 511 | EndIf 512 | IniWrite($IniUser, "Settings", "CheckSignature", $CheckSignature) 513 | 514 | Case $gBtn_Rename 515 | $pos = WinGetPos($hGUI) 516 | $width = $minSize[2] 517 | $height = 130 518 | $sNewNameInput = InputBox($strRenameAPK, $strNewName, $sNewFilenameAPK, "", $width, $height, $pos[0] + ($pos[2] - $width) / 2, $pos[1] + ($pos[3] - $height) / 2, $hGUI) 519 | If $sNewNameInput <> "" Then _renameAPK($sNewNameInput) 520 | 521 | Case $gBtn_Adb 522 | _adb() 523 | 524 | Case $gBtn_Exit, $GUI_EVENT_CLOSE 525 | _cleanUp() 526 | Exit 527 | 528 | Case $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE, $GUI_EVENT_MAXIMIZE 529 | _OnResize() 530 | 531 | Case $edtInfo[0][$INFO_BTN] 532 | _showText($strLabel & ': ' & $fileAPK, $strPermissions, $apk_Permissions) 533 | 534 | Case $edtInfo[1][$INFO_BTN] 535 | _showText($strLabel & ': ' & $fileAPK, $strFeatures & $whGap & "+ = " & $strUses & $whGap & "# = " & $strImplied & $whGap & "- = " & $strNotRequired & $whGap & "@ = " & $strOthers, $apk_Features) 536 | 537 | Case $edtInfo[2][$INFO_BTN] 538 | _showText($strLabel & ': ' & $fileAPK, $strSignature & $whGap & StringReplace($apk_SignatureName, @CRLF, $whGap), $apk_Signature) 539 | 540 | Case $btnSignatureLoad 541 | _LoadSignature() 542 | EndSwitch 543 | WEnd 544 | 545 | ;==================== End GUI ===================================== 546 | 547 | Func _initSelAll($hWnd) 548 | ; Create dummy for accelerator key to activate 549 | $selAll = GUICtrlCreateDummy() 550 | 551 | _setSelAll($selAll, $hWnd) 552 | Return $selAll 553 | EndFunc ;==>_initSelAll 554 | 555 | Func _setSelAll($dummy, $hWnd) 556 | ; Set accelerators for Ctrl+a 557 | Dim $AccelKeys[1][2] = [["^a", $dummy]] 558 | GUISetAccelerators($AccelKeys, $hWnd) 559 | EndFunc ;==>_setSelAll 560 | 561 | Func _SelAll() 562 | $hWnd = _WinAPI_GetFocus() 563 | $class = _WinAPI_GetClassName($hWnd) 564 | If $class == 'Edit' Then _GUICtrlEdit_SetSel($hWnd, 0, -1) 565 | EndFunc ;==>_SelAll 566 | 567 | Func _makeLangLabel($label) 568 | If $ShowLangCode <> "1" Then Return 569 | GUICtrlCreateLabel($label, $rightColumnStart, $offsetHeight + $labelTop, $rightColumnWidth, $inputHeight, $SS_CENTER) 570 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 571 | GUICtrlSetState(-1, $globalStyle) 572 | EndFunc ;==>_makeLangLabel 573 | 574 | Func _makeButton($label, $icon) 575 | $ret = GUICtrlCreateButton('', $btnStart, $offsetHeight, $btnIconSize, $btnIconSize, $BS_BITMAP) 576 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKTOP) 577 | GUICtrlSetTip(-1, $label) 578 | _GUICtrlButton_SetImage($ret, $ScriptDir & '\icons\' & $icon) 579 | GUICtrlSetState(-1, $globalStyle) 580 | $offsetHeight += $btnIconSize + $btnGap 581 | Return $ret 582 | EndFunc ;==>_makeButton 583 | 584 | Func _makeField($label, $edtNum = 0, $width = 0, $dock = $GUI_DOCKTOP, $btnTip = False) 585 | If Not $btnTip Then $btnTip = $label 586 | If $width == 0 Then $width = $inputWidth 587 | $labelHeight = $inputHeight 588 | If $edtNum Then $labelHeight = $editHeight 589 | If $label Then 590 | $label = GUICtrlCreateLabel($label, $labelStart, $offsetHeight + $labelTop, $labelWidth, $labelHeight) 591 | GUICtrlSetState(-1, $globalStyle) 592 | GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) 593 | EndIf 594 | If $edtNum Then 595 | $num = $edtNum - 1 596 | 597 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKLEFT) 598 | $edtInfo[$num][$INFO_LBL] = $label 599 | 600 | $btn = GUICtrlCreateButton('...', $inputStart - $inputHeight, $offsetHeight + $editHeight - $inputHeight, $inputHeight, $inputHeight) 601 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKLEFT) 602 | GUICtrlSetState(-1, $globalStyle) 603 | GUICtrlSetTip(-1, $btnTip) 604 | $edtInfo[$num][$INFO_BTN] = $btn 605 | 606 | $ret = GUICtrlCreateEdit('', $inputStart, $offsetHeight, $editWidth, $editHeight, $editFlags) 607 | GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT) 608 | GUICtrlSetState(-1, $globalInputStyle) 609 | $offsetHeight += $bigFieldHeight 610 | Else 611 | GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKLEFT + $dock) 612 | $ret = GUICtrlCreateInput('', $inputStart, $offsetHeight, $width, $inputHeight, $inputFlags) 613 | GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $dock) 614 | GUICtrlSetState(-1, $globalInputStyle) 615 | $offsetHeight += $fieldHeight 616 | EndIf 617 | Return $ret 618 | EndFunc ;==>_makeField 619 | 620 | ; Draw PNG image 621 | Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam) 622 | _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) 623 | $pos = ControlGetPos(GUICtrlGetHandle($lblIcon), "", 0) 624 | If $defBkColor == 0 Then 625 | $hDC = _WinAPI_GetDC($hGUI) 626 | $defBkColor = _WinAPI_GetPixel($hDC, $pos[0] + $pos[2] / 2, $pos[1] + $pos[3] / 2) 627 | _WinAPI_ReleaseDC($hGUI, $hDC) 628 | ;$defBkColor = $COLOR_RED 629 | $defBkColor = BitOR($defBkColor, 0xFF000000) 630 | EndIf 631 | $color = $defBkColor 632 | If $bkgColor <> 0 Then $color = $bkgColor 633 | $hBrush = _GDIPlus_BrushCreateSolid($color) 634 | _GDIPlus_GraphicsFillRect($hGraphic, $pos[0], $pos[1], $pos[2], $pos[3], $hBrush) 635 | _GDIPlus_BrushDispose($hBrush) 636 | If $hImage_bg Then 637 | _GDIPlus_GraphicsDrawImage($hGraphic, $hImage_bg, $pos[0], $pos[1]) 638 | EndIf 639 | _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, $pos[0], $pos[1]) 640 | _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) 641 | Return $GUI_RUNDEFMSG 642 | EndFunc ;==>MY_WM_PAINT 643 | 644 | #cs 645 | typedef struct { 646 | POINT ptReserved; 647 | POINT ptMaxSize; 648 | POINT ptMaxPosition; 649 | POINT ptMinTrackSize; 650 | POINT ptMaxTrackSize; 651 | } MINMAXINFO; 652 | #ce 653 | 654 | Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) 655 | $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) 656 | DllStructSetData($minmaxinfo, 7, $minSize[2]) ; min X 657 | DllStructSetData($minmaxinfo, 8, $minSize[3]) ; min Y 658 | Return 0 659 | EndFunc ;==>MY_WM_GETMINMAXINFO 660 | 661 | Func _OnResize() 662 | ; move halfs 663 | $full = ControlGetPos(GUICtrlGetHandle($inpPkg), "", 0) 664 | $half = ($full[2] - 5) / 2 665 | $halfStart = $inputStart + $half + 5 666 | 667 | GUICtrlSetPos($inpMinSDK, Default, Default, $half, Default) 668 | GUICtrlSetPos($inpMaxSDK, $halfStart, Default, $half, Default) 669 | 670 | GUICtrlSetPos($inpTargetSDK, Default, Default, $half, Default) 671 | GUICtrlSetPos($inpCompileSDK, $halfStart, Default, $half, Default) 672 | 673 | $half *= $abiRatio 674 | GUICtrlSetPos($inpABIs, Default, Default, $half, Default) 675 | GUICtrlSetPos($lblSupport, $inputStart + $half + 5, Default, $full[2] - $half - 5 + 5 + $rightColumnWidth, Default) 676 | 677 | ; move edits 678 | $start = ControlGetPos(GUICtrlGetHandle($inpTextures), "", 0) 679 | If $inpHash Then 680 | $end = $inpHash 681 | Else 682 | $end = $inpName 683 | EndIf 684 | $end = ControlGetPos(GUICtrlGetHandle($end), "", 0) 685 | $height = ($end[1] - $start[1] - $fieldHeight) / $edits 686 | $gap = $bigFieldHeight - $editHeight 687 | $edH = $height - $gap 688 | 689 | $offsetHeight = $start[1] + $fieldHeight 690 | 691 | GUICtrlSetPos($edtPermissions, Default, $offsetHeight, Default, $edH) 692 | GUICtrlSetPos($edtInfo[0][$INFO_LBL], Default, $offsetHeight + $labelTop) 693 | GUICtrlSetPos($edtInfo[0][$INFO_BTN], Default, $offsetHeight + $edH - $inputHeight) 694 | $offsetHeight += $height 695 | 696 | GUICtrlSetPos($edtFeatures, Default, $offsetHeight, Default, $edH) 697 | GUICtrlSetPos($edtInfo[1][$INFO_LBL], Default, $offsetHeight + $labelTop) 698 | GUICtrlSetPos($edtInfo[1][$INFO_BTN], Default, $offsetHeight + $edH - $inputHeight) 699 | $offsetHeight += $height 700 | 701 | GUICtrlSetPos($edtSignature, Default, $offsetHeight, Default, $edH) 702 | GUICtrlSetPos($chSignature, Default, $offsetHeight + $labelTop) 703 | GUICtrlSetPos($lblSignature, Default, $offsetHeight + $labelTop + $fieldHeight) 704 | GUICtrlSetPos($edtInfo[2][$INFO_BTN], Default, $offsetHeight + $edH - $inputHeight) 705 | $offsetHeight += $height 706 | 707 | _GDIPlus_GraphicsDispose($hGraphic) 708 | $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) 709 | MY_WM_PAINT(0, 0, 0, 0) 710 | 711 | _saveGUIPos() 712 | EndFunc ;==>_OnResize 713 | 714 | Func _saveGUIPos() 715 | If $RestoreGUI == '0' Then Return 716 | $pos = WinGetPos($hGUI) 717 | If BitAND(WinGetState($hGUI), $WIN_STATE_MAXIMIZED) <> 0 Then $pos[2] = 1 718 | IniWrite($IniUser, "State", "LastLeft", $pos[0]) 719 | IniWrite($IniUser, "State", "LastTop", $pos[1]) 720 | IniWrite($IniUser, "State", "LastWidth", $pos[2]) 721 | IniWrite($IniUser, "State", "LastHeight", $pos[3]) 722 | EndFunc ;==>_saveGUIPos 723 | 724 | Func _renameAPK($prmNewFilenameAPK) 725 | $result = FileMove($dirAPK & "\" & $fileAPK, $dirAPK & "\" & $prmNewFilenameAPK) 726 | ; if result<> = error 727 | If $result <> 1 Then 728 | MsgBox(0, $strError, $strRenameFail) 729 | Else 730 | $fileAPK = $prmNewFilenameAPK 731 | GUICtrlSetData($inpName, $fileAPK) 732 | _setFullPathAPK($dirAPK & "\" & $fileAPK) 733 | WinSetTitle($hGUI, "", $fileAPK & ' - ' & $ProgramTitle) 734 | EndIf 735 | EndFunc ;==>_renameAPK 736 | 737 | Func ByteSuffix($iBytes) 738 | Local $iIndex = 0, $aArray = [' B', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB'] 739 | While $iBytes > 1023 740 | $iIndex += 1 741 | $iBytes /= 1024 742 | WEnd 743 | Return Round($iBytes) & $aArray[$iIndex] 744 | EndFunc ;==>ByteSuffix 745 | 746 | Func _SplitPath($prmFullPath, $prmReturnDir = False) 747 | $posSlash = StringInStr($prmFullPath, "\", 0, -1) 748 | Switch $prmReturnDir 749 | Case False 750 | Return StringMid($prmFullPath, $posSlash + 1) 751 | Case True 752 | Return StringLeft($prmFullPath, $posSlash - 1) 753 | EndSwitch 754 | EndFunc ;==>_SplitPath 755 | 756 | Func _checkFileParameter($prmFilename) 757 | If FileExists($prmFilename) Then 758 | Return $prmFilename 759 | Else 760 | ProgressOff() 761 | $f_Sel = FileOpenDialog($strSelectAPK, $LastFolder, "(*.apk)", 1, "") 762 | If @error Then Exit 763 | ProgressOn($strLoading & "...", '', $fileAPK) 764 | $LastFolder = _SplitPath($f_Sel, True) 765 | IniWrite($IniUser, "State", "LastFolder", $LastFolder) 766 | Return $f_Sel 767 | EndIf 768 | EndFunc ;==>_checkFileParameter 769 | 770 | Func _setFullPathAPK($apk) 771 | If BinaryToString(StringToBinary($apk, $SB_ANSI), $SB_ANSI) <> $apk Then 772 | $fullPathAPK = FileGetShortName($apk) 773 | Else 774 | $fullPathAPK = $apk 775 | EndIf 776 | EndFunc ;==>_setFullPathAPK 777 | 778 | Func _OpenNewFile($apk, $progress = True) 779 | $searchPngCache = False 780 | $hashCache = False 781 | $apk = _checkFileParameter($apk) 782 | $dirAPK = _SplitPath($apk, True) 783 | $fileAPK = _SplitPath($apk, False) 784 | 785 | WinSetTitle($hGUI, "", $fileAPK & ' - ' & $ProgramTitle) 786 | 787 | _setFullPathAPK($apk) 788 | 789 | If $progress Then ProgressOn($strLoading & "...", '', $fileAPK) 790 | 791 | ProgressSet(0, $fileAPK, $strSignature & '...') 792 | 793 | $processSignature = False 794 | If $CheckSignature == 1 Then $processSignature = _Run('apksigner', '"' & $JavaPath & 'java" -jar "' & $toolsDir & 'apksigner.jar" verify --v --print-certs "' & $fullPathAPK & '"', $STDERR_CHILD + $STDOUT_CHILD) 795 | 796 | ProgressSet(1, $fileAPK, $strPkg & '...') 797 | 798 | $tmp = _getBadge($fullPathAPK) 799 | _parseLines($tmp) 800 | $tmp = False ; free mem 801 | 802 | ProgressSet(25, $fileAPK, $strIcon & '...') 803 | 804 | _extractIcon() 805 | 806 | ProgressSet(75, $fileAPK, $strSignature & '...') 807 | 808 | _getSignature($fullPathAPK, $CheckSignature, $processSignature) 809 | 810 | $sNewFilenameAPK = _ReplacePlaceholders($FileNamePattern & '.apk') 811 | 812 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, "\\", $FileNameSpace) 813 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, "/", $FileNameSpace) 814 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, ":", $FileNameSpace) 815 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, "*", $FileNameSpace) 816 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, "?", $FileNameSpace) 817 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, '"', $FileNameSpace) 818 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, "<", $FileNameSpace) 819 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, ">", $FileNameSpace) 820 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, "|", $FileNameSpace) 821 | $sNewFilenameAPK = StringReplace($sNewFilenameAPK, $nbsp, $FileNameSpace) 822 | 823 | $hash = _ReplacePlaceholders($ShowHash) 824 | 825 | If $apk_Labels == '' Then 826 | $labels = $GUI_HIDE 827 | Else 828 | $labels = $GUI_SHOW 829 | EndIf 830 | 831 | GUICtrlSetData($inpLabel, $apk_Label) 832 | GUICtrlSetState($btnLabels, $labels) 833 | GUICtrlSetData($inpVersion, $apk_Version) 834 | GUICtrlSetData($inpBuild, $apk_Build) 835 | GUICtrlSetData($inpPkg, $apk_PkgName) 836 | GUICtrlSetData($inpMinSDK, _translateSDKLevel($apk_MinSDK)) 837 | GUICtrlSetData($inpMaxSDK, _translateSDKLevel($apk_MaxSDK)) 838 | GUICtrlSetData($inpTargetSDK, _translateSDKLevel($apk_TargetSDK)) 839 | GUICtrlSetData($inpCompileSDK, _translateSDKLevel($apk_CompileSDK)) 840 | GUICtrlSetData($inpScreens, $apk_Screens) 841 | GUICtrlSetData($inpDensities, $apk_Densities) 842 | GUICtrlSetData($inpABIs, $apk_ABIs) 843 | GUICtrlSetData($inpTextures, $apk_Textures) 844 | GUICtrlSetData($edtPermissions, $apk_Permissions) 845 | GUICtrlSetData($edtFeatures, $apk_Features) 846 | GUICtrlSetData($edtSignature, $apk_Signature) 847 | GUICtrlSetData($lblSignature, $apk_SignatureName) 848 | If $ShowHash <> '' Then GUICtrlSetData($inpHash, $hash) 849 | GUICtrlSetData($inpName, $fileAPK) 850 | GUICtrlSetData($inpNewName, $sNewFilenameAPK) 851 | GUICtrlSetData($edtLocales, $apk_Locales) 852 | GUICtrlSetData($lblSupport, $strSupport & ': ' & $apk_Support) 853 | GUICtrlSetData($lblOpenGL, $apk_OpenGLES) 854 | GUICtrlSetData($lblDebug, $apk_Debuggable) 855 | 856 | _drawPNG() 857 | _OnShow() 858 | 859 | If $progress Then ProgressOff() 860 | $searchPngCache = False 861 | EndFunc ;==>_OpenNewFile 862 | 863 | Func _OnShow() 864 | $pos = StringInStr($apk_Locales & @CRLF, @CRLF & $Language_code & @CRLF) 865 | If $pos Then 866 | _GUICtrlEdit_SetSel($edtLocales, $pos, $pos + StringLen($Language_code) + 1) 867 | _GUICtrlEdit_Scroll($edtLocales, $SB_SCROLLCARET) 868 | EndIf 869 | EndFunc ;==>_OnShow 870 | 871 | Func _FixSpaces($str) 872 | Return StringReplace(StringReplace($str, " ", $FileNameSpace), $nbsp, $FileNameSpace) 873 | EndFunc 874 | 875 | Func _ReplacePlaceholders($pattern) 876 | $out = $pattern 877 | $p = '%label%' 878 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _FixSpaces($apk_Label)) 879 | $p = '%version%' 880 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _FixSpaces($apk_Version)) 881 | $p = '%build%' 882 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _FixSpaces($apk_Build)) 883 | $p = '%package%' 884 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _FixSpaces($apk_PkgName)) 885 | 886 | $p = '%min%' 887 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_MinSDK) 888 | $p = '%min_android%' 889 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _translateSDKLevel($apk_MinSDK, False)) 890 | $p = '%max%' 891 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_MaxSDK) 892 | $p = '%max_android%' 893 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _translateSDKLevel($apk_MaxSDK, False)) 894 | $p = '%target%' 895 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_TargetSDK) 896 | $p = '%target_android%' 897 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _translateSDKLevel($apk_TargetSDK, False)) 898 | $p = '%compile%' 899 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_CompileSDK) 900 | $p = '%compile_android%' 901 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, _translateSDKLevel($apk_CompileSDK, False)) 902 | 903 | $p = '%screens%' 904 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, StringReplace($apk_Screens, " ", ',')) 905 | $p = '%dpis%' 906 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, StringReplace($apk_Densities, " ", ',')) 907 | $p = '%abis%' 908 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, StringReplace($apk_ABIs, " ", ',')) 909 | $p = '%textures%' 910 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, StringReplace($apk_Textures, " ", ',')) 911 | $p = '%opengles%' 912 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, StringReplace($apk_OpenGLES, $strOpenGLES, '')) 913 | $p = '%support%' 914 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_Support) 915 | 916 | $p = '%file_bytes%' 917 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, FileGetSize($dirAPK & "\" & $fileAPK)) 918 | $p = '%file_size%' 919 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, ByteSuffix(FileGetSize($dirAPK & "\" & $fileAPK))) 920 | 921 | $p = '%permissions%' 922 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_Permissions) 923 | $p = '%permissions_cnt%' 924 | If StringInStr($out, $p) Then 925 | If $apk_Permissions == '' Then 926 | $cnt = 0 927 | Else 928 | $cnt = UBound(_StringExplode($apk_Permissions, @CRLF)) 929 | EndIf 930 | $out = StringReplace($out, $p, $cnt) 931 | EndIf 932 | 933 | $p = '%features%' 934 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $apk_Features) 935 | 936 | $p = '%lang%' 937 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, $Language_code) 938 | 939 | $p = '\n' 940 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, @CRLF) 941 | $p = '\t' 942 | If StringInStr($out, $p) Then $out = StringReplace($out, $p, @TAB) 943 | 944 | If StringInStr($out, '%sig_') Then 945 | _LoadSignature() 946 | $out = StringReplace($out, '%sig_sha256%', _StringBetween2($apk_Signature, ' certificate SHA-256 digest: ', @CRLF)) 947 | $out = StringReplace($out, '%sig_sha1%', _StringBetween2($apk_Signature, ' certificate SHA-1 digest: ', @CRLF)) 948 | $out = StringReplace($out, '%sig_md5%', _StringBetween2($apk_Signature, ' certificate MD5 digest: ', @CRLF)) 949 | 950 | $dn = _StringBetween2($apk_Signature, ' certificate DN: ', @CRLF) 951 | $out = StringReplace($out, '%sig_dn%', $dn) 952 | 953 | $dn = ', ' & $dn & ', ' 954 | $out = StringReplace($out, '%sig_email%', _StringBetween2($dn, ', EMAILADDRESS=', ', ')) 955 | $out = StringReplace($out, '%sig_cn%', _StringBetween2($dn, ', CN=', ', ')) 956 | $out = StringReplace($out, '%sig_ou%', _StringBetween2($dn, ', OU=', ', ')) 957 | $out = StringReplace($out, '%sig_o%', _StringBetween2($dn, ', O=', ', ')) 958 | $out = StringReplace($out, '%sig_l%', _StringBetween2($dn, ', L=', ', ')) 959 | $out = StringReplace($out, '%sig_st%', _StringBetween2($dn, ', ST=', ', ')) 960 | $out = StringReplace($out, '%sig_s%', _StringBetween2($dn, ', S=', ', ')) 961 | $out = StringReplace($out, '%sig_c%', _StringBetween2($dn, ', C=', ', ')) 962 | EndIf 963 | 964 | $hashes = 'md2,md4,md5,sha1,sha256,sha384,sha512' 965 | $names = _StringExplode($hashes, ',') 966 | $ids = _StringExplode($CALG_MD2 & ',' & $CALG_MD4 & ',' & $CALG_MD5 & ',' & $CALG_SHA1 & ',' & $CALG_SHA_256 & ',' & $CALG_SHA_384 & ',' & $CALG_SHA_512, ',') 967 | 968 | If Not $hashCache Then $hashCache = $ids 969 | 970 | For $i = 0 To UBound($names) - 1 971 | $pll = '%' & $names[$i] & '%' 972 | $plu = '%' & StringUpper($names[$i]) & '%' 973 | If Not StringInStr($out, $pll) And Not StringInStr($out, $plu) Then ContinueLoop 974 | If $hashCache[$i] == $ids[$i] Then $hashCache[$i] = StringReplace(_Crypt_HashFile($fullPathAPK, $ids[$i]), '0x', '') 975 | $hash = $hashCache[$i] 976 | $out = StringReplace($out, $pll, StringLower($hash), 0, 1) 977 | $out = StringReplace($out, $plu, StringUpper($hash), 0, 1) 978 | Next 979 | 980 | Return $out 981 | EndFunc ;==>_ReplacePlaceholders 982 | 983 | Func _Run($label, $cmd, $options) 984 | ProgressSet(0, $label & '...') 985 | $process = Run(_FixCmd($cmd), $ScriptDir, @SW_HIDE, $options) 986 | ProgressSet(100, $label & '... OK') 987 | Return $process 988 | EndFunc ;==>_Run 989 | 990 | Func _FixCmd($cmd) 991 | If StringInStr(@OSVersion, 'WIN_XP') And StringInStr($cmd, '\tools\adb"') Then 992 | $cmd = StringReplace($cmd, '\tools\adb"', '\tools\xp\adb"') 993 | EndIf 994 | Return $cmd 995 | EndFunc ;==>_RunWait 996 | 997 | Func _RunWait($label, $cmd) 998 | ProgressSet(0, $label & '...') 999 | $ret = RunWait(_FixCmd($cmd), $ScriptDir, @SW_HIDE) 1000 | ProgressSet(100, $label & '... OK') 1001 | Return $ret 1002 | EndFunc ;==>_RunWait 1003 | 1004 | Func _LoadSignature() 1005 | If $apk_Signature == '' Then 1006 | ProgressOn($strLoading & "...", $strSignature) 1007 | _getSignature($fullPathAPK, 1) 1008 | ProgressOff() 1009 | GUICtrlSetData($edtSignature, $apk_Signature) 1010 | EndIf 1011 | EndFunc ;==>_LoadSignature 1012 | 1013 | Func _getSignature($prmAPK, $load, $process = False) 1014 | $output = '' 1015 | If $load == 1 Then 1016 | If $process == False Then $process = _Run('apksigner', '"' & $JavaPath & 'java" -jar "' & $toolsDir & 'apksigner.jar" verify --v --print-certs "' & $prmAPK & '"', $STDERR_CHILD + $STDOUT_CHILD) 1017 | $output &= _readAll($process, 'apksigner stdout') 1018 | $output &= _readAll($process, 'apksigner stderr', False) 1019 | 1020 | If $output == '' Or StringInStr($output, 'java.lang.UnsupportedClassVersionError') Or StringInStr($output, 'Unsupported major.minor version') Then 1021 | $output = $strNeedJava & @CRLF & @CRLF & $output 1022 | EndIf 1023 | 1024 | GUICtrlSetState($btnSignatureLoad, $GUI_HIDE) 1025 | Else 1026 | GUICtrlSetState($btnSignatureLoad, $GUI_SHOW) 1027 | EndIf 1028 | $apk_Signature = StringStripWS($output, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1029 | 1030 | _getSignatureName() 1031 | GUICtrlSetData($lblSignature, $apk_SignatureName) 1032 | EndFunc ;==>_getSignature 1033 | 1034 | Func _getSignatureName() 1035 | $apk_SignatureName = '' 1036 | If $apk_Signature == '' Then Return 1037 | ProgressSet(0, 'names...') 1038 | $names = '' 1039 | ; Format: 'name=SHA1|' 1040 | $names &= 'testkey=61ed377e85d386a8dfee6b864bd85b0bfaa5af81|' 1041 | $names &= 'shared=5b368cff2da2686996bc95eac190eaa4f5630fe5|' 1042 | $names &= 'platform=27196e386b875e76adf700e7ea84e4c6eee33dfa|' 1043 | $names &= 'media=b79df4a82e90b57ea76525ab7037ab238a42f5d3|' 1044 | $names &= 'frame HTC=1052f733fa71da5c2803611cb336f064a8728b36|' 1045 | $names &= 'frame HUAWEI=059e2480adf8c1c5b3d9ec007645ccfc442a23c5|' 1046 | $names &= 'frame Android=736974b37123fa9007cf05cdc1fb43d915917622|' 1047 | $names &= 'debug=da75ff38332859408959c7b3b5fee41ff82cac2e|' 1048 | $names &= $SignatureNames 1049 | For $item In _StringExplode($names, '|') 1050 | $name = _StringExplode($item, '=', 1) 1051 | If UBound($name) <> 2 Then ContinueLoop 1052 | If StringInStr($apk_Signature, $name[1]) Then $apk_SignatureName &= @CRLF & $name[0] 1053 | Next 1054 | ProgressSet(0, 'names... OK') 1055 | EndFunc ;==>_getSignatureName 1056 | 1057 | Func _getBadge($prmAPK) 1058 | $foo = _Run('badging', '"' & $toolsDir & 'aapt" d --include-meta-data badging ' & '"' & $prmAPK & '"', $STDERR_CHILD + $STDOUT_CHILD) 1059 | $output = StringStripWS(_readAll($foo, 'badging'), $STR_STRIPLEADING + $STR_STRIPTRAILING) 1060 | If $output == '' Then $output = StringStripWS(_readAll($foo, 'badging stderr', False), $STR_STRIPLEADING + $STR_STRIPTRAILING) 1061 | Return $output 1062 | EndFunc ;==>_getBadge 1063 | 1064 | Func _parseLines($lines) 1065 | $prmArrayLines = _StringExplode($lines, @CRLF) 1066 | 1067 | $apk_Debuggable = '' 1068 | $apk_Label = '' 1069 | $apk_Labels = '' 1070 | $apk_PkgName = '' 1071 | $apk_Build = '' 1072 | $apk_Version = '' 1073 | $apk_Permissions = '' 1074 | $apk_MinSDK = '' 1075 | $apk_MaxSDK = '' 1076 | $apk_TargetSDK = '' 1077 | $apk_CompileSDK = '' 1078 | $apk_Screens = '' 1079 | $apk_Densities = '' 1080 | $apk_ABIs = '' 1081 | $apk_Locales = '' 1082 | $apk_OpenGLES = $strOpenGLES & '1.0' 1083 | $apk_Textures = '' 1084 | $apk_Support = $strAndroid 1085 | 1086 | $anyDensity = False 1087 | 1088 | $icons = '' 1089 | $icons2 = '' 1090 | $banners = '' 1091 | 1092 | $featuresUsed = '' 1093 | $featuresNotRequired = '' 1094 | $featuresImplied = '' 1095 | $featuresOthers = '' 1096 | For $line In $prmArrayLines 1097 | 1098 | If $line == 'application-debuggable' Then 1099 | $apk_Debuggable = $strDebuggable 1100 | EndIf 1101 | 1102 | $arraySplit = _StringExplode($line, ":", 1) 1103 | $key = StringStripWS($arraySplit[0], $STR_STRIPLEADING + $STR_STRIPTRAILING) 1104 | If UBound($arraySplit) > 1 Then 1105 | $value = $arraySplit[1] 1106 | Else 1107 | $value = '' 1108 | EndIf 1109 | 1110 | If $key == 'leanback-launchable-activity' And Not StringInStr($apk_Support, $strTV) Then 1111 | $apk_Support &= ', ' & $strTV 1112 | EndIf 1113 | 1114 | If StringInStr($key, 'application-icon-') Then 1115 | If $icons2 <> '' Then $icons2 = @CRLF & $icons2 1116 | $icons2 = _StringBetween2($value, "'", "'") & $icons2 1117 | ContinueLoop 1118 | EndIf 1119 | 1120 | If StringInStr($key, 'application-label') Then 1121 | $add = StringReplace($line, 'application-label-', '') 1122 | $add = StringReplace($add, 'application-label', 'default') 1123 | If StringInStr($apk_Labels, $value) Then 1124 | $apk_Labels = StringReplace($apk_Labels, ':' & $value, ', ' & $add) 1125 | Else 1126 | If $apk_Labels <> '' Then $apk_Labels &= @CRLF 1127 | $apk_Labels &= $add 1128 | EndIf 1129 | EndIf 1130 | 1131 | Switch $key 1132 | Case 'application-label' 1133 | If $apk_Label == '' Then $apk_Label = _StringBetween2($value, "'", "'") 1134 | 1135 | Case 'application-label-' & $Language_code 1136 | If $LocalizeName == '1' Then $apk_Label = _StringBetween2($value, "'", "'") 1137 | 1138 | Case 'application', 'launchable-activity', 'leanback-launchable-activity' 1139 | If $apk_Label == '' Then $apk_Label = _StringBetween2($value, "label='", "'") 1140 | $icon = _StringBetween2($value, "icon='", "'") 1141 | If $icon <> '' Then 1142 | If $icons <> '' Then $icons &= @CRLF 1143 | $icons &= $icon 1144 | EndIf 1145 | $icon = _StringBetween2($value, "banner='", "'") 1146 | If $icon <> '' Then 1147 | If $banners <> '' Then $banners &= @CRLF 1148 | $banners &= $icon 1149 | EndIf 1150 | 1151 | If $featuresOthers <> '' Then $featuresOthers &= @CRLF 1152 | If $value <> '' Then $line = $key & ': ' & StringStripWS($value, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1153 | $featuresOthers &= '@ ' & StringStripWS($line, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1154 | 1155 | Case 'package' 1156 | $apk_PkgName = _StringBetween2($value, "name='", "'") 1157 | $apk_Build = _StringBetween2($value, "versionCode='", "'") 1158 | $apk_Version = _StringBetween2($value, "versionName='", "'") 1159 | $apk_CompileSDK = _StringBetween2($value, "compileSdkVersion='", "'") 1160 | 1161 | $install = _StringBetween2($value, "install-location:'", "'") 1162 | 1163 | If $install <> '' Then 1164 | If $featuresOthers <> '' Then $featuresOthers &= @CRLF 1165 | $featuresOthers &= '@ ' & "install-location: '" & $install & "'" 1166 | EndIf 1167 | 1168 | Case 'uses-permission' 1169 | If $apk_Permissions <> '' Then $apk_Permissions &= @CRLF 1170 | $apk_Permissions &= _StringBetween2($value, "'", "'") 1171 | 1172 | Case 'uses-feature' 1173 | If $featuresUsed <> '' Then $featuresUsed &= @CRLF 1174 | $val = _StringBetween2($value, "'", "'") 1175 | $featuresUsed &= '+ ' & $val 1176 | 1177 | If $val == 'android.hardware.type.watch' And Not StringInStr($apk_Support, $strWatch) Then 1178 | $apk_Support &= ', ' & $strWatch 1179 | EndIf 1180 | 1181 | Case 'uses-feature-not-required' 1182 | If $featuresNotRequired <> '' Then $featuresNotRequired &= @CRLF 1183 | $featuresNotRequired &= '- ' & _StringBetween2($value, "'", "'") 1184 | 1185 | Case 'uses-implied-feature' 1186 | If $featuresImplied <> '' Then $featuresImplied &= @CRLF 1187 | $featuresImplied &= '# ' & _StringBetween2($value, "'", "'") & ' (' & _StringBetween2($value, "reason='", "'") & ')' 1188 | 1189 | Case 'provides-component', 'main', 'other-activities', 'other-receivers', 'other-services', 'requires-smallest-width', 'compatible-width-limit', 'largest-width-limit', 'uses-configuration', 'application-isGame', 'application-debuggable', 'uses-package', 'original-package', 'package-verifier', 'uses-library', 'uses-library-not-required', 'meta-data' 1190 | If $featuresOthers <> '' Then $featuresOthers &= @CRLF 1191 | If $value <> '' Then $line = $key & ': ' & StringStripWS($value, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1192 | If StringInStr($line, 'android.max_aspect') Then 1193 | $int = _StringBetween2($value, "value='", "'") 1194 | $float = _Lib_IntToFloat($int) 1195 | $line &= ' // ' & Round($float, 3) 1196 | EndIf 1197 | $featuresOthers &= '@ ' & StringStripWS($line, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1198 | If $key == 'meta-data' And _StringBetween2($value, "name='", "'") == 'com.google.android.gms.car.application' And Not StringInStr($apk_Support, $strAuto) Then 1199 | $apk_Support &= ', ' & $strAuto 1200 | EndIf 1201 | 1202 | Case 'sdkVersion' 1203 | $apk_MinSDK = _StringBetween2($value, "'", "'") 1204 | 1205 | Case 'maxSdkVersion' 1206 | $apk_MaxSDK = _StringBetween2($value, "'", "'") 1207 | 1208 | Case 'targetSdkVersion' 1209 | $apk_TargetSDK = _StringBetween2($value, "'", "'") 1210 | 1211 | Case 'supports-screens' 1212 | $apk_Screens = StringStripWS(StringReplace($value, "'", ""), $STR_STRIPLEADING + $STR_STRIPTRAILING) 1213 | 1214 | Case 'supports-any-density' 1215 | If _StringBetween2($value, "'", "'") == 'true' Then $anyDensity = True 1216 | 1217 | Case 'densities' 1218 | $apk_Densities = StringStripWS(StringReplace($value, "'", ""), $STR_STRIPLEADING + $STR_STRIPTRAILING) 1219 | $apk_Densities = StringReplace($apk_Densities, "120", "ldpi") 1220 | $apk_Densities = StringReplace($apk_Densities, "160", "mdpi") 1221 | $apk_Densities = StringReplace($apk_Densities, "240", "hdpi") 1222 | $apk_Densities = StringReplace($apk_Densities, "320", "xhdpi") 1223 | $apk_Densities = StringReplace($apk_Densities, "480", "xxhdpi") 1224 | $apk_Densities = StringReplace($apk_Densities, "640", "xxxhdpi") 1225 | $apk_Densities = StringReplace($apk_Densities, "65534", "anydpi") 1226 | $apk_Densities = StringReplace($apk_Densities, "65535", "nodpi") 1227 | $apk_Densities = StringReplace($apk_Densities, "-1", "undefineddpi") 1228 | If $anyDensity And Not StringInStr($apk_Densities, "anydpi") Then $apk_Densities = StringStripWS($apk_Densities & ' anydpi', $STR_STRIPLEADING + $STR_STRIPTRAILING) 1229 | 1230 | Case 'native-code', 'alt-native-code' 1231 | For $abi In _StringExplode('armeabi,armeabi-v7a,arm64-v8a,x86,x86_64,mips,mips64', ',') 1232 | If Not StringInStr($value, "'" & $abi & "'") Then ContinueLoop 1233 | If $apk_ABIs <> '' Then $apk_ABIs &= ' ' 1234 | $apk_ABIs &= $abi 1235 | Next 1236 | 1237 | Case 'locales' 1238 | $apk_Locales = StringReplace(StringStripWS(StringReplace($value, "'", ""), $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES), ' ', @CRLF) 1239 | 1240 | Case 'uses-gl-es' 1241 | $ver = _StringBetween2($value, "'", "'") 1242 | If StringLen($ver) > 6 And StringLeft($ver, 2) == '0x' Then 1243 | $ver = StringTrimLeft($ver, 2) 1244 | $ver = Dec(StringTrimRight($ver, 4)) & '.' & Dec(StringRight($ver, 4)) 1245 | EndIf 1246 | $apk_OpenGLES = $strOpenGLES & $ver 1247 | 1248 | If $featuresUsed <> '' Then $featuresUsed &= @CRLF 1249 | $featuresUsed &= '+ ' & $apk_OpenGLES 1250 | 1251 | Case 'supports-gl-texture' 1252 | If $apk_Textures <> '' Then $apk_Textures &= ' ' 1253 | $val = _StringBetween2($value, "'", "'") 1254 | Switch $val 1255 | Case 'GL_OES_compressed_ETC1_RGB8_texture' 1256 | $val = 'ETC1' 1257 | Case 'GL_OES_compressed_paletted_texture' 1258 | $val = 'PAL' 1259 | Case 'GL_AMD_compressed_3DC_texture' 1260 | $val = '3DC' 1261 | Case 'GL_AMD_compressed_ATC_texture' 1262 | $val = 'ATC' 1263 | Case 'GL_ATI_texture_compression_atitc' 1264 | $val = 'ATI' 1265 | Case 'GL_EXT_texture_compression_latc' 1266 | $val = 'LATC' 1267 | Case 'GL_EXT_texture_compression_dxt1' 1268 | $val = 'DXT1' 1269 | Case 'GL_EXT_texture_compression_s3tc' 1270 | $val = 'S3TC' 1271 | Case 'GL_IMG_texture_compression_pvrtc' 1272 | $val = 'PVR' 1273 | Case 'GL_KHR_texture_compression_astc_hdr' 1274 | $val = 'hASTC' 1275 | Case 'GL_KHR_texture_compression_astc_ldr' 1276 | $val = 'lASTC' 1277 | Case 'GL_OES_texture_compression_S3TC' 1278 | $val = 'oS3TC' 1279 | Case 'GL_OES_texture_compression_astc' 1280 | $val = 'ASTC' 1281 | EndSwitch 1282 | $apk_Textures &= $val 1283 | 1284 | If $featuresOthers <> '' Then $featuresOthers &= @CRLF 1285 | If $value <> '' Then $line = $key & ': ' & StringStripWS($value, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1286 | $featuresOthers &= '@ ' & StringStripWS($line, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1287 | EndSwitch 1288 | Next 1289 | 1290 | If Not StringInStr($apk_Labels, @CRLF) Then $apk_Labels = '' 1291 | 1292 | $apk_Icons = '' 1293 | Local $src[3] 1294 | $src[0] = $icons 1295 | $src[1] = $banners 1296 | $src[2] = $icons2 1297 | For $list In $src 1298 | $list = StringStripWS($list, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1299 | If $list == '' Then ContinueLoop 1300 | For $icon In _StringExplode($list, @CRLF) 1301 | If $icon == '' Or StringInStr($apk_Icons, $icon) Then ContinueLoop 1302 | If $apk_Icons <> '' Then $apk_Icons &= @CRLF 1303 | $apk_Icons &= $icon 1304 | Next 1305 | Next 1306 | 1307 | $apk_Features = $featuresUsed 1308 | If $featuresImplied <> '' Then 1309 | If $apk_Features <> '' Then $apk_Features &= @CRLF 1310 | $apk_Features &= $featuresImplied 1311 | EndIf 1312 | If $featuresNotRequired <> '' Then 1313 | If $apk_Features <> '' Then $apk_Features &= @CRLF 1314 | $apk_Features &= $featuresNotRequired 1315 | EndIf 1316 | If $featuresOthers <> '' Then 1317 | If $apk_Features <> '' Then $apk_Features &= @CRLF 1318 | $apk_Features &= $featuresOthers 1319 | EndIf 1320 | 1321 | If StringInStr($apk_Permissions, @CRLF) Then 1322 | $tmp = _StringExplode($apk_Permissions, @CRLF) 1323 | _ArraySort($tmp) 1324 | $apk_Permissions = _ArrayToString($tmp, @CRLF) 1325 | EndIf 1326 | 1327 | ;$apk_Permissions = StringReplace(StringLower($apk_Permissions), "android.permission.", "") 1328 | ;$apk_Features = StringReplace(StringReplace(StringLower($apk_Features), "android.hardware.", ""), "android.permission.", "") 1329 | EndFunc ;==>_parseLines 1330 | 1331 | Func _searchPng($res) 1332 | $ret = $res 1333 | 1334 | If Not $searchPngCache Then 1335 | $foo = _Run('list', '"' & $toolsDir & 'unzip" -l ' & '"' & $fullPathAPK & '"', $STDERR_CHILD + $STDOUT_CHILD) 1336 | $output = _readAll($foo, 'list') 1337 | $searchPngCache = _StringExplode($output, @CRLF) 1338 | EndIf 1339 | 1340 | $start = StringLeft($res, 10) ; 'res/mipmap' or 'res/drawab' 1341 | $apk_IconName = _lastPart($res, "/") 1342 | $end = '/' & StringLeft($apk_IconName, StringLen($apk_IconName) - 3) & 'png' 1343 | $bestSize = 0 1344 | For $line In $searchPngCache 1345 | $check = _StringBetween($line, $start, $end) 1346 | If $check <> 0 Then 1347 | $size = Int(StringStripWS($line, $STR_STRIPLEADING + $STR_STRIPTRAILING)) 1348 | If $size > $bestSize Then 1349 | $bestSize = $size 1350 | $ret = $start & $check[0] & $end 1351 | EndIf 1352 | EndIf 1353 | Next 1354 | Return $ret 1355 | EndFunc ;==>_searchPng 1356 | 1357 | Func _parseXmlIcon($icon) 1358 | $foo = _Run('xmltree', '"' & $toolsDir & 'aapt" d xmltree ' & '"' & $fullPathAPK & '" "' & $icon & '"', $STDERR_CHILD + $STDOUT_CHILD) 1359 | $output = _readAll($foo, 'xmltree') 1360 | $arrayLines = _StringExplode($output, @CRLF) 1361 | 1362 | $fg = 1 1363 | Local $ids[2] 1364 | $ids[0] = 0 1365 | $ids[1] = 0 1366 | For $line In $arrayLines 1367 | Select 1368 | Case StringInStr($line, 'E: background') 1369 | $fg = 0 1370 | 1371 | Case StringInStr($line, 'E: foreground') 1372 | $fg = 1 1373 | 1374 | Case StringInStr($line, 'A: android:drawable') 1375 | $ids[$fg] = _lastPart($line, "@") 1376 | 1377 | Case StringInStr($line, 'A: android:src') 1378 | $ids[$fg] = _lastPart($line, "@") 1379 | EndSelect 1380 | Next 1381 | 1382 | _setProgress(1) 1383 | 1384 | If $ids[0] Or $ids[1] Then 1385 | $foo = _Run('resources', '"' & $toolsDir & 'aapt" d resources ' & '"' & $fullPathAPK & '"', $STDERR_CHILD + $STDOUT_CHILD) 1386 | $output = _readAll($foo, 'resources') 1387 | $arrayLines = _StringExplode($output, @CRLF) 1388 | 1389 | Local $png[2] 1390 | $png[0] = 0 1391 | $png[1] = 0 1392 | For $line In $arrayLines 1393 | If StringInStr($line, 'spec resource ') Then 1394 | For $i = 0 To 1 1395 | If Not $ids[$i] Or $png[$i] Or Not StringInStr($line, $ids[$i]) Then ContinueLoop 1396 | $png[$i] = _StringBetween2($line, ":", ":") 1397 | Next 1398 | ElseIf $png[0] And StringLeft($png[0], 6) == 'color/' And StringInStr($line, ':' & $png[0] & ': ') And StringInStr($line, ' d=0x') Then 1399 | $bkgColor = Dec(_StringBetween2($line, " d=0x", " ")) 1400 | EndIf 1401 | Next 1402 | 1403 | If $png[0] Then 1404 | $apk_IconPathBg = _searchPng('res/' & $png[0] & '.png') 1405 | EndIf 1406 | If $png[1] Then 1407 | $apk_IconPath = _searchPng('res/' & $png[1] & '.png') 1408 | EndIf 1409 | EndIf 1410 | _setProgress(1) 1411 | EndFunc ;==>_parseXmlIcon 1412 | 1413 | Func _loadIcon($icon) 1414 | $icon = _searchPng($icon) 1415 | 1416 | _setProgress(1) 1417 | 1418 | Select 1419 | Case StringRight($icon, 4) == '.xml' 1420 | _parseXmlIcon($icon) 1421 | 1422 | Case Else 1423 | _setProgress(2) 1424 | $apk_IconPath = $icon 1425 | EndSelect 1426 | 1427 | _setProgress(1) 1428 | EndFunc ;==>_loadIcon 1429 | 1430 | Func _setProgress($inc) 1431 | $progress += $inc 1432 | ProgressSet(25 + 40 * $progress / $progressMax, $fileAPK, $strIcon & '...') 1433 | EndFunc ;==>_setProgress 1434 | 1435 | Func _extractIcon() 1436 | $bkgColor = 0 1437 | $apk_IconPath = False 1438 | $apk_IconPathBg = False 1439 | 1440 | $icons = _StringExplode($apk_Icons, @CRLF) 1441 | $progress = 0 1442 | $progressMax = UBound($icons) * 4 1443 | For $icon In $icons 1444 | If $apk_IconPath And StringRight($apk_IconPath, 4) == '.png' Then ExitLoop 1445 | _setProgress(0) 1446 | 1447 | _loadIcon($icon) 1448 | Next 1449 | ProgressSet(65, $fileAPK, $strIcon & '...') 1450 | 1451 | ; extract icon 1452 | $files = $apk_IconPath 1453 | If $apk_IconPathBg Then 1454 | $files &= ' ' & $apk_IconPathBg 1455 | EndIf 1456 | $files = StringStripWS($files, $STR_STRIPLEADING + $STR_STRIPTRAILING) 1457 | If $files <> '' Then 1458 | DirCreate($tempPath) 1459 | _RunWait('icons', '"' & $toolsDir & 'unzip" -o -j ' & '"' & $fullPathAPK & '" ' & $files & " -d " & '"' & $tempPath & '"') 1460 | EndIf 1461 | EndFunc ;==>_extractIcon 1462 | 1463 | Func _cleanUp() 1464 | _saveGUIPos() 1465 | 1466 | If $hImage_bg Then 1467 | _GDIPlus_ImageDispose($hImage_bg) 1468 | EndIf 1469 | _GDIPlus_ImageDispose($hImage) 1470 | _GDIPlus_GraphicsDispose($hGraphic) 1471 | _GDIPlus_Shutdown() 1472 | 1473 | DirRemove($tempPath, 1) ; clean own dir 1474 | DirRemove(@TempDir & "\APK-Info", 1) ; clean files from previous runs 1475 | If $AdbKill == '2' Then _RunWait('kill', '"' & $toolsDir & 'adb" kill-server') 1476 | EndFunc ;==>_cleanUp 1477 | 1478 | Func _translateSDKLevel($sdk, $withNumber = True) 1479 | If $sdk == '' Then Return '' 1480 | If $sdk == "1000" Then 1481 | $name = $strCurDev & '|' & $strCurDevBuild 1482 | Else 1483 | $name = IniRead($IniFile, "AndroidName", "SDK-" & $sdk, '??|' & $strUnknown) 1484 | EndIf 1485 | $tmp = _StringExplode($name, '|') 1486 | $ret = $tmp[0] 1487 | If UBound($tmp) >= 2 Then $ret = $ret & ' (' & $tmp[1] & ')' 1488 | If $withNumber Then $ret = $sdk & ': Android ' & $ret 1489 | Return $ret 1490 | EndFunc ;==>_translateSDKLevel 1491 | 1492 | Func _drawPNG() 1493 | If $hImage_bg Then 1494 | _GDIPlus_ImageDispose($hImage_bg) 1495 | EndIf 1496 | $hImage_bg = 0 1497 | If $apk_IconPathBg Then 1498 | $hImage_bg = _drawImg($apk_IconPathBg) 1499 | EndIf 1500 | If $hImage Then 1501 | _GDIPlus_ImageDispose($hImage) 1502 | EndIf 1503 | $hImage = _drawImg($apk_IconPath) 1504 | EndFunc ;==>_drawPNG 1505 | 1506 | Func _drawImg($path) 1507 | $apk_IconName = _lastPart($path, "/") 1508 | $filename = $tempPath & "\" & $apk_IconName 1509 | If StringRight($filename, 5) == '.webp' Then 1510 | $tmpFilename = StringTrimRight($filename, 5) & '.png' 1511 | DirCreate($tempPath) 1512 | _RunWait('dwebp', '"' & $toolsDir & 'dwebp" "' & $filename & '" -o "' & $tmpFilename & '"') 1513 | If FileExists($tmpFilename) Then 1514 | FileDelete($filename) ; no need - try delete 1515 | $filename = $tmpFilename 1516 | EndIf 1517 | EndIf 1518 | $hImage_original = _GDIPlus_ImageLoadFromFile($filename) 1519 | ; resize always the bigger icon to 48x48 pixels 1520 | $hImage_ret = _GDIPlus_ImageResize($hImage_original, $iconSize, $iconSize) 1521 | _GDIPlus_ImageDispose($hImage_original) 1522 | FileDelete($filename) ; no need - try delete 1523 | $type = VarGetType($hImage_ret) 1524 | Return $hImage_ret 1525 | EndFunc ;==>_drawImg 1526 | 1527 | Func _lastPart($str, $sep) 1528 | $tmp_arr = _StringExplode($str, $sep) 1529 | Return $tmp_arr[UBound($tmp_arr) - 1] 1530 | EndFunc ;==>_lastPart 1531 | 1532 | Func _StringBetween2($text, $from, $to) 1533 | $var = _StringBetween($text, $from, $to) 1534 | If $var <> 0 Then Return $var[0] 1535 | Return '' 1536 | EndFunc ;==>_StringBetween2 1537 | 1538 | Func _showText($title, $message, $text) 1539 | $pos = WinGetPos($hGUI) 1540 | $width = $pos[2] - ($minSize[2] - $fullWidth) 1541 | $height = $pos[3] - ($minSize[3] - $fullHeight) 1542 | $gui = GUICreate($title, $width, $height, $pos[0], $pos[1], BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX)) 1543 | 1544 | $offset = 5 1545 | GUICtrlCreateLabel($message, 5, $offset, $width - 10, $inputHeight) 1546 | GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT + $GUI_DOCKTOP) 1547 | $offset += $inputHeight + 5 1548 | $edit = GUICtrlCreateEdit($text, 5, $offset, $width - 10, $height - 35 - $offset, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL, $ES_WANTRETURN)) 1549 | GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) 1550 | $btnClose = GUICtrlCreateButton($strClose, $width / 4, $height - 30, $width / 2) 1551 | GUICtrlSetResizing(-1, $GUI_DOCKHCENTER + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) 1552 | 1553 | $selAll = _initSelAll($gui) 1554 | 1555 | GUISetState(@SW_SHOW, $gui) 1556 | GUISetState(@SW_SHOWNORMAL, $gui) 1557 | GUISetState(@SW_HIDE, $hGUI) 1558 | 1559 | GUICtrlSetState($edit, $GUI_FOCUS) 1560 | 1561 | While 1 1562 | $Msg = GUIGetMsg() 1563 | Switch $Msg 1564 | Case $GUI_EVENT_CLOSE, $btnClose 1565 | ExitLoop 1566 | Case $selAll 1567 | _SelAll() 1568 | EndSwitch 1569 | WEnd 1570 | GUISetState(@SW_SHOW, $hGUI) 1571 | GUISetState(@SW_SHOWNORMAL, $hGUI) 1572 | GUISetState(@SW_HIDE, $gui) 1573 | GUIDelete($gui) 1574 | 1575 | _setSelAll($gSelAll, $hGUI) 1576 | EndFunc ;==>_showText 1577 | 1578 | Func _adbDevice($title) 1579 | ProgressOn($title, 'ADB') 1580 | _RunWait('start', '"' & $toolsDir & 'adb" start-server') 1581 | 1582 | For $cmd In _StringExplode($AdbInit, '|') 1583 | If $cmd == '' Then ContinueLoop 1584 | _RunWait('init', '"' & $toolsDir & 'adb" ' & $cmd) 1585 | Next 1586 | 1587 | $foo = _Run('devices', '"' & $toolsDir & 'adb" devices -l', $STDERR_CHILD + $STDOUT_CHILD + $STDERR_MERGED) 1588 | $output = _readAll($foo, 'devices') 1589 | 1590 | $output = StringStripWS(StringReplace($output, 'List of devices attached', ''), $STR_STRIPLEADING + $STR_STRIPTRAILING) 1591 | 1592 | If $output == '' Then 1593 | ProgressOff() 1594 | MsgBox(0, $title, $strNoAdbDevices) 1595 | Return '' 1596 | EndIf 1597 | 1598 | $arrayLines = _StringExplode($output, @CRLF) 1599 | $cnt = UBound($arrayLines) 1600 | 1601 | $gap = 5 1602 | $top = $gap 1603 | 1604 | $lblHeight = 24 1605 | $btnHeight = 30 1606 | $itemHeight = $lblHeight + $gap + $btnHeight + $gap 1607 | $height = $top + $cnt * $itemHeight + $gap 1608 | 1609 | $cmds = _StringExplode($strInstall & ': %adb% install -r "' & $fullPathAPK & '"; ' & $strInstall & ' + ' & $strStart & ': %adb% install -r "' & $fullPathAPK & '"|%adb% shell "monkey -p ' & $apk_PkgName & ' -c android.intent.category.LAUNCHER 1"; ' & $strStart & ': %adb% shell "monkey -p ' & $apk_PkgName & ' -c android.intent.category.LAUNCHER 1"; ' & $strUninstall & ': %adb% uninstall "' & $apk_PkgName & '"', '; ') 1610 | 1611 | $ids = '' 1612 | $commands = '' 1613 | 1614 | $pos = WinGetPos($hGUI) 1615 | 1616 | $width = $minSize[2] 1617 | $btnWidth = (($width - $gap) / UBound($cmds)) - $gap 1618 | 1619 | $gui = GUICreate($title, $width, $height, $pos[0] + ($pos[2] - $width) / 2, $pos[1] + ($pos[3] - $height) / 2) 1620 | 1621 | For $line In $arrayLines 1622 | $device = _StringExplode($line, ' ', 1)[0] 1623 | 1624 | GUICtrlCreateLabel($line, $gap, $top, $width - $gap * 2) 1625 | $top += $lblHeight + $gap 1626 | $left = $gap 1627 | For $cmd In $cmds 1628 | $cmd = _StringExplode($cmd, ': ', 1) 1629 | 1630 | $ids &= GUICtrlCreateButton($cmd[0], $left, $top, $btnWidth, $btnHeight) & @CRLF 1631 | $commands &= StringReplace($cmd[1], '%adb%', '"' & $toolsDir & 'adb" -s "' & $device & '"') & @CRLF 1632 | 1633 | $left += $btnWidth + $gap 1634 | Next 1635 | $top += $btnHeight + $gap 1636 | Next 1637 | 1638 | $ids = _StringExplode(StringStripWS($ids, $STR_STRIPLEADING + $STR_STRIPTRAILING), @CRLF) 1639 | $cnt = UBound($ids) - 1 1640 | $commands = _StringExplode($commands, @CRLF) 1641 | 1642 | ProgressOff() 1643 | 1644 | $device = '' 1645 | 1646 | GUISetState(@SW_SHOW, $gui) 1647 | GUISetState(@SW_SHOWNORMAL, $gui) 1648 | GUISetState(@SW_HIDE, $hGUI) 1649 | 1650 | While 1 1651 | $Msg = GUIGetMsg() 1652 | If $Msg == $GUI_EVENT_CLOSE Or $device <> '' Then ExitLoop 1653 | If $Msg > 0 Then 1654 | $str = $Msg & '' 1655 | For $i = 0 To $cnt 1656 | If $ids[$i] <> $str Then ContinueLoop 1657 | $val = GUICtrlRead($Msg) 1658 | $device = $val & '|' & $commands[$i] 1659 | ExitLoop 1660 | Next 1661 | EndIf 1662 | WEnd 1663 | GUISetState(@SW_SHOW, $hGUI) 1664 | GUISetState(@SW_SHOWNORMAL, $hGUI) 1665 | GUISetState(@SW_HIDE, $gui) 1666 | GUIDelete($gui) 1667 | 1668 | Return $device 1669 | EndFunc ;==>_adbDevice 1670 | 1671 | Func _adb() 1672 | $device = _adbDevice($apk_Label & ' [' & $apk_PkgName & ']') 1673 | 1674 | If $device == '' Then Return 1675 | 1676 | $parts = _StringExplode($device, '|') 1677 | 1678 | $title = $parts[0] 1679 | ProgressOn($title, $strLoading) 1680 | 1681 | $output = '' 1682 | $timer = TimerInit() 1683 | For $i = 1 To UBound($parts) - 1 1684 | $cmd = $parts[$i] 1685 | 1686 | $foo = _Run('adb', $cmd, $STDERR_CHILD + $STDOUT_CHILD + $STDERR_MERGED) 1687 | $timeout = TimerInit() 1688 | $max = $AdbTimeout * 1000 1689 | $last = 0 1690 | While 1 1691 | $time = TimerDiff($timeout) 1692 | If $time > $max Then 1693 | ProgressOff() 1694 | If MsgBox($MB_RETRYCANCEL + $MB_ICONQUESTION, $title, $strExceededTimeout) <> $IDRETRY Then ExitLoop 1695 | 1696 | $timeout = TimerInit() 1697 | 1698 | $tmp = _StringExplode(StringStripWS($output, $STR_STRIPLEADING + $STR_STRIPTRAILING), @CRLF) 1699 | ProgressOn($title, $strLoading, $tmp[UBound($tmp) - 1]) 1700 | EndIf 1701 | $bin = StdoutRead($foo, False, True) 1702 | If @error Then ExitLoop 1703 | If StringLen($bin) > 0 Then $timeout = TimerInit() 1704 | $output &= BinaryToString($bin, $SB_UTF8) 1705 | $check = Round(TimerDiff($timer) / 500) 1706 | If $check <> $last Then 1707 | $last = $check 1708 | $tmp = _StringExplode(StringStripWS($output, $STR_STRIPLEADING + $STR_STRIPTRAILING), @CRLF) 1709 | ProgressSet($time * 100 / $max, $tmp[UBound($tmp) - 1]) 1710 | EndIf 1711 | If StringInStr($output, 'waiting for device') Then ExitLoop 1712 | WEnd 1713 | ProcessClose($foo) 1714 | Next 1715 | 1716 | ProgressOff() 1717 | 1718 | $lines = _StringExplode(StringStripWS($output, $STR_STRIPLEADING + $STR_STRIPTRAILING), @CRLF) 1719 | $output = '' 1720 | For $line In $lines 1721 | If StringInStr($line, '%]') Then ContinueLoop 1722 | If $output <> '' Then $output &= @CRLF 1723 | $output &= $line 1724 | Next 1725 | 1726 | MsgBox(0, $title, $output) 1727 | 1728 | If $AdbKill == '1' Then _RunWait('kill', '"' & $toolsDir & 'adb" kill-server') 1729 | EndFunc ;==>_adb 1730 | 1731 | Func _readAll($process, $error, $stdout = True) 1732 | ProgressSet(0, $error & '...') 1733 | $output = '' 1734 | $max = 32 * 1000 1735 | $timeout = TimerInit() 1736 | $timer = TimerInit() 1737 | $last = 0 1738 | While 1 1739 | $time = TimerDiff($timeout) 1740 | If $time > $max Then ExitLoop 1741 | If $stdout Then 1742 | $bin = StdoutRead($process, False, True) 1743 | Else 1744 | $bin = StderrRead($process, False, True) 1745 | EndIf 1746 | If @error Then ExitLoop 1747 | If StringLen($bin) > 0 Then 1748 | $timeout = TimerInit() 1749 | $output &= BinaryToString($bin, $SB_UTF8) 1750 | Else 1751 | $check = Round(TimerDiff($timer) / 500) 1752 | If $check <> $last Then 1753 | $last = $check 1754 | ProgressSet($time * 100 / $max, $error & '... ' & Round($time / 1000)) 1755 | EndIf 1756 | EndIf 1757 | WEnd 1758 | ProgressSet(100, $error & '... OK') 1759 | Return $output 1760 | EndFunc ;==>_readAll 1761 | 1762 | Func _readSettings($name, $default) 1763 | $ret = IniRead($IniUser, "Settings", $name, '') 1764 | If $ret == '' Then $ret = IniRead($IniFile, "Settings", $name, $default) 1765 | Return $ret 1766 | EndFunc ;==>_readSettings 1767 | 1768 | Func _checkNewVersion() 1769 | If $CheckNewVersion <> '0' Then 1770 | $tag = _StringExplode(IniRead($IniUser, "State", 'LastVersion', ''), '|', 1) 1771 | $now = 'd' & @MON & '-' & @MDAY ; If $CheckNewVersion == '1' Then 1772 | If $CheckNewVersion == '2' Then $now = 'w' & Round(@YDAY / 7) 1773 | If $CheckNewVersion == '3' Then $now = 'm' & @MON 1774 | If $tag[0] <> $now Or UBound($tag) <> 2 Then 1775 | ProgressSet(10, $urlUpdate) 1776 | $foo = _Run('latest', '"' & $toolsDir & 'curl" -s -k --ssl-no-revoke -D - "' & $urlUpdate & '"', $STDERR_CHILD + $STDOUT_CHILD + $STDERR_MERGED) 1777 | $output = _readAll($foo, 'latest') 1778 | ProgressSet(90, '') 1779 | $url = _StringBetween2($output, "Location: ", @CRLF) 1780 | $tag = '' 1781 | If StringInStr($url, '/tag/') Then 1782 | $tag = _StringExplode($url, '/tag/', 1)[1] 1783 | EndIf 1784 | $tag = $now & '|' & $tag 1785 | IniWrite($IniUser, "State", 'LastVersion', $tag) 1786 | $tag = _StringExplode($tag, '|', 1) 1787 | EndIf 1788 | If $tag[1] <> $ProgramVersion Then 1789 | Return $tag[1] 1790 | EndIf 1791 | EndIf 1792 | Return False 1793 | EndFunc ;==>_checkNewVersion 1794 | 1795 | Func _checkUpdate() 1796 | ProgressOn($strCheckUpdate, $strPlayStore) 1797 | $out = $strPlayStore & ':' & @CRLF 1798 | $url1 = $playStoreUrl & $apk_PkgName 1799 | $foo = _Run($strPlayStore, '"' & $toolsDir & 'curl" -s -k --ssl-no-revoke -L -A "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0" "' & $url1 & '"', $STDERR_CHILD + $STDOUT_CHILD + $STDERR_MERGED) 1800 | ProgressSet(20) 1801 | $output = _readAll($foo, $strPlayStore) 1802 | ProgressSet(30) 1803 | ;MsgBox(0, $url1, $output) 1804 | $ver = StringRegExp($output, 'Current Version([^<]*?)', $STR_REGEXPARRAYMATCH) 1805 | If @error == 0 Then 1806 | $ver = StringStripWS($ver[0], $STR_STRIPLEADING + $STR_STRIPTRAILING) 1807 | If $ver <> $apk_Version And $ver <> 'Varies with device' Then $ver = $ver & ' <--- ' & $strNewVersionIsAvailable 1808 | Else 1809 | $ver = 'error: ' & @error 1810 | If StringInStr($output, 'Not Found') Then $ver = $strNotFound 1811 | EndIf 1812 | $out = $out & $ver & @CRLF 1813 | 1814 | $out = $out & @CRLF & $strApkPure & ':' & @CRLF 1815 | ProgressSet(50, '', $strApkPure) 1816 | $url2 = $apkPureUrl & $apk_PkgName 1817 | $foo = _Run($strApkPure, '"' & $toolsDir & 'curl" -s -k --ssl-no-revoke -L -A "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0" "' & $url2 & '"', $STDERR_CHILD + $STDOUT_CHILD + $STDERR_MERGED) 1818 | ProgressSet(70) 1819 | $output = _readAll($foo, $strApkPure) 1820 | ProgressSet(80) 1821 | ;MsgBox(0, $url2, $output) 1822 | ;MsgBox(0, $url2, StringRight($output, 2000)) 1823 | $ver = StringRegExp($output, "version_name: '([^']*?)'", $STR_REGEXPARRAYMATCH) 1824 | If @error == 0 Then 1825 | $ver = StringStripWS($ver[0], $STR_STRIPLEADING + $STR_STRIPTRAILING) 1826 | If $ver <> $apk_Version Then $ver = $ver & ' <--- ' & $strNewVersionIsAvailable 1827 | Else 1828 | $ver = 'error: ' & @error 1829 | If StringInStr($output, '404') Then $ver = $strNotFound 1830 | EndIf 1831 | $out = $out & $ver & @CRLF 1832 | 1833 | If Not StringInStr($out, $strNewVersionIsAvailable) Then $out = $strNoUpdatesFound & @CRLF & @CRLF & $out 1834 | 1835 | $out = $out & @CRLF & $strYes & ' = ' & $strPlayStore & @CRLF & $strNo & ' = ' & $strApkPure 1836 | 1837 | ProgressOff() 1838 | $ret = MsgBox($MB_ICONINFORMATION + $MB_YESNOCANCEL, $strCheckUpdate, $out) 1839 | If $ret == $IDYES Then ShellExecute($URLPlayStore & $apk_PkgName & '&hl=' & $PlayStoreLanguage) 1840 | If $ret == $IDNO Then ShellExecute($url2) 1841 | EndFunc ;==>_checkUpdate 1842 | 1843 | Func _Lib_IntToFloat($iInt) 1844 | Local $tFloat, $tInt 1845 | 1846 | $tInt = DllStructCreate("int") 1847 | $tFloat = DllStructCreate("float", DllStructGetPtr($tInt)) 1848 | DllStructSetData($tInt, 1, $iInt) 1849 | Return DllStructGetData($tFloat, 1) 1850 | EndFunc ;==>_Lib_IntToFloat 1851 | --------------------------------------------------------------------------------