-mavenizing the project

-moving all org.bouncycastl2.* dependencies to Sponcy Castle instead. 
This way multiple people dont need to maintain rebased versions of BC
This commit is contained in:
senecaso 2011-10-06 15:31:16 +09:00
parent 9fbda63b6f
commit 6f2333b7d3
15 changed files with 142 additions and 77 deletions

View File

@ -17,8 +17,7 @@
<manifest <manifest
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
package="org.thialfihar.android.apg" package="org.thialfihar.android.apg"
android:versionCode="10900" android:versionName="1.0.9 beta 00" android:versionCode="10900" android:versionName="1.0.9 beta 00">
android:installLocation="auto">
<application <application
android:icon="@drawable/icon" android:icon="@drawable/icon"

62
pom.xml Normal file
View File

@ -0,0 +1,62 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>1.0.9-SNAPSHOT</version>
<groupId>org.thialfihar.android</groupId>
<artifactId>apg</artifactId>
<packaging>apk</packaging>
<name>APG</name>
<description>
</description>
<url>http://code.google.com/p/android-privacy-guard/</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<android.version>1.6_r2</android.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
<version>1.6_r2</version>
</dependency>
<dependency>
<groupId>com.madgag</groupId>
<artifactId>scprov-jdk15</artifactId>
<version>1.46.99.4-UNOFFICIAL-ROBERTO-RELEASE-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<target>1.6</target>
<source>1.6</source>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.0.0-alpha-11</version>
<configuration>
<sdk>
<path>${user.home}/android-sdk-linux_x86/</path>
<platform>4</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
<extractDuplicates>true</extractDuplicates>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

View File

