Add files via upload

This commit is contained in:
Enyby authored and GitHub committed 2018-06-14 22:57:21 +03:00
1 parent ef08a51c32
commit 3045a04bb1
9 files changed
+1096

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
@ECHO OFF
ECHO APK-Info shell integration...
ECHO.
REG ADD "HKCR\.apk" /ve /t REG_SZ /d "APK-Info" /f >nul 2>nul
REG ADD "HKCR\APK-Info\DefaultIcon" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\"" /f >nul 2>nul
REG ADD "HKCR\APK-Info\shell\APKInfo" /ve /t REG_SZ /d "APK-Info" /f >nul 2>nul
REG ADD "HKCR\APK-Info\shell\APKInfo\command" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\" \"%%1\"" /f >nul 2>nul
REG ADD "HKCU\SOFTWARE\Classes\.apk" /ve /t REG_SZ /d "APK-Info" /f >nul 2>nul
REG ADD "HKCU\SOFTWARE\Classes\APK-Info\DefaultIcon" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\"" /f >nul 2>nul
REG ADD "HKCU\SOFTWARE\Classes\APK-Info\shell\APKInfo" /ve /t REG_SZ /d "APK-Info" /f >nul 2>nul
REG ADD "HKCU\SOFTWARE\Classes\APK-Info\shell\APKInfo\command" /ve /t REG_SZ /d "\"%cd%\APK-Info.exe\" \"%%1\"" /f >nul 2>nul
ECHO APK-Info shell integration completed!
ECHO.
ECHO.
ECHO **** Press any key to exit ****
pause > NUL
BIN
View File
Binary file not shown.
+556
View File
@@ -0,0 +1,556 @@
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=APK-Info.ico
#AutoIt3Wrapper_UseAnsi=n
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=Shows info about Android Package Files (APK)
#AutoIt3Wrapper_Res_Description=APK-Info
#AutoIt3Wrapper_Res_Fileversion=1.14.0.0
#AutoIt3Wrapper_Res_LegalCopyright=zoster
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#pragma compile(AutoItExecuteAllowed True)
#include <Constants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WinAPIShPath.au3>
#include <Array.au3>
#include <String.au3>
Opt("TrayMenuMode",1)
Opt("TrayIconHide",1)
; Adding the directives below, will cause your program be compiled with the indexing
; of the original lines shown in SciTE:
#AutoIt3Wrapper_Run_Before=ShowOriginalLine.exe %in%
#AutoIt3Wrapper_Run_After=ShowOriginalLine.exe %in%
Global $apk_Label, $apk_IconPath, $apk_IconName, $apk_PkgName, $apk_VersionCode, $apk_VersionName
Global $apk_Permissions, $apk_Features, $hGraphic, $hImage, $hImage_original, $apk_MinSDK, $apk_MinSDKVer, $apk_MinSDKName
Global $apk_TargetSDK, $apk_TargetSDKVer, $apk_TargetSDKName, $apk_Screens, $apk_Densities, $apk_ABIs, $apk_Signature
Global $tempPath = @TempDir & "\APK-Info\" & @AutoItPID
Global $Inidir, $ProgramVersion, $ProgramReleaseDate, $ForceGUILanguage
Global $IniProgramSettings, $IniLogReport, $IniLastFolderSettings
Global $tmpArrBadge, $tmp_Filename, $dirAPK, $fileAPK,$fullPathAPK
Global $sNewFilenameAPK
$IniProgramSettings="APK-Info.ini"
$IniLastFolderSettings="APK-Info.LastFolder.ini"
$IniLogReport="APK-Info.log.txt"
; $aCmdLine[0] = number of parametrs passed to exe file
; $aCmdLine[1] = first parameter (optional) passed to exe file (apk file name)
; https://www.autoitscript.com/autoit3/docs/intro/running.htm
; An alternative to the limitation of $CmdLine[] only being able to return a maximum of 63 parameters.
Local $aCmdLine = _WinAPI_CommandLineToArgv($CmdLineRaw)
; Uncomment it to Show all cmdline parameters
;_ArrayDisplay($aCmdLine)
$Inidir= @ScriptDir & "\"
;$ProgramVersion=Iniread ($Inidir & $IniProgramSettings, "Settings", "ProgramVersion", "0.7Q");
;$ProgramReleaseDate=Iniread ($Inidir & $IniProgramSettings, "Settings", "ProgramReleaseDate", "01.06.2017");
$ProgramVersion="1.14";
$ProgramReleaseDate="14.06.2018";
$ForcedGUILanguage=Iniread ($Inidir & $IniProgramSettings, "Settings", "ForcedGUILanguage", "auto");
; Check OS language
$OS_language=@OSLang
; more info on country code
; https://www.autoitscript.com/autoit3/docs/appendix/OSLangCodes.htm
$ForcedGUILanguage=Iniread ($Inidir & $IniProgramSettings, "Settings", "ForcedGUILanguage", "auto");
$OSLanguageCode=@OSLang
IF $ForcedGUILanguage = "auto" then
$Language_code=Iniread ($Inidir & $IniProgramSettings, "OSLanguage", @OSLang, "en");
Else
$Language_code=$ForcedGUILanguage
EndIf
$ShowLog=Iniread ($Inidir & $IniProgramSettings, "Settings", "ShowLog", "0");
$ShowLangCode=Iniread ($Inidir & $IniProgramSettings, "Settings", "ShowLangCode", "1");
; $ShowCmdLine=Iniread($Inidir & $IniProgramSettings,"Settings","ShowCmdLine","1");
$FileNamePrefix=Iniread ($Inidir & $IniProgramSettings, "Settings", "FileNamePrefix", "");
If $FileNamePrefix="" Then $FileNamePrefix=" "
$FileNameSuffix=Iniread ($Inidir & $IniProgramSettings, "Settings", "FileNameSuffix", "");
If $FileNameSuffix="" Then $FileNameSuffix="."
$FileNameSpace=Iniread ($Inidir & $IniProgramSettings, "Settings", "FileNameSpace", "");
If $FileNameSpace="" Then $FileNameSpace=" "
$Lastfolder=Iniread($Inidir & $IniLastFolderSettings,"Settings","LastFolder",@WorkingDir);
$String01=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String01", "Application")
$String02=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String02", "Version")
$String03=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String03", "Version Code")
$String04=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String04", "Package")
$String05=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String05", "Min. SDK")
$String06=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String06", "Traget SDK")
$String07=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String07", "Screen Size")
$String08=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String08", "Resolution")
$String09=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String09", "Permission")
$String10=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String10", "Feature")
$String11=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String11", "Current name")
$String12=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String12", "New name")
$String13=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String13", "Play Store")
$String14=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String14", "Rename File")
$String15=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String15", "Exit")
$String16=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String16", "Rename APK File")
$String17=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String17", "New APK Filename")
$String18=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String18", "Error!")
$String19=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String19", "APK File could not be renamed.")
$String20=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String20", "Select APK file")
$String21=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String21", "Cur_Dev")
$String22=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String22", "Current Dev. Build")
$String23=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String23", "Unknown")
$String24=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String24", "Unknown")
$String25=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String25", "Browse")
$String26=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String26", "OS Lang Code")
$String27=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String27", "Lang Name")
$String28=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String28", "ABIs")
$String29=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String29", "Signature")
$String30=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "String30", "Debug")
$URLPlayStore=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "URLPlaystore", "https://play.google.com/store/apps/details?id=")
$PlayStoreLanguage=Iniread ($Inidir & $IniProgramSettings, "Strings-" & $Language_code, "PlayStoreLanguage", "en")
Dim $sMinAndroidString, $sTgtAndroidString
Global $apk_Build = ''
;================== GUI ===========================
$ProgramTitle="APK-Info " & $ProgramVersion & " (" & $ProgramReleaseDate & ")"
; iF $ShowLangCode="1" then
; $ProgramTitle=$ProgramTitle & "- OSLangCode = " & $OSLanguageCode & " - Lang = " & $Language_code
; Endif
If $ShowLog="1" then
IniWrite($Inidir & $IniLogReport, "APK_Info Version", "Program version", $ProgramVersion);
IniWrite($Inidir & $IniLogReport, "APK_Info Version", "Program release date", $ProgramReleaseDate);
IniWrite($Inidir & $IniLogReport, "Language", "OSLanguage", @OSLang);
IniWrite($Inidir & $IniLogReport, "Language", "OSLanguage", @OSLang);
IniWrite($Inidir & $IniLogReport, "Language", "OSLanguage", @OSLang);
IniWrite($Inidir & $IniLogReport, "Language", "ForcedLanguage", $ForcedGUILanguage);
IniWrite($Inidir & $IniLogReport, "IniFile", "IniFileFolderPath", $Inidir);
IniWrite($Inidir & $IniLogReport, "IniFile", "IniFileProgramSettings", $IniProgramSettings);
IniWrite($Inidir & $IniLogReport, "IniFile", "IniFileGuiSettings", $IniProgramSettings);
IniDelete($Inidir & $IniLogReport, "IniFile", "FileNamePrefix");
IniWrite($Inidir & $IniLogReport, "IniFile", "FileNamePrefix", $FileNamePrefix);
IniDelete($Inidir & $IniLogReport, "IniFile", "FileNameSuffix");
IniWrite($Inidir & $IniLogReport, "IniFile", "FileNameSuffix", $FileNameSuffix);
; Cleanup not defined variables
IniWrite($Inidir & $IniLogReport, "Icon", "TempFilePath", "");
IniWrite($Inidir & $IniLogReport, "Icon", "ApkIconeName", "");
IniWrite($Inidir & $IniLogReport, "NewFile", "NewFilenameAPK", "");
IniWrite($Inidir & $IniLogReport, "NewFile", "NewNameInput", "");
IniWrite($Inidir & $IniLogReport, "OpenNewFile", "LastFileName", "");
IniWrite($Inidir & $IniLogReport, "OpenNewFile", "TempFileName", "");
Endif
iF $aCmdLine[0]=0 And $ShowLog="1" then
IniWrite($Inidir & $IniLogReport, "CommandLine", "Parameter1", $aCmdLine[0]);
IniWrite($Inidir & $IniLogReport, "CommandLine", "Parameter2", "");
; Else
; IniWrite($Inidir & $IniLogReport, "CommandLine", "Parameter1", $aCmdLine[0]);
; IniWrite($Inidir & $IniLogReport, "CommandLine", "Parameter2", $aCmdLine[1]);
Endif
$fieldHeight = 24;
$bigFieldHeight = 93;
$labelStart = 8;
$labelWidth = 100;
$labelHeight = 20;
$labelTop = 3;
$inputStart = 125;
$inputWidth = 300;
$inputHeight = 20;
$inputFlags = BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY);
$editHeight = 85;
$editFlags = BitOR($ES_READONLY,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$WS_VSCROLL,$ES_WANTRETURN);
$offsetHeight = 9;
$rightColumnWidth = 100;
$rightColumnStart = $inputStart + $inputWidth + 10;
$fullWidth = $rightColumnStart + $rightColumnWidth + 10;
$fullHeight = $offsetHeight + $fieldHeight*11 + $bigFieldHeight*3 + 50;
$btnWidth = $fullWidth/3 - 20;
$hGUI = GUICreate($ProgramTitle, $fullWidth, $fullHeight, -1, -1, -1, $WS_EX_ACCEPTFILES)
GUICtrlCreateLabel("", 0, 0, $fullWidth, $fullHeight, $WS_CLIPSIBLINGS); // for accept drag & drop
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
;GUICtrlSetBkColor(-1, $COLOR_RED)
$globalStyle = $GUI_DROPACCEPTED + $GUI_ONTOP
$globalInputStyle = $GUI_ONTOP
$Input1 = _makeField($String01, $apk_Label, False, 0)
$Input2 = _makeField($String02, $apk_VersionName, False, 0)
$Input3 = _makeField($String03, $apk_VersionCode & $apk_Build, False, 0)
$Input4 = _makeField($String04, $apk_PkgName, False, 0)
$Input6 = GUICtrlCreateInput($sMinAndroidString, 150, $offsetHeight, 275, $inputHeight, $inputFlags)
GUICtrlSetState(-1, $globalInputStyle)
$Input5 = _makeField($String05, $apk_MinSDK, False, 20)
$Input8 = GUICtrlCreateInput($sTgtAndroidString, 150, $offsetHeight, 275, $inputHeight, $inputFlags)
GUICtrlSetState(-1, $globalInputStyle)
$Input7 = _makeField($String06, $apk_TargetSDK, False, 20)
$Input9 = _makeField($String07, $apk_Screens, False, 0)
$Input10 = _makeField($String08, $apk_Densities, False, 0)
$Input13 = _makeField($String28, $apk_ABIs, False, 0)
$Edit1 = _makeField($String09, $apk_Permissions, True, 0)
$Edit2 = _makeField($String10, $apk_Features, True, 0)
$Edit3 = _makeField($String29, $apk_Signature, True, 0)
$Input11 = _makeField($String11, $fileAPK, False, 0)
$Input12 = _makeField($String12, $sNewFilenameAPK, False, 0)
; Show OS language and language code
IF $ShowLangCode="1" Then
GUICtrlCreateLabel($String26, $rightColumnStart, 84, $rightColumnWidth, $labelHeight, $SS_CENTER)
GUICtrlSetState(-1, $globalStyle)
GUICtrlCreateLabel($OSLanguageCode, $rightColumnStart, 108, $rightColumnWidth, $labelHeight, $SS_CENTER)
GUICtrlSetState(-1, $globalStyle)
GUICtrlCreateLabel($String27, $rightColumnStart, 156, $rightColumnWidth, $labelHeight, $SS_CENTER)
GUICtrlSetState(-1, $globalStyle)
GUICtrlCreateLabel($Language_code, $rightColumnStart, 180, $rightColumnWidth, $labelHeight, $SS_CENTER)
GUICtrlSetState(-1, $globalStyle)
;GUICtrlCreateLabel($sPadSpace, 455, 228, 100, 20)
;GUICtrlSetState(-1, $globalStyle)
Endif
$offsetHeight += 11; // buttons row gap
; Button Play / Rename / Exit
$offsetWidth = 10;
$gBtn_Play = _makeButton($String13)
$gBtn_Rename = _makeButton($String14)
$gBtn_Exit = _makeButton($String15)
_GDIPlus_StartUp()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$defBkColor = 0
If $aCmdLine[0] > 0 Then
$tmp_Filename = $aCmdLine[1]
Else
$tmp_Filename = ""
EndIf
_OpenNewFile($tmp_Filename)
GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $gBtn_Play
_openPlay()
Case $GUI_EVENT_DROPPED
_OpenNewFile(@GUI_DragFile)
MY_WM_PAINT(0, 0, 0, 0)
Case $gBtn_Rename
$sNewNameInput = InputBox($String16,$String17, $sNewFilenameAPK, "", 300, 130)
If $ShowLog = "1" then
IniWrite($Inidir & $IniLogReport, "NewFile", "NewFilenameAPK", $sNewFilenameAPK);
IniWrite($Inidir & $IniLogReport, "NewFile", "NewNameInput", $sNewNameInput);
Endif
If $sNewNameInput <> "" Then _renameAPK($sNewNameInput)
Case $gBtn_Exit
_cleanUp()
Exit
Case $GUI_EVENT_CLOSE
_cleanUp()
Exit
EndSwitch
WEnd
;==================== End GUI =====================================
Func _makeButton($value)
$ret = GUICtrlCreateButton($value, $offsetWidth, $offsetHeight, $btnWidth)
GUICtrlSetState(-1, $globalStyle)
$offsetWidth += $btnWidth + 20;
Return $ret
EndFunc
Func _makeField($label, $value, $isEdit, $width)
If $width == 0 Then
$width = $inputWidth
EndIf
GUICtrlCreateLabel($label, $labelStart, $offsetHeight + $labelTop, $labelWidth, $labelHeight)
GUICtrlSetState(-1, $globalStyle)
If $isEdit Then
$ret = GUICtrlCreateEdit($value, $inputStart, $offsetHeight, $inputWidth + 10 + $rightColumnWidth, $editHeight, $editFlags)
GUICtrlSetState(-1, $globalInputStyle)
$offsetHeight += $bigFieldHeight;
Else
$ret = GUICtrlCreateInput($value, $inputStart, $offsetHeight, $width, $inputHeight, $inputFlags)
GUICtrlSetState(-1, $globalInputStyle)
$offsetHeight += $fieldHeight;
EndIf
Return $ret
EndFunc
; Draw PNG image
Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
_WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW)
$s = 48
$x = $rightColumnStart + $rightColumnWidth/2 - $s/2
$y = 10
If $defBkColor == 0 Then
$hDC = _WinAPI_GetDC($hGUI)
$defBkColor = _WinAPI_GetPixel($hDC, $x + $s/2, $y + $s /2)
_WinAPI_ReleaseDC($hGUI, $hDC)
;$defBkColor = $COLOR_RED
$defBkColor = BitOR($defBkColor, 0xFF000000)
EndIf
$hBrush = _GDIPlus_BrushCreateSolid($defBkColor)
_GDIPlus_GraphicsFillRect($hGraphic, $x, $y, $s, $s, $hBrush)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, $x, $y)
_WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE)
Return $GUI_RUNDEFMSG
EndFunc
Func _renameAPK($prmNewFilenameAPK)
$result = FileMove($fullPathAPK, $dirAPK & "\" & $prmNewFilenameAPK)
; if result<> = error
If $result <> 1 Then MsgBox(0,$String18, $String19)
EndFunc
Func _SplitPath($prmFullPath, $prmReturnDir = false)
$posSlash = StringInStr($prmFullPath, "\", 0, -1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $posSlash = ' & $posSlash & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Switch $prmReturnDir
Case False
Return StringMid($prmFullPath, $posSlash + 1)
Case True
Return StringLeft($prmFullPath, $posSlash - 1)
EndSwitch
EndFunc
Func _checkFileParameter($prmFilename)
If FileExists($prmFilename) Then
Return $prmFilename
Else
$f_Sel = FileOpenDialog($String20, $Lastfolder, "(*.apk)", 1, "")
If @error Then Exit
$Lastfolder = _SplitPath($f_Sel, true)
IniWrite($Inidir & $IniLastFolderSettings, "Settings", "Lastfolder", $Lastfolder);
; IniWrite($Inidir & $IniProgramSettings, "Settings", "Lastfile", $f_sel);
Return $f_Sel
EndIf
EndFunc
Func _OpenNewFile($apk)
$fullPathAPK = _checkFileParameter($apk)
$dirAPK = _SplitPath($fullPathAPK,true)
$fileAPK = _SplitPath($fullPathAPK,false)
$apk_Build = ''
_getSignature($fullPathAPK)
$tmpArrBadge = _getBadge($fullPathAPK)
_parseLines($tmpArrBadge)
_extractIcon($fullPathAPK, $apk_IconPath)
If $apk_MinSDKVer <> "" Then $sMinAndroidString = 'Android ' & $apk_MinSDKVer & ' (' & $apk_MinSDKName & ')'
If $apk_TargetSDKVer <> "" Then $sTgtAndroidString = 'Android ' & $apk_TargetSDKVer & ' (' & $apk_TargetSDKName & ')'
$sNewFilenameAPK = StringReplace ($apk_Label, " ", $FileNameSpace) & $FileNamePrefix & StringReplace ($apk_VersionName, " ", $FileNameSpace) & $FileNameSuffix & StringReplace($apk_VersionCode, " ", $FileNameSpace) & ".apk"
GUICtrlSetData ($Input1 , $apk_Label)
GUICtrlSetData ($Input2 , $apk_VersionName)
GUICtrlSetData ($Input3 , $apk_VersionCode)
GUICtrlSetData ($Input4 , $apk_PkgName)
GUICtrlSetData ($Input5 , $apk_MinSDK )
GUICtrlSetData ($Input6 , $sMinAndroidString)
GUICtrlSetData ($Input7 , $apk_TargetSDK)
GUICtrlSetData ($Input8 , $sTgtAndroidString)
GUICtrlSetData ($Input9 , $apk_Screens)
GUICtrlSetData ($Input10, $apk_Densities)
GUICtrlSetData ($Input13, $apk_ABIs)
GUICtrlSetData ($Edit1 , $apk_Permissions)
GUICtrlSetData ($Edit2 , $apk_Features)
GUICtrlSetData ($Edit3 , $apk_Signature)
GUICtrlSetData ($Input11, $fileAPK)
GUICtrlSetData ($Input12, $sNewFilenameAPK)
_drawPNG()
EndFunc
Func _getSignature($prmAPK)
Local $foo = Run('java -jar apksigner.jar verify --v --print-certs ' & '"' & $prmAPK & '"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $output
While 1
$output &= StderrRead($foo)
If @error Then ExitLoop
Wend
While 1
$output &= StdoutRead($foo)
If @error Then ExitLoop
Wend
$apk_Signature = $output
EndFunc
Func _getBadge($prmAPK)
Local $foo = Run('aapt.exe d badging ' & '"' & $prmAPK & '"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $output
While 1
$output &= StdoutRead($foo)
If @error Then ExitLoop
Wend
$arrayLines = _StringExplode($output, @CRLF)
Return $arrayLines
EndFunc
Func _parseLines($prmArrayLines)
For $line in $prmArrayLines
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $line = ' & $line & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
If $line == 'application-debuggable' Then
$apk_Build = ' ' & $String30
EndIf
$arraySplit = _StringExplode($line, ":", 1)
If Ubound($arraySplit) > 1 Then
$key = $arraySplit[0]
$value = $arraySplit[1]
Else
ContinueLoop
EndIf
Switch $key
Case 'application'
$tmp_arr = _StringBetween($value, "label='", "'")
$apk_Label = $tmp_arr[0]
$tmp_arr = _StringBetween($value, "icon='", "'")
$apk_IconPath = $tmp_arr[0]
$tmp_arr = _StringExplode($apk_IconPath, "/")
$apk_IconName = $tmp_arr[UBound($tmp_arr)-1]
Case 'package'
$tmp_arr = _StringBetween($value, "name='", "'")
$apk_PkgName = $tmp_arr[0]
$tmp_arr = _StringBetween($value, "versionCode='", "'")
$apk_VersionCode = $tmp_arr[0]
$tmp_arr = _StringBetween($value, "versionName='", "'")
$apk_VersionName = $tmp_arr[0]
Case 'uses-permission'
$tmp_arr = _StringBetween($value, "'", "'")
$apk_Permissions &= StringLower(StringReplace($tmp_arr[0], "android.permission.", "") & @CRLF)
Case 'uses-feature'
$tmp_arr = _StringBetween($value, "'", "'")
$apk_Features &= StringLower(StringReplace($tmp_arr[0], "android.hardware.", "") & @CRLF)
Case 'sdkVersion'
$tmp_arr = _StringBetween($value, "'", "'")
$apk_MinSDK = $tmp_arr[0]
$apk_MinSDKVer = _translateSDKLevel($apk_MinSDK)
$apk_MinSDKName = _translateSDKLevel($apk_MinSDK, true)
Case 'targetSdkVersion'
$tmp_arr = _StringBetween($value, "'", "'")
$apk_TargetSDK = $tmp_arr[0]
$apk_TargetSDKVer = _translateSDKLevel($apk_TargetSDK)
$apk_TargetSDKName = _translateSDKLevel($apk_TargetSDK, true)
Case 'supports-screens'
$apk_Screens = StringStripWS(StringReplace($value, "'", ""),3)
Case 'densities'
$apk_Densities = StringStripWS(StringReplace($value, "'", ""),3)
Case 'native-code'
$apk_ABIs = StringStripWS(StringReplace($value, "'", ""),3)
EndSwitch
Next
EndFunc
Func _extractIcon($prmAPK, $prmIconPath)
DirCreate($tempPath)
$runCmd = "unzip.exe -o -j " & '"' & $prmAPK & '" ' & $prmIconPath & " -d " & '"' & $tempPath & '"'
RunWait($runCmd, @ScriptDir, @SW_HIDE)
EndFunc
Func _convertIcon($prmPNGPath)
;not used
$runCmd = 'convert.exe ' & '"' & $prmPNGPath & '"' & " -background #f0f0f0 -flatten -alpha off " & '"' & $tempPath & "\Icon.bmp" & '"'
RunWait($runCmd, @ScriptDir, @SW_HIDE)
EndFunc
Func _cleanUp()
_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
DirRemove($tempPath, 1); // clean own dir
DirRemove(@TempDir & "\APK-Info", 1); // clean files from previous runs
EndFunc
Func _openPlay()
$url = $URLPlayStore & $apk_PkgName & '&hl=' & $PlayStoreLanguage
ShellExecute($url)
EndFunc
Func _translateSDKLevel($prmSDKLevel, $prmReturnCodeName = false)
if $prmSDKLevel="1000" then
$sVersion=$String21
$sCodeName=$String22
Else
$sVersion=Iniread ($Inidir & $IniProgramSettings, "AndroidName", "SDK" & $prmSDKLevel & "-Version", $String23)
$sCodeName=Iniread ($Inidir & $IniProgramSettings, "AndroidName", "SDK" & $prmSDKLevel & "-CodeName", $String24)
Endif
Switch $prmReturnCodeName
Case true
Return $sCodeName
Case Else
Return $sVersion
EndSwitch
EndFunc
Func _drawPNG()
; Png Workaround
; Load PNG image
$filename = $tempPath & "\" & $apk_IconName;
$hImage_original = _GDIPlus_ImageLoadFromFile($filename)
If $ShowLog= "1" then
IniWrite($Inidir & $IniLogReport, "Icon", "TempFilePath", $tempPath);
IniWrite($Inidir & $IniLogReport, "Icon", "ApkIconeName", $apk_IconName);
Endif
; resize always the bigger icon to 48x48 pixels
If $hImage Then
_GDIPlus_ImageDispose($hImage)
EndIf
$hImage = _GDIPlus_ImageResize ($hImage_original, 48, 48)
_GDIPlus_ImageDispose($hImage_original)
FileDelete($filename); // no need - try delete
$type = VarGetType($hImage)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $type = ' & $type & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
EndFunc
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.
+227
View File
@@ -0,0 +1,227 @@
************************* APK-Info functionalities
- Support up to SDK23 (Marshamallow)- To add future SDK don't require program changes because is defined in external ini file.
- Multilanguage GUI (ca/de/en/fa/fr/hu/id/it/nl/pl/sk/sp/zh-cn). It's possible add new language without program change, but hust editing external INI file.
- Automatic recognition of OS language and set the right GUI language (en/fr/hu/id/it/pl/sk)
- Optiont in configuration file to force a specifc GUI language
- Optiont in configuration file to define pre and post filename characters
- Automatic log of the operation (that can be dsiabled via external ini file)
- Windows shell integration (optional)
************************** APK-Info Changelog
*** APK-Info 0.7B (22.09.2015)
- Update aapt (build tool)
- Multilanguage (show APK-Info.ini)
- Added option to select Prefix/suffix characters for file renaming (check APK-Info.ini)
- Added option to enable/disable show OSLangCode (for help in translation)
- If anyone want to show the program in specific language pelase edit english strings in APK-Info.ini and post here the specific language
*** APK-Info 0.7C (07.12.2015)
- Replace appt.exe with new version compatible with SDK23 (Android 6.x)
*** APK-Info 0.7D (08.12.2015
- Fixed problem about SK 21/22/23.
- Made also some changes to the app.
- The strings about program GUI are moved from APK-Info.ini to APK-Info-GUI-strings.ini
- The APK-Info.ini file now contain just program settings (and not strings)
- DI fixed the proble related to read FilenamePrefix/Suffix in APK.Info.ini.
- Added automatic sk language recognition.
- Fixed the problem about recognize SDK21/22/23 Androdi OS name.
* Problem not solved
- Recognize apk file name with chinese characters.
*** APK-Info 0.7E (09.12.2015)
- Solved problem recognizing KK (SDK 19).
- Increase Window width (for text space)
- Add option in APK.-Info.ini to enable special language not detecetd automatically
- Fix problem regarding batch run with APK-Info [PthtoINIfile] [APpFilename.apk]
- Add Slovak language file (thanks to Ja_som)
- Add French language file (thanks to Yoanf_26).
Note: The language file should be in UTF16 for special characters.
- Add program option in APK-Info.ini to show comamnd line paranmetrs.
More detail in Readme.txt text file.
*** APK-Info 0.7G (12.12.2015)
- Added hungarian strings (thanks to gidano)
- Change GUI strings name (APK-Info-GUI.ini). Text file format UTF16.
- 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.
- Add OS Language code detction table in APK-GUI.ini. Now to add a new language detection is not required change to program cdoe.
*** APK-Info 0.7H (18.12.2015)
- Fix problem about big icon (now is always max 48x48piexls)
- Fixed a problem regarding Browse command that didn't update filename
- Know problems
- Using special character (ex. japanese) for filename/app name are not supported
- Using browser command to load another apk, the icon didn't change.
- Added indonesian translation (thanks to exodius48)
*** APK-Info 0.7I (20.12.2015)
* Fix
- Fix rename function
* Improvements
- Enable use of new variable in APK-Info.ini. ShowLog=1 (default).
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)
ShowLog enables to save in APK-Info-Log.ini many info about variable use internally from the program/OS language info/path used etc.
* Know problem
- If you load a new file from Browse the icon remain unchanged.
- If the filename or app name use character like japanese are not supported.
**APK-Info 0.7K (23.01.2016)
- Added polish translation (thanks to Eselter).
**APK-Info 0.7L (29.01.2016)
- Added spanish language (thanks to Ksawery).
- Added chinese language (thanks to Li Guiquan).
*** APK-Info 0.7M (17.04.2016)
- Added Farsi language (thanks to HesamEdin).
- Added French language (thanks to Yoanf_26)
- Added German language (thanks to mosu)
- Updated aapt (Android Build Tool) to 23.0.3
*** APK-Info 0.7N (15.05.2016)
- Add options in APk.Info to change version/date without recompile source (just for new translation)
- Added Chinese (Taiwan) language (thanks to Li Bibo)
*** APK-Info 0.7O (23.06.2016)
- Update Android Build Tool (aapt.exe) with new version 24.0.0
*** APK-Info 0.7P (29.08.2016)
- Replace aapt 24.0.0 with 23.0.6 for compatibility problem with apk name.
- Add support for SDK 24 (Android 6.0.1) / SDK 25 (Android 7.0)
*** APK-Info 0.7Q (01.06.2017)
- Added russian translation - thanks to Kevin31
- Added SDK level 25 (Android 7.0 MR1) - thanks to tetsuo55
- Updated Android Build Tool aapt.exe (v. 26.0.RC2)
- Remove "Browse" button (was not really operative)
Increased button width for Play store page/Rename/Exit button
- Revised Android OS name classification - thanks to tetsuo55
- Added by default ShowLangCode=1 (can be disable with setting in APK-Info.ini)
It show OSLangCode nad Language code in the program title after program version and date.
- Changed log file name to 'APK-Info.log.txt'
*** APK-Info 0.7Q (02.06.2017)
- Addeded by default Info about OSLAngauge code and LanguageName ion the right below icon app.
useful info to dvelop and etst new language.
The info can be disabled using ShowOLAnguage=0 in APK-Info.ini
- Remove option to change APK-Info version and date in APK-Info.ini
*** APK-Info 0.7Q (05.06.2017)
Move LastFolder (used) variable in APK-Info.LastFolder.ini (first was in APK-Info.ini)
*** APK-Info 1.00 (10.06.2017)
- Updated aapt.exe to version 26.00 stable
- Added Portuguese (Brasilan) translation - Thanks to 41ui7i0
*** APK-Info 1.01 (19.06.2017)
- Minor bug fixing
*** APK-Info 1.02 (30.10.2017)
- Modified ini to support Oreo (8.0)
- Updated Android build Tool to support Oreo 8.0 apk
- Minor bug fixing
*** APK-Info 1.03 (30.12.2017)
- Updated Android build Tool (v. 27.0.3) to support Oreo 8.1 apk
- Minor bug fixing
*** APK-Info 1.04 (27.01.2018)
- Set blank space as default for PrefixFilename
- Disable by default extended Log (ShowLog=0)
- Minor bug fixing
*** APK-Info 1.05 (11.05.2018)
- Updated Android build Tool (v 28.0.RC2) to support Android P (Pistachio Ice Cream)
- Modified INI file to include detection of Android P (Pistachio Ice Cream) Preview.
*** APK-Info 1.06 (09.06.2018)
- Updated Android build Tool (v 28.0.0) to support Android P (Pistachio Ice Cream)
- Modified INI file to include detection of Android P (Pistachio Ice Cream) final.
*** APK-Info 1.07 (09.06.2018)
- Added apk ABIs.
- Added apk Signature check and info (need java in PATH).
- Reworked GUI creation for less pain on add new items.
*** APK-Info 1.08 (09.06.2018)
- Improved GUI layout.
- Improved ru translation.
*** APK-Info 1.09 (09.06.2018)
- 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.
- Fixed cleaning temporary folder.
*** APK-Info 1.10 (09.06.2018)
- Fixed bug with load apk icon.
*** APK-Info 1.11 (10.06.2018)
- Added Ukrainian language and improved application icons. Thanks to @Alex72b
*** APK-Info 1.12 (10.06.2018)
- Displays the status of the debug version in the build field.
- Improved read signature.
*** APK-Info 1.13 (11.06.2018)
- Added option for replace spaces in filename on rename.
*** APK-Info 1.14 (14.06.2018)
- Added drag&drop .apk to the main form.
+98
View File
@@ -0,0 +1,98 @@
***************************************************** Show OS GUI language
Setting ShowOSLanguage=1 (default ShowOSLanguage=0) in the program title
you can show the OSLang code.
***************************************************** Show command line option
Setting ShowCmdLine=1 (default ShowCmdLine=0) in the program title
you can show the parametrs passed to batch/command line to APK-Info.exe.
***************************************************** APK-Info shell integration
It's included a registry setting to enable sAPK.Info shell integration.
BEFORE to run it to activate shell integration, please edit the .reg.
You can do it with ex. Notepad++ and set the right path for APK-Info.exe (path without space)
********************************************** Multilanguage Info
The strings used by APK-Info GUI are located in APK-Info-GUI.ini file.
I included the strings to translate (and send to me) in the file
"APK-Info-GUI-Strings-en-master.txt" file
To create french translation add [String-fr] section
To create dutch translation add [String-nl] section
To create norwegian translation add [String-no] section
To create polish translation add [String-pl] section
To create portoguese translation add [String-pt] section
To create swedish translation add [String-sw] section
One time create new section copy and paste in the new section the messages
of [Strings-en] section and translate it.
For more info about OSLang code please see on
https://www.autoitscript.com/autoit3/docs/appendix/OSLangCodes.htm
The language codes already enabled as automatic detection are
ID = 0403 - Language_code="ca"
ID = 0409 - Language_code="zh-TW"
ID = 0409 - Language_code="en"
ID = 040c - Language_code="fr"
ID = 040e - Language_code="hu"
ID = 0410 - Language_code="it"
ID = 0413 - Language_code="nl"
ID = 0415 - Language_code="pl"
ID = 0416 - Language_code="pt-br"
ID = 0419 - Language_code="ru"
ID = 041b - Language_code="sk"
ID = 0421 - Language_code="id"
ID = 0429 - Language_code="fa"
ID = 0804 - Language_code="zh-CN"
ID = 0807 - Language_code="de"
ID = 080a - Language_code="sp"
Language strings already included in the program are for language
ca,de,en,fa,fr,hu,id,it,nl,pl,pt-br,ru,sk,sp,zh-CN,zh-TW
*****************************************************Forced GUI language
ForceGUILanguage in APK-Info.ini
Setting a value for ForcedGUILanguage (default ForcedGUILanguage=0 means auto detect)
you can force a specifc language for test. Ex
ForcedGUILanguage=fr force GUI language to French.
If the language strings for the language forced are nota availabel it will show in English.
*****************************************************APK-Info GUI translatorForced
Catalan -
Chinese Traditional - Li Guiquan
Dutch -
English - bovirus
Farsi - HesamEdin
French - Yoanf_26
German - mosu
Hungarian - gidano
Indonesian - exodius48
Italian - bovirus
Polish - Eselter
Portuguese (Brasilan) - 41ui7i0
Russian - Kevin31
Spanish - Ksawery
Slovak - Ja_som
Taiwanese - Li Bibo
+184
View File
@@ -0,0 +1,184 @@
Android Asset Packaging Tool
Usage:
aapt l[ist] [-v] [-a] file.{zip,jar,apk}
List contents of Zip-compatible archive.
aapt d[ump] [--values] [--include-meta-data] WHAT file.{apk} [asset [asset ...]]
strings Print the contents of the resource table string pool in the APK.
badging Print the label and icon for the app declared in APK.
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.
xmlstrings Print the strings of the given compiled xml assets.
aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \
[-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \
[--debug-mode] [--min-sdk-version VAL] [--target-sdk-version VAL] \
[--app-version VAL] [--app-version-name TEXT] [--custom-package VAL] \
[--rename-manifest-package PACKAGE] \
[--rename-instrumentation-target-package PACKAGE] \
[--utf16] [--auto-add-overlay] \
[--max-res-version VAL] \
[-I base-package [-I base-package ...]] \
[-A asset-source-dir] [-G class-list-file] [-P public-definitions-file] \
[-D main-dex-class-list-file] \
[-S resource-sources [-S resource-sources ...]] \
[-F apk-file] [-J R-file-dir] \
[--product product1,product2,...] \
[-c CONFIGS] [--preferred-density DENSITY] \
[--split CONFIGS [--split CONFIGS]] \
[--feature-of package [--feature-after package]] \
[raw-files-dir [raw-files-dir] ...] \
[--output-text-symbols DIR]
Package the android resources. It will read assets and resources that are
supplied with the -M -A -S or raw-files-dir arguments. The -J -P -F and -R
options control which files are output.
aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]
Delete specified files from Zip-compatible archive.
aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]
Add specified files to Zip-compatible archive.
aapt c[runch] [-v] -S resource-sources ... -C output-folder ...
Do PNG preprocessing on one or several resource folders
and store the results in the output folder.
aapt s[ingleCrunch] [-v] -i input-file -o outputfile
Do PNG preprocessing on a single file.
aapt v[ersion]
Print program version.
Modifiers:
-a print Android-specific data (resources, manifest) when listing
-c specify which configurations to include. The default is all
configurations. The value of the parameter should be a comma
separated list of configuration values. Locales should be specified
as either a language or language-region pair. Some examples:
en
port,en
port,land,en_US
-d one or more device assets to include, separated by commas
-f force overwrite of existing files
-g specify a pixel tolerance to force images to grayscale, default 0
-j specify a jar or zip file containing classes to include
-k junk path of file(s) added
-m make package directories under location specified by -J
-u update existing packages (add new, replace older, remove deleted files)
-v verbose output
-x create extending (non-application) resource IDs
-z require localization of resource attributes marked with
localization="suggested"
-A additional directory in which to find raw asset files
-G A file to output proguard options into.
-D A file to output proguard options for the main dex into.
-F specify the apk file to output
-I add an existing package to base include set
-J specify where to output R.java resource constant definitions
-M specify full path to AndroidManifest.xml to include in zip
-P specify where to output public resource definitions
-S directory in which to find resources. Multiple directories will be scanned
and the first match found (left to right) will take precedence.
-0 specifies an additional extension for which such files will not
be stored compressed in the .apk. An empty string means to not
compress any files at all.
--debug-mode
inserts android:debuggable="true" in to the application node of the
manifest, making the application debuggable even on production devices.
--include-meta-data
when used with "dump badging" also includes meta-data tags.
--pseudo-localize
generate resources for pseudo-locales (en-XA and ar-XB).
--min-sdk-version
inserts android:minSdkVersion in to manifest. If the version is 7 or
higher, the default encoding for resources will be in UTF-8.
--target-sdk-version
inserts android:targetSdkVersion in to manifest.
--max-res-version
ignores versioned resource directories above the given value.
--values
when used with "dump resources" also includes resource values.
--version-code
inserts android:versionCode in to manifest.
--version-name
inserts android:versionName in to manifest.
--replace-version
If --version-code and/or --version-name are specified, these
values will replace any value already in the manifest. By
default, nothing is changed if the manifest already defines
these attributes.
--custom-package
generates R.java into a different package.
--extra-packages
generate R.java for libraries. Separate libraries with ':'.
--generate-dependencies
generate dependency files in the same directories for R.java and resource package
--auto-add-overlay
Automatically add resources that are only in overlays.
--preferred-density
Specifies a preference for a particular density. Resources that do not
match this density and have variants that are a closer match are removed.
--split
Builds a separate split APK for the configurations listed. This can
be loaded alongside the base APK at runtime.
--feature-of
Builds a split APK that is a feature of the apk specified here. Resources
in the base APK can be referenced from the the feature APK.
--feature-after
An app can have multiple Feature Split APKs which must be totally ordered.
If --feature-of is specified, this flag specifies which Feature Split APK
comes before this one. The first Feature Split APK should not define
anything here.
--rename-manifest-package
Rewrite the manifest so that its package name is the package name
given here. Relative class names (for example .Foo) will be
changed to absolute names with the old package so that the code
does not need to change.
--rename-instrumentation-target-package
Rewrite the manifest so that all of its instrumentation
components target the given package. Useful when used in
conjunction with --rename-manifest-package to fix tests against
a package that has been renamed.
--product
Specifies which variant to choose for strings that have
product variants
--utf16
changes default encoding for resources to UTF-16. Only useful when API
level is set to 7 or higher where the default encoding is UTF-8.
--non-constant-id
Make the resources ID non constant. This is required to make an R java class
that does not contain the final value but is used to make reusable compiled
libraries that need to access resources.
--shared-lib
Make a shared library resource package that can be loaded by an application
at runtime to access the libraries resources. Implies --non-constant-id.
--app-as-shared-lib
Make an app resource package that also can be loaded as shared library at runtime.
Implies --non-constant-id.
--error-on-failed-insert
Forces aapt to return an error if it fails to insert values into the manifest
with --debug-mode, --min-sdk-version, --target-sdk-version --version-code
and --version-name.
Insertion typically fails if the manifest already defines the attribute.
--error-on-missing-config-entry
Forces aapt to return an error if it fails to find an entry for a configuration.
--output-text-symbols
Generates a text file containing the resource symbols of the R class in the
specified folder.
--ignore-assets
Assets to be ignored. Default pattern is:
!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~
--skip-symbols-without-default-localization
Prevents symbols from being generated for strings that do not have a default
localization
--no-version-vectors
Do not automatically generate versioned copies of vector XML resources.
--no-version-transitions
Do not automatically generate versioned copies of transition XML resources.
--private-symbols
Java package name to use when generating R.java for private resources.
+12
View File
@@ -0,0 +1,12 @@
Zip alignment utility
Copyright (C) 2009 The Android Open Source Project
Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip
zipalign -c [-p] [-v] <align> infile.zip
<align>: alignment in bytes, e.g. '4' provides 32-bit alignment
-c: check alignment only (does not modify file)
-f: overwrite existing outfile.zip
-p: memory page alignment for stored shared object files
-v: verbose output
-z: recompress using Zopfli