[General Questions and Answers] peter1miller2:
I asked this previously.

But i did not specify the problem correctly When i unpack the:

build-tools_r30.0.1-windows.zip to the C drive i get this:

C:\android-11\

If i try to use the ApkSigner.JAR in the:

C:\android-11\lib\

Folder Directly through those two commands:

cd C:\Program Files\AdoptOpenJDK\jre-16.0.1.9-hotspot\bin\

Followed by:

java.exe C:\android-11\lib\apksigner.jar sign --key C:\keys\mykey.pk8 --cert C:\certificates\mycert.pem --min-sdk-version 20 C:\files\MyZipFile.zip

I get this:

Error: Could not find or load main class C:\android-11\lib\apksigner.jar

Caused by: java.lang.ClassNotFoundException: C:\android-11\lib\apksigner.jar

If i use the ApkSigner.JAR INDIRECTLY Through the ApkSigner.BAT File in the:

C:\android-11\

Folder Through those two commands:

cd C:\android-11\

Followed by:

apksigner.bat sign --key C:\keys\mykey.pk8 --cert C:\certificates\mycert.pem --min-sdk-version 20 C:\files\MyZipFile.zip

Than it works But the apksigner.BAT File does not work with the batch signer i mentioned in this post: https://xdaforums.com/t/how-to-batch-sign-zip-files.4258547/

Which is why Batch signing is not working for me with the current apksigner.JAR File.

Since because of this

Error:

Could not find or load main class C:\android-11\lib\apksigner.jar

Caused by: java.lang.ClassNotFoundException: C:\android-11\lib\apksigner.jar

I cannot use it directly.

The script from the apksigner.BAT File is this:

@Echo off

REM Copyright (C) 2016 The Android Open Source Project

REM

REM Licensed under the Apache License, Version 2.0 (the "License");

REM you may not use this file except in compliance with the License.

REM You may obtain a copy of the License at

REM

REM http://www.apache.org/licenses/LICENSE-2.0

REM

REM Unless required by applicable law or agreed to in writing, software

REM distributed under the License is distributed on an "AS IS" BASIS,

REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

REM See the License for the specific language governing permissions and

REM limitations under the License.

REM don't modify the caller's environment

setlocal

REM Locate apksigner.jar in the directory where apksigner.bat was found and start it.

REM Set up prog to be the path of this script, including following symlinks,

REM and set up progdir to be the fully-qualified pathname of its directory.

set prog=%~f0

@Rem Find java.exe

if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe

%JAVA_EXE% -version >NUL 2>&1

if "%ERRORLEVEL%" == "0" goto init

echo.

echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

echo.

echo Please set the JAVA_HOME variable in your environment to match the

echo location of your Java installation.

exit /b 1

:findJavaFromJavaHome

set JAVA_HOME=%JAVA_HOME:"=%

set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.

echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%

echo.

echo Please set the JAVA_HOME variable in your environment to match the

echo location of your Java installation.

exit /b 1

:init

set jarfile=apksigner.jar

set "frameworkdir=%~dp0"

rem frameworkdir must not end with a dir sep.

set "frameworkdir=%frameworkdir:~0,-1%"

if exist "%frameworkdir%\%jarfile%" goto JarFileOk

set "frameworkdir=%~dp0lib"

if exist "%frameworkdir%\%jarfile%" goto JarFileOk

set "frameworkdir=%~dp0..\framework"

:JarFileOk

set "jarpath=%frameworkdir%\%jarfile%"

set javaOpts=

set args=

REM By default, give apksigner a max heap size of 1 gig and a stack size of 1meg.

rem This can be overridden by using "-JXmx..." and "-JXss..." options below.

set defaultXmx=-Xmx1024M

set defaultXss=-Xss1m

REM Capture all arguments that are not -J options.

REM Note that when reading the input arguments with %1, the cmd.exe

REM automagically converts --name=value arguments into 2 arguments "--name"

REM followed by "value". apksigner has been changed to know how to deal with that.

set params=

:firstArg

if [%1]==[] goto endArgs

set "a=%~1"

if [%defaultXmx%]==[] goto notXmx

if "%a:~0,5%" NEQ "-JXmx" goto notXmx

set defaultXmx=

:notXmx

if [%defaultXss%]==[] goto notXss

if "%a:~0,5%" NEQ "-JXss" goto notXss

set defaultXss=

:notXss

if "%a:~0,2%" NEQ "-J" goto notJ

set javaOpts=%javaOpts% -%a:~2%

shift /1

goto firstArg

:notJ

set params=%params% %1

shift /1

goto firstArg

:endArgs

set javaOpts=%javaOpts% %defaultXmx% %defaultXss%

call "%java_exe%" %javaOpts% -jar "%jarpath%" %params%

The script From the SignEm v2.0 Tool: From this Post:

https://xdaforums.com/t/tool-window...iles-no-signature-verification-error.1966007/

By @Ryuinferno is this

And the Script created by: @jwoegerbauer As this answer:

https://xdaforums.com/t/how-to-batch-sign-zip-files.4258547/post-84798393

To my earlier post is here:

And I wery much Hope someone can help me with this problem.