@ -45,42 +45,42 @@ import java.util.Map;
import java.util.Vector; import java.util.Vector;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.bouncycastle2.bcpg.ArmoredInputStream; import org.spongycastle.bcpg.ArmoredInputStream;
import org.bouncycastle2.bcpg.ArmoredOutputStream; import org.spongycastle.bcpg.ArmoredOutputStream;
import org.bouncycastle2.bcpg.BCPGOutputStream; import org.spongycastle.bcpg.BCPGOutputStream;
import org.bouncycastle2.bcpg.CompressionAlgorithmTags; import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.bouncycastle2.bcpg.HashAlgorithmTags; import org.spongycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle2.bcpg.SymmetricKeyAlgorithmTags; import org.spongycastle.bcpg.SymmetricKeyAlgorithmTags;
import org.bouncycastle2.bcpg.sig.KeyFlags; import org.spongycastle.bcpg.sig.KeyFlags;
import org.bouncycastle2.jce.provider.BouncyCastleProvider; import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle2.jce.spec.ElGamalParameterSpec; import org.spongycastle.jce.spec.ElGamalParameterSpec;
import org.bouncycastle2.openpgp.PGPCompressedData; import org.spongycastle.openpgp.PGPCompressedData;
import org.bouncycastle2.openpgp.PGPCompressedDataGenerator; import org.spongycastle.openpgp.PGPCompressedDataGenerator;
import org.bouncycastle2.openpgp.PGPEncryptedData; import org.spongycastle.openpgp.PGPEncryptedData;
import org.bouncycastle2.openpgp.PGPEncryptedDataGenerator; import org.spongycastle.openpgp.PGPEncryptedDataGenerator;
import org.bouncycastle2.openpgp.PGPEncryptedDataList; import org.spongycastle.openpgp.PGPEncryptedDataList;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPKeyPair; import org.spongycastle.openpgp.PGPKeyPair;
import org.bouncycastle2.openpgp.PGPKeyRingGenerator; import org.spongycastle.openpgp.PGPKeyRingGenerator;
import org.bouncycastle2.openpgp.PGPLiteralData; import org.spongycastle.openpgp.PGPLiteralData;
import org.bouncycastle2.openpgp.PGPLiteralDataGenerator; import org.spongycastle.openpgp.PGPLiteralDataGenerator;
import org.bouncycastle2.openpgp.PGPObjectFactory; import org.spongycastle.openpgp.PGPObjectFactory;
import org.bouncycastle2.openpgp.PGPOnePassSignature; import org.spongycastle.openpgp.PGPOnePassSignature;
import org.bouncycastle2.openpgp.PGPOnePassSignatureList; import org.spongycastle.openpgp.PGPOnePassSignatureList;
import org.bouncycastle2.openpgp.PGPPBEEncryptedData; import org.spongycastle.openpgp.PGPPBEEncryptedData;
import org.bouncycastle2.openpgp.PGPPrivateKey; import org.spongycastle.openpgp.PGPPrivateKey;
import org.bouncycastle2.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKey;
import org.bouncycastle2.openpgp.PGPPublicKeyEncryptedData; import org.spongycastle.openpgp.PGPPublicKeyEncryptedData;
import org.bouncycastle2.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.bouncycastle2.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle2.openpgp.PGPSignature; import org.spongycastle.openpgp.PGPSignature;
import org.bouncycastle2.openpgp.PGPSignatureGenerator; import org.spongycastle.openpgp.PGPSignatureGenerator;
import org.bouncycastle2.openpgp.PGPSignatureList; import org.spongycastle.openpgp.PGPSignatureList;
import org.bouncycastle2.openpgp.PGPSignatureSubpacketGenerator; import org.spongycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.bouncycastle2.openpgp.PGPSignatureSubpacketVector; import org.spongycastle.openpgp.PGPSignatureSubpacketVector;
import org.bouncycastle2.openpgp.PGPUtil; import org.spongycastle.openpgp.PGPUtil;
import org.bouncycastle2.openpgp.PGPV3SignatureGenerator; import org.spongycastle.openpgp.PGPV3SignatureGenerator;
import org.thialfihar.android.apg.provider.DataProvider; import org.thialfihar.android.apg.provider.DataProvider;
import org.thialfihar.android.apg.provider.Database; import org.thialfihar.android.apg.provider.Database;
import org.thialfihar.android.apg.provider.KeyRings; import org.thialfihar.android.apg.provider.KeyRings;
@ -739,6 +739,7 @@ public class Apg {
return key.getPublicKey().getCreationTime(); return key.getPublicKey().getCreationTime();
} }
@SuppressWarnings("unchecked")
public static PGPPublicKey getMasterKey(PGPPublicKeyRing keyRing) { public static PGPPublicKey getMasterKey(PGPPublicKeyRing keyRing) {
if (keyRing == null) { if (keyRing == null) {
return null; return null;
@ -752,6 +753,7 @@ public class Apg {
return null; return null;
} }
@SuppressWarnings("unchecked")
public static PGPSecretKey getMasterKey(PGPSecretKeyRing keyRing) { public static PGPSecretKey getMasterKey(PGPSecretKeyRing keyRing) {
if (keyRing == null) { if (keyRing == null) {
return null; return null;
@ -765,6 +767,7 @@ public class Apg {
return null; return null;
} }
@SuppressWarnings("unchecked")
public static Vector<PGPPublicKey> getEncryptKeys(PGPPublicKeyRing keyRing) { public static Vector<PGPPublicKey> getEncryptKeys(PGPPublicKeyRing keyRing) {
Vector<PGPPublicKey> encryptKeys = new Vector<PGPPublicKey>(); Vector<PGPPublicKey> encryptKeys = new Vector<PGPPublicKey>();
@ -777,6 +780,7 @@ public class Apg {
return encryptKeys; return encryptKeys;
} }
@SuppressWarnings("unchecked")
public static Vector<PGPSecretKey> getSigningKeys(PGPSecretKeyRing keyRing) { public static Vector<PGPSecretKey> getSigningKeys(PGPSecretKeyRing keyRing) {
Vector<PGPSecretKey> signingKeys = new Vector<PGPSecretKey>(); Vector<PGPSecretKey> signingKeys = new Vector<PGPSecretKey>();
@ -884,6 +888,7 @@ public class Apg {
return signingKeys.get(0); return signingKeys.get(0);
} }
@SuppressWarnings("unchecked")
public static String getMainUserId(PGPPublicKey key) { public static String getMainUserId(PGPPublicKey key) {
for (String userId : new IterableIterator<String>(key.getUserIDs())) { for (String userId : new IterableIterator<String>(key.getUserIDs())) {
return userId; return userId;
@ -891,6 +896,7 @@ public class Apg {
return null; return null;
} }
@SuppressWarnings("unchecked")
public static String getMainUserId(PGPSecretKey key) { public static String getMainUserId(PGPSecretKey key) {
for (String userId : new IterableIterator<String>(key.getUserIDs())) { for (String userId : new IterableIterator<String>(key.getUserIDs())) {
return userId; return userId;
@ -914,6 +920,7 @@ public class Apg {
return userId; return userId;
} }
@SuppressWarnings("unchecked")
public static boolean isEncryptionKey(PGPPublicKey key) { public static boolean isEncryptionKey(PGPPublicKey key) {
if (!key.isEncryptionKey()) { if (!key.isEncryptionKey()) {
return false; return false;
@ -958,6 +965,7 @@ public class Apg {
return isEncryptionKey(key.getPublicKey()); return isEncryptionKey(key.getPublicKey());
} }
@SuppressWarnings("unchecked")
public static boolean isSigningKey(PGPPublicKey key) { public static boolean isSigningKey(PGPPublicKey key) {
if (key.getVersion() <= 3) { if (key.getVersion() <= 3) {
return true; return true;
@ -1129,11 +1137,8 @@ public class Apg {
if (keyRing == null) { if (keyRing == null) {
return null; return null;
} }
try {
return keyRing.getPublicKey(keyId); return keyRing.getPublicKey(keyId);
} catch (PGPException e) {
return null;
}
} }
public static Vector<Integer> getKeyRingIds(int type) { public static Vector<Integer> getKeyRingIds(int type) {

View File

@ -16,11 +16,10 @@
package org.thialfihar.android.apg; package org.thialfihar.android.apg;
import org.bouncycastle2.jce.provider.BouncyCastleProvider; import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPPrivateKey; import org.spongycastle.openpgp.PGPPrivateKey;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.thialfihar.android.apg.Apg.GeneralException;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;

View File

@ -26,9 +26,9 @@ import java.security.Security;
import java.security.SignatureException; import java.security.SignatureException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import org.bouncycastle2.jce.provider.BouncyCastleProvider; import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.thialfihar.android.apg.provider.DataProvider; import org.thialfihar.android.apg.provider.DataProvider;
import android.app.AlertDialog; import android.app.AlertDialog;

View File

@ -22,9 +22,9 @@ import java.security.NoSuchProviderException;
import java.security.SignatureException; import java.security.SignatureException;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.bouncycastle2.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.thialfihar.android.apg.provider.Database; import org.thialfihar.android.apg.provider.Database;
import org.thialfihar.android.apg.ui.widget.KeyEditor; import org.thialfihar.android.apg.ui.widget.KeyEditor;
import org.thialfihar.android.apg.ui.widget.SectionView; import org.thialfihar.android.apg.ui.widget.SectionView;

View File

@ -26,11 +26,11 @@ import java.security.NoSuchProviderException;
import java.security.SignatureException; import java.security.SignatureException;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKey;
import org.bouncycastle2.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.bouncycastle2.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.thialfihar.android.apg.provider.DataProvider; import org.thialfihar.android.apg.provider.DataProvider;
import org.thialfihar.android.apg.utils.Choice; import org.thialfihar.android.apg.utils.Choice;

View File

@ -16,7 +16,7 @@
package org.thialfihar.android.apg; package org.thialfihar.android.apg;
import org.bouncycastle2.bcpg.CompressionAlgorithmTags; import org.spongycastle.bcpg.CompressionAlgorithmTags;
public final class Id { public final class Id {
public static final class menu { public static final class menu {

View File

@ -26,9 +26,9 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle2.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.thialfihar.android.apg.provider.KeyRings; import org.thialfihar.android.apg.provider.KeyRings;
import org.thialfihar.android.apg.provider.Keys; import org.thialfihar.android.apg.provider.Keys;
import org.thialfihar.android.apg.provider.UserIds; import org.thialfihar.android.apg.provider.UserIds;

View File

@ -2,8 +2,8 @@ package org.thialfihar.android.apg;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.bcpg.HashAlgorithmTags; import org.spongycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle2.openpgp.PGPEncryptedData; import org.spongycastle.openpgp.PGPEncryptedData;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;

View File

@ -20,8 +20,8 @@ import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.bcpg.HashAlgorithmTags; import org.spongycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle2.openpgp.PGPEncryptedData; import org.spongycastle.openpgp.PGPEncryptedData;
import org.thialfihar.android.apg.ui.widget.IntegerListPreference; import org.thialfihar.android.apg.ui.widget.IntegerListPreference;
import android.content.Intent; import android.content.Intent;

View File

@ -16,7 +16,7 @@
package org.thialfihar.android.apg; package org.thialfihar.android.apg;
import org.bouncycastle2.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPPublicKeyRing;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;

View File

@ -5,11 +5,11 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKey;
import org.bouncycastle2.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.bouncycastle2.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.thialfihar.android.apg.Apg; import org.thialfihar.android.apg.Apg;
import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.Id;
import org.thialfihar.android.apg.utils.IterableIterator; import org.thialfihar.android.apg.utils.IterableIterator;

View File

@ -22,8 +22,8 @@ import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKey;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.thialfihar.android.apg.Apg; import org.thialfihar.android.apg.Apg;
import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.Id;
import org.thialfihar.android.apg.R; import org.thialfihar.android.apg.R;

View File

@ -22,8 +22,8 @@ import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException; import java.security.NoSuchProviderException;
import java.util.Vector; import java.util.Vector;
import org.bouncycastle2.openpgp.PGPException; import org.spongycastle.openpgp.PGPException;
import org.bouncycastle2.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKey;
import org.thialfihar.android.apg.Apg; import org.thialfihar.android.apg.Apg;
import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.Id;
import org.thialfihar.android.apg.R; import org.thialfihar.android.apg.R;