Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary external com.android:apksigner dependency #48

Open
rob-X1 opened this issue Aug 16, 2023 · 3 comments
Open

Unnecessary external com.android:apksigner dependency #48

rob-X1 opened this issue Aug 16, 2023 · 3 comments

Comments

@rob-X1
Copy link

rob-X1 commented Aug 16, 2023

pom.xml contains the system dependency

        <dependency>
            <groupId>com.android</groupId>
            <artifactId>apksigner</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/lib/apksigner_33_0_2.jar</systemPath>
        </dependency>

which makes building uber-apk-signer unnecessary complicated. Google releases the library version of apksigner in it's maven repository: https://mvnrepository.com/artifact/com.android.tools.build/apksig?repo=google

So you only have to add

	<repositories>
		<repository>
			<id>Google</id>
			<name>Google</name>
			<url>https://maven.google.com/</url>
		</repository>
	</repositories>

and then use the dependency

<dependency>
    <groupId>com.android.tools.build</groupId>
    <artifactId>apksig</artifactId>
    <version>8.0.2</version>
</dependency>

You can then directly com.android.apksig.ApkSigner and com.android.apksig.ApkVerifier within your code.

@patrickfav
Copy link
Owner

Good point, didnt know that, thank you!

Will change it to an non-system depdency!

@patrickfav
Copy link
Owner

So, currently Im using the com.android.apksigner.ApkSignerTool as interface with the signer, which is basically using it as CLI. The dependency only has the internal signer code, without the CLI interface, so I need to refactor the code a bit (thecom.android.apksig.ApkSigner interface is not super trivial)

@rob-X1
Copy link
Author

rob-X1 commented Aug 16, 2023

You can use the original ApkSigner source code to see what parameter causes what code to be executed: https://android.googlesource.com/platform/tools/apksig/+/refs/heads/main/src/apksigner/java/com/android/apksigner/ApkSignerTool.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants