Skip to content

Commit

Permalink
Rename packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Oct 6, 2016
1 parent a0986b3 commit 73054d3
Show file tree
Hide file tree
Showing 24 changed files with 86 additions and 311 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ bin/
*.war
*.dex
*.ear
/apksigner
/apksigner.jar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
android-jarsigner
=================
apksigner
=========
A lightweight APK signing tool that can be run on Android devices.

Getting jarsigner-like functionality on android.
Usage
=====
Run as `apksigner [-p password] keystore input-apk output-apk`. This will use the specified keystore (or creating one if necessary) to create a signed and zipaligned output file.

Stripped down code from https://code.google.com/p/zip-signer/ - not yet ready to use.
License
=======
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). Based on [zip-signer](https://code.google.com/p/zip-signer/) by Ken Ellinwood.
15 changes: 13 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create-jar">
<project default="create-executable">

<target name="download-libs">
<get src="https://repo1.maven.org/maven2/com/madgag/spongycastle/core/1.54.0.0/core-1.54.0.0.jar" dest="lib/spongcyastle-core.jar"/>
Expand Down Expand Up @@ -27,7 +27,7 @@
<target name="create-jar" depends="compile">
<jar destfile="apksigner.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="kellinwood.zipsigner.cmdline.Main" />
<attribute name="Main-Class" value="net.fornwall.apksigner.Main" />
<attribute name="Class-Path" value="." />
</manifest>
<fileset dir="bin/" />
Expand All @@ -37,4 +37,15 @@
<zipfileset excludes="META-INF/*.SF" src="lib/commons-cli.jar" />
</jar>
</target>

<target name="create-executable" depends="create-jar">
<concat destfile="apksigner" binary="true">
<filelist>
<file name="stub.sh" />
<file name="apksigner.jar" />
</filelist>
</concat>
<chmod file="apksigner" perm="a+x" />
</target>

</project>
37 changes: 0 additions & 37 deletions src/kellinwood/security/zipsigner/Base64.java

This file was deleted.

21 changes: 21 additions & 0 deletions src/net/fornwall/apksigner/Base64.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.fornwall.apksigner;

import java.io.ByteArrayOutputStream;
import java.io.IOException;

import org.spongycastle.util.encoders.Base64Encoder;

/** Base64 encoding handling in a portable way across Android and JSE. */
public class Base64 {

public static String encode(byte[] data) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
new Base64Encoder().encode(data, 0, data.length, baos);
} catch (IOException e) {
throw new RuntimeException(e);
}
return new String(baos.toByteArray());
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kellinwood.security.zipsigner.optional;
package net.fornwall.apksigner;

import java.io.File;
import java.io.IOException;
Expand All @@ -13,8 +13,6 @@
import java.util.Map;
import java.util.Vector;

import kellinwood.security.zipsigner.KeySet;

import org.spongycastle.asn1.ASN1ObjectIdentifier;
import org.spongycastle.asn1.x500.style.BCStyle;
import org.spongycastle.jce.X509Principal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
power to enforce restrictions on reverse-engineering of their software,
and it is irresponsible for them to claim they can. */

package kellinwood.security.zipsigner.optional;
package net.fornwall.apksigner;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kellinwood.security.zipsigner;
package net.fornwall.apksigner;

import java.security.PrivateKey;
import java.security.cert.X509Certificate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kellinwood.security.zipsigner.optional;
package net.fornwall.apksigner;

import java.io.File;
import java.io.FileInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kellinwood.security.zipsigner.optional;
package net.fornwall.apksigner;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kellinwood.zipsigner.cmdline;
package net.fornwall.apksigner;

import java.io.File;
import java.security.KeyStore;
Expand All @@ -13,10 +13,6 @@
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

import kellinwood.security.zipsigner.ZipSigner;
import kellinwood.security.zipsigner.optional.CertCreator;
import kellinwood.security.zipsigner.optional.KeyStoreFileManager;

/** Sign files from the command line using zipsigner-lib. */
public class Main {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package kellinwood.security.zipsigner.optional;

import kellinwood.security.zipsigner.KeySet;
package net.fornwall.apksigner;

import org.spongycastle.cert.jcajce.JcaCertStore;
import org.spongycastle.cms.*;
Expand Down
Loading

0 comments on commit 73054d3

Please sign in to comment.