├── APK-Info.au3 ├── APK-Info.ico ├── README.md ├── _config.yml └── ui.jpg /APK-Info.au3: -------------------------------------------------------------------------------- 1 | #Region ;**** 参数创建于 ACNWrapper_GUI **** 2 | #PRE_Icon=APK-Info.ico 3 | #PRE_Outfile=APK-Info.exe 4 | #PRE_Compression=3 5 | #PRE_UseX64=n 6 | #PRE_Res_Comment=haikejishu 7 | #PRE_Res_Description=APK-Info 8 | #PRE_Res_Fileversion=0.4.0.3 9 | #PRE_Res_Fileversion_AutoIncrement=p 10 | #PRE_Res_LegalCopyright=haikejishu 11 | #PRE_Res_requestedExecutionLevel=None 12 | #PRE_Run_Tidy=y 13 | #EndRegion ;**** 参数创建于 ACNWrapper_GUI **** 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | Opt("TrayMenuMode", 1) 26 | Opt("TrayIconHide", 1) 27 | 28 | Global $apkApplication, $apkVersionName, $apkVersionCode, $apkPkgName 29 | Global $apkMinSDK, $apkMinSDKVer, $apkMinSDKName, $apkTargetSDK, $apkTargetSDKVer, $apkTargetSDKName 30 | Global $apkScreens, $apkDensities, $apkPermissions, $apkFeatures 31 | Global $md5Txt, $sCurrentName, $sNewName 32 | Global $fullPathAPK, $dirAPK, $tmpFilename 33 | Global $sMinAndroidString, $sTgtAndroidString, $apkIconName, $apkIconPath 34 | 35 | If $CmdLine[0] > 0 Then 36 | $tmpFilename = $CmdLine[1] 37 | Else 38 | $tmpFilename = "" 39 | EndIf 40 | 41 | $tempPath = @TempDir & "\APK-Info" 42 | _parseApk() 43 | 44 | ;================== GUI =========================== 45 | 46 | $hGUI = GUICreate("APK-Info v1.1.1", 400, 494) 47 | $hLblApplication = GUICtrlCreateLabel("Application", 8, 12, 78, 17) 48 | $hLblVersion = GUICtrlCreateLabel("Version Name", 8, 36, 78, 17) 49 | $hLblVersionCode = GUICtrlCreateLabel("Version Code", 8, 60, 78, 17) 50 | $hLblPackage = GUICtrlCreateLabel("Package Name", 8, 84, 78, 17) 51 | $hLblMinSDK = GUICtrlCreateLabel("Min. SDK", 8, 108, 78, 17) 52 | $hLblTargetSDK = GUICtrlCreateLabel("Target SDK", 8, 132, 78, 17) 53 | $hLblScreenSizes = GUICtrlCreateLabel("Screen Sizes", 8, 156, 78, 17) 54 | $hLblResolutions = GUICtrlCreateLabel("Resolutions", 8, 180, 78, 17) 55 | $hInputApplication = GUICtrlCreateInput($apkApplication, 88, 9, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 56 | $hInputVersionName = GUICtrlCreateInput($apkVersionName, 88, 33, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 57 | $hInputVersionCode = GUICtrlCreateInput($apkVersionCode, 88, 57, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 58 | $hInputPkgName = GUICtrlCreateInput($apkPkgName, 88, 81, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 59 | $hInputMinSDK = GUICtrlCreateInput($apkMinSDK, 88, 105, 20, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 60 | $hInputMinAndroidString = GUICtrlCreateInput($sMinAndroidString, 110, 105, 198, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 61 | $hInputTargetSDK = GUICtrlCreateInput($apkTargetSDK, 88, 129, 20, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 62 | $hInputTgtAndroidString = GUICtrlCreateInput($sTgtAndroidString, 110, 129, 198, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 63 | $hInputScreens = GUICtrlCreateInput($apkScreens, 88, 153, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 64 | $hInputDensities = GUICtrlCreateInput($apkDensities, 88, 177, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 65 | $hLblPermissions = GUICtrlCreateLabel("Permissions", 8, 208, 78, 17) 66 | $hEditPermissions = GUICtrlCreateEdit($apkPermissions, 88, 205, 220, 80, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $WS_VSCROLL, $ES_WANTRETURN)) 67 | $hLblFeatures = GUICtrlCreateLabel("Features", 8, 301, 78, 17) 68 | $hEditFeatures = GUICtrlCreateEdit($apkFeatures, 88, 298, 220, 60, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $WS_VSCROLL, $ES_WANTRETURN)) 69 | $hLblMd5 = GUICtrlCreateLabel("Apk Md5", 8, 370, 78, 17) 70 | $hInputMd5 = GUICtrlCreateInput($md5Txt, 88, 367, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 71 | $hLblCurrentName = GUICtrlCreateLabel("Current Name", 8, 400, 78, 17) 72 | $hInputCurrentName = GUICtrlCreateInput($sCurrentName, 88, 397, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 73 | $hLblNewName = GUICtrlCreateLabel("New Name", 8, 428, 78, 17) 74 | $hInputNewName = GUICtrlCreateInput($sNewName, 88, 425, 220, 20, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY)) 75 | $hBtnSource = GUICtrlCreateButton("Github", 8, 460, 80) 76 | $hBtnRename = GUICtrlCreateButton("Rename File", 313, 422, 80) 77 | $hBtnExit = GUICtrlCreateButton("Exit", 313, 460, 80) 78 | $hBtnOpen = GUICtrlCreateButton("Open", 313, 90, 80) 79 | 80 | GUICtrlSetDefBkColor(0xF0F0F0, $hGUI) 81 | _GDIPlus_Startup() 82 | $hImage = _GDIPlus_ImageLoadFromFile($tempPath & "\" & $apkIconName) 83 | $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) 84 | $hBitmap = _GDIPlus_BitmapCreateFromGraphics(48, 48, $hGraphic) 85 | $hGfxCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) 86 | _GDIPlus_GraphicsClear($hGfxCtxt, 0xFFF0F0F0) 87 | GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT") 88 | GUISetState(@SW_SHOW) 89 | 90 | ;==================== End GUI ===================================== 91 | 92 | While 1 93 | $nMsg = GUIGetMsg() 94 | Switch $nMsg 95 | Case $hBtnSource 96 | _openSource() 97 | 98 | Case $hBtnRename 99 | $sNewNameInput = InputBox("Rename APK File", "New APK Filename:", $sNewName, "", 300, 130) 100 | If $sNewNameInput <> "" Then _renameAPK($sNewName) 101 | 102 | Case $hBtnExit 103 | _cleanUp() 104 | ExitLoop 105 | 106 | Case $GUI_EVENT_CLOSE 107 | _cleanUp() 108 | ExitLoop 109 | 110 | Case $hBtnOpen 111 | _cleanUp() 112 | _setEmpty() 113 | _parseApk() 114 | _setData() 115 | EndSwitch 116 | WEnd 117 | 118 | ; Clean up resources 119 | _GDIPlus_ImageDispose($hImage) 120 | _GDIPlus_BitmapDispose($hBitmap) 121 | _GDIPlus_GraphicsDispose($hGraphic) 122 | _GDIPlus_GraphicsDispose($hGfxCtxt) 123 | _GDIPlus_Shutdown() 124 | Exit 125 | 126 | Func _setEmpty() 127 | GUICtrlSetData($hInputApplication, "") 128 | GUICtrlSetData($hInputVersionName, "") 129 | GUICtrlSetData($hInputVersionCode, "") 130 | GUICtrlSetData($hInputPkgName, "") 131 | GUICtrlSetData($hInputMinSDK, "") 132 | GUICtrlSetData($hInputMinAndroidString, "") 133 | GUICtrlSetData($hInputTargetSDK, "") 134 | GUICtrlSetData($hInputTgtAndroidString, "") 135 | GUICtrlSetData($hInputScreens, "") 136 | GUICtrlSetData($hInputDensities, "") 137 | GUICtrlSetData($hInputCurrentName, "") 138 | GUICtrlSetData($hInputNewName, "") 139 | GUICtrlSetData($hInputMd5, "") 140 | GUICtrlSetData($hEditPermissions, "") 141 | GUICtrlSetData($hEditFeatures, "") 142 | EndFunc ;==>_setEmpty 143 | 144 | Func _setData() 145 | GUICtrlSetData($hInputApplication, $apkApplication) 146 | GUICtrlSetData($hInputVersionName, $apkVersionName) 147 | GUICtrlSetData($hInputVersionCode, $apkVersionCode) 148 | GUICtrlSetData($hInputPkgName, $apkPkgName) 149 | GUICtrlSetData($hInputMinSDK, $apkMinSDK) 150 | GUICtrlSetData($hInputMinAndroidString, $sMinAndroidString) 151 | GUICtrlSetData($hInputTargetSDK, $apkTargetSDK) 152 | GUICtrlSetData($hInputTgtAndroidString, $sTgtAndroidString) 153 | GUICtrlSetData($hInputScreens, $apkScreens) 154 | GUICtrlSetData($hInputDensities, $apkDensities) 155 | GUICtrlSetData($hInputCurrentName, $sCurrentName) 156 | GUICtrlSetData($hInputNewName, $sNewName) 157 | GUICtrlSetData($hInputMd5, $md5Txt) 158 | GUICtrlSetData($hEditPermissions, $apkPermissions) 159 | GUICtrlSetData($hEditFeatures, $apkFeatures) 160 | $hImage = _GDIPlus_ImageLoadFromFile($tempPath & "\" & $apkIconName) 161 | _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 330, 20, 48, 48) 162 | EndFunc ;==>_setData 163 | 164 | Func _parseApk() 165 | $fullPathAPK = _checkFileParameter($tmpFilename) 166 | $dirAPK = _SplitPath($fullPathAPK, True) 167 | $sCurrentName = _SplitPath($fullPathAPK, False) 168 | $tmpArrBadge = _getBadge($fullPathAPK) 169 | _parseLines($tmpArrBadge) 170 | _extractIcon($fullPathAPK, $apkIconPath) 171 | If $apkMinSDKVer <> "" Then $sMinAndroidString = 'Android ' & $apkMinSDKVer & ' / ' & $apkMinSDKName 172 | If $apkTargetSDKVer <> "" Then $sTgtAndroidString = 'Android ' & $apkTargetSDKVer & ' / ' & $apkTargetSDKName 173 | $sNewName = StringReplace($apkApplication, " ", " ") & "_" & StringReplace($apkVersionName, " ", " ") & ".apk" 174 | EndFunc ;==>_parseApk 175 | 176 | ; Draw PNG image 177 | Func MY_WM_PAINT($hWnd, $msg, $wParam, $lParam) 178 | _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) 179 | _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 330, 20, 48, 48) 180 | _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) 181 | Return $GUI_RUNDEFMSG 182 | EndFunc ;==>MY_WM_PAINT 183 | 184 | Func _renameAPK($prmNewFilenameAPK) 185 | $result = FileMove($fullPathAPK, $dirAPK & "\" & $sNewName) 186 | If $result <> 1 Then MsgBox(0, "Error!", "APK File could not be renamed.") 187 | EndFunc ;==>_renameAPK 188 | 189 | Func _SplitPath($prmFullPath, $prmReturnDir = False) 190 | $posSlash = StringInStr($prmFullPath, "\", 0, -1) 191 | Switch $prmReturnDir 192 | Case False 193 | Return StringMid($prmFullPath, $posSlash + 1) 194 | Case True 195 | Return StringLeft($prmFullPath, $posSlash - 1) 196 | EndSwitch 197 | EndFunc ;==>_SplitPath 198 | 199 | Func _checkFileParameter($prmFilename) 200 | If FileExists($prmFilename) Then 201 | Return $prmFilename 202 | Else 203 | $f_Sel = FileOpenDialog("Select APK file", @WorkingDir, "(*.apk)", 1, "") 204 | If @error Then Exit 205 | $md5Txt = StringTrimLeft(_Crypt_HashFile($f_Sel, $CALG_MD5), 2) 206 | Return $f_Sel 207 | EndIf 208 | EndFunc ;==>_checkFileParameter 209 | 210 | Func _getBadge($prmAPK) 211 | Local $foo = Run('aapt.exe d badging ' & '"' & $prmAPK & '"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) 212 | Local $output 213 | Local $line 214 | Local $tmp = "" 215 | While 1 216 | $line = StdoutRead($foo, False, True) 217 | If @error Then ExitLoop 218 | $tmp &= BinaryToString($line, 4) 219 | WEnd 220 | $output = $tmp 221 | 222 | $arrayLines = _StringExplode($output, @CRLF) 223 | Return $arrayLines 224 | EndFunc ;==>_getBadge 225 | 226 | Func _parseLines($prmArrayLines) 227 | For $line In $prmArrayLines 228 | $arraySplit = _StringExplode($line, ":", 1) 229 | If UBound($arraySplit) > 1 Then 230 | $key = $arraySplit[0] 231 | $value = $arraySplit[1] 232 | Else 233 | ContinueLoop 234 | EndIf 235 | 236 | Switch $key 237 | Case 'application' 238 | $tmpArr = _StringBetween($value, "label='", "'") 239 | $apkApplication = $tmpArr[0] 240 | $tmpArr = _StringBetween($value, "icon='", "'") 241 | $apkIconPath = $tmpArr[0] 242 | $tmpArr = _StringExplode($apkIconPath, "/") 243 | $apkIconName = $tmpArr[UBound($tmpArr) - 1] 244 | 245 | Case 'package' 246 | $tmpArr = _StringBetween($value, "name='", "'") 247 | $apkPkgName = $tmpArr[0] 248 | $tmpArr = _StringBetween($value, "versionCode='", "'") 249 | $apkVersionCode = $tmpArr[0] 250 | $tmpArr = _StringBetween($value, "versionName='", "'") 251 | $apkVersionName = $tmpArr[0] 252 | 253 | Case 'uses-permission' 254 | $tmpArr = _StringBetween($value, "'", "'") 255 | $apkPermissions &= StringLower(StringReplace($tmpArr[0], "android.permission.", "") & @CRLF) 256 | 257 | Case 'uses-feature' 258 | $tmpArr = _StringBetween($value, "'", "'") 259 | $apkFeatures &= StringLower(StringReplace($tmpArr[0], "android.hardware.", "") & @CRLF) 260 | 261 | Case 'sdkVersion' 262 | $tmpArr = _StringBetween($value, "'", "'") 263 | $apkMinSDK = $tmpArr[0] 264 | $apkMinSDKVer = _translateSDKLevel($apkMinSDK) 265 | $apkMinSDKName = _translateSDKLevel($apkMinSDK, True) 266 | 267 | Case 'targetSdkVersion' 268 | $tmpArr = _StringBetween($value, "'", "'") 269 | $apkTargetSDK = $tmpArr[0] 270 | $apkTargetSDKVer = _translateSDKLevel($apkTargetSDK) 271 | $apkTargetSDKName = _translateSDKLevel($apkTargetSDK, True) 272 | 273 | Case 'supports-screens' 274 | $apkScreens = StringStripWS(StringReplace($value, "'", ""), 3) 275 | 276 | Case 'densities' 277 | $apkDensities = StringStripWS(StringReplace($value, "'", ""), 3) 278 | 279 | EndSwitch 280 | Next 281 | EndFunc ;==>_parseLines 282 | 283 | Func _extractIcon($prmAPK, $prmIconPath) 284 | $runCmd = "unzip.exe -o -j -q " & '"' & $prmAPK & '" ' & $prmIconPath & " -d " & '"' & $tempPath & '"' 285 | ConsoleWrite($runCmd) 286 | RunWait($runCmd, @ScriptDir, @SW_HIDE) 287 | EndFunc ;==>_extractIcon 288 | 289 | Func _cleanUp() 290 | _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 330, 20, 48, 48) 291 | _GDIPlus_ImageDispose($hImage) 292 | FileDelete($tempPath & "\" & $apkIconName) 293 | DirRemove($tempPath) 294 | EndFunc ;==>_cleanUp 295 | 296 | Func _openSource() 297 | $url = 'https://github.com/haikejishu/APK-Info' 298 | ShellExecute($url) 299 | EndFunc ;==>_openSource 300 | 301 | Func _translateSDKLevel($prmSDKLevel, $prmReturnCodeName = False) 302 | 303 | Switch String($prmSDKLevel) 304 | ;You can see uses-sdk on "https://developer.android.com/guide/topics/manifest/uses-sdk-element.html" 305 | ;or "https://developer.android.com/reference/android/os/Build.VERSION_CODES.html" 306 | Case "38" 307 | $sVersion = "18" 308 | $sCodeName = "Android18" 309 | Case "37" 310 | $sVersion = "17" 311 | $sCodeName = "Android17" 312 | Case "36" 313 | $sVersion = "16" 314 | $sCodeName = "Android16" 315 | Case "35" 316 | $sVersion = "15" 317 | $sCodeName = "Vanilla Ice Cream" 318 | Case "34" 319 | $sVersion = "14" 320 | $sCodeName = "Upside Down Cake" 321 | Case "33" 322 | $sVersion = "13" 323 | $sCodeName = "Tiramisu" 324 | Case "32" 325 | $sVersion = "12L" 326 | $sCodeName = "Snow Cone V2" 327 | Case "31" 328 | $sVersion = "12" 329 | $sCodeName = "Snow Cone" 330 | Case "30" 331 | $sVersion = "11" 332 | $sCodeName = "Red Velvet Cake" 333 | Case "29" 334 | $sVersion = "10" 335 | $sCodeName = "Quince Tart" 336 | Case "28" 337 | $sVersion = "9" 338 | $sCodeName = "Pie" 339 | Case "27" 340 | $sVersion = "8.1.0" 341 | $sCodeName = "Oreo MR1" 342 | Case "26" 343 | $sVersion = "8.0.0" 344 | $sCodeName = "Oreo" 345 | Case "25" 346 | $sVersion = "7.1" 347 | $sCodeName = "Nougat MR1" 348 | Case "24" 349 | $sVersion = "7.0" 350 | $sCodeName = "Nougat" 351 | Case "23" 352 | $sVersion = "6.0" 353 | $sCodeName = "Marshmallow" 354 | Case "22" 355 | $sVersion = "5.1" 356 | $sCodeName = "Lollipop MR1" 357 | Case "21" 358 | $sVersion = "5.0" 359 | $sCodeName = "Lollipop" 360 | Case "20" 361 | $sVersion = "4.4W" 362 | $sCodeName = "Kitkat Watch" 363 | Case "19" 364 | $sVersion = "4.4" 365 | $sCodeName = "KitKat" 366 | Case "18" 367 | $sVersion = "4.3" 368 | $sCodeName = "Jelly Bean MR2" 369 | Case "17" 370 | $sVersion = "4.2.x" 371 | $sCodeName = "Jelly Bean MR1" 372 | Case "16" 373 | $sVersion = "4.1.x" 374 | $sCodeName = "Jelly Bean" 375 | Case "15" 376 | $sVersion = "4.0.3-4" 377 | $sCodeName = "Ice Cream Sandwich MR1" 378 | Case "14" 379 | $sVersion = "4.0.0-2" 380 | $sCodeName = "Ice Cream Sandwich" 381 | Case "13" 382 | $sVersion = "3.2" 383 | $sCodeName = "Honeycomb MR2" 384 | Case "12" 385 | $sVersion = "3.1.x" 386 | $sCodeName = "Honeycomb MR1" 387 | Case "11" 388 | $sVersion = "3.0.x" 389 | $sCodeName = "Honeycomb" 390 | Case "10" 391 | $sVersion = "2.3.3-4" 392 | $sCodeName = "Gingerbread MR1" 393 | Case "9" 394 | $sVersion = "2.3.0-2" 395 | $sCodeName = "Gingerbread" 396 | Case "8" 397 | $sVersion = "2.2.x" 398 | $sCodeName = "Froyo" 399 | Case "7" 400 | $sVersion = "2.1.x" 401 | $sCodeName = "Eclair MR1" 402 | Case "6" 403 | $sVersion = "2.0.1" 404 | $sCodeName = "Eclair 01" 405 | Case "5" 406 | $sVersion = "2.0" 407 | $sCodeName = "Eclair" 408 | Case "4" 409 | $sVersion = "1.6" 410 | $sCodeName = "Donut" 411 | Case "3" 412 | $sVersion = "1.5" 413 | $sCodeName = "Cupcake" 414 | Case "2" 415 | $sVersion = "1.1" 416 | $sCodeName = "Base 11" 417 | Case "1" 418 | $sVersion = "1.0" 419 | $sCodeName = "Base" 420 | Case "10000" 421 | $sVersion = "Cur_Dev" 422 | $sCodeName = "Current Dev. Build" 423 | Case Else 424 | $sVersion = "Unknown" 425 | $sCodeName = "Unknown" 426 | EndSwitch 427 | 428 | Switch $prmReturnCodeName 429 | Case True 430 | Return $sCodeName 431 | Case Else 432 | Return $sVersion 433 | EndSwitch 434 | EndFunc ;==>_translateSDKLevel 435 | -------------------------------------------------------------------------------- /APK-Info.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haikejishu/APK-Info/4d37213f43c5b8acf7cc1b32a4c4a77d4573b488/APK-Info.ico -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # APK-Info 2 | 3 | ## 介绍 4 | APK-Info 为一款在 windows 下查看 apk 信息的小工具. 5 | 6 | 7 | ## 功能 8 | * 应用信息显示 9 | * 应用 md5 显示 10 | * 支持中文应用名 11 | 12 | ## 运行相关 13 | 仅在windows系统下运行,其他系统不支持. 14 | 15 | ## 开发语言 16 | au3 [http://www.autoitx.com/](http://www.autoitx.com/ "au3论坛") 17 | 18 | ## 其它 19 | - 如果你有好的建议或者发现bug,欢迎给我提 **issue**. 20 | - 如果该repo对大家有帮助,给个star鼓励鼓励吧. 21 | 22 | ## 界面展示 23 |
24 |

25 |
26 | 27 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /ui.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haikejishu/APK-Info/4d37213f43c5b8acf7cc1b32a4c4a77d4573b488/ui.jpg --------------------------------------------------------------------------------