diff options
author | senecaso <senecaso@bertha> | 2011-10-06 15:31:16 +0900 |
---|---|---|
committer | senecaso <senecaso@bertha> | 2011-10-06 15:31:16 +0900 |
commit | 6f2333b7d3ff892697e993e4af2053a695f19402 (patch) | |
tree | 0eb8b5d1316d65fdf5f71081651474e18ce155b8 | |
parent | 9fbda63b6f20870f9ce6875a625c4e780d250aa9 (diff) | |
download | open-keychain-6f2333b7d3ff892697e993e4af2053a695f19402.tar.gz open-keychain-6f2333b7d3ff892697e993e4af2053a695f19402.tar.bz2 open-keychain-6f2333b7d3ff892697e993e4af2053a695f19402.zip |
-mavenizing the project
-moving all org.bouncycastl2.* dependencies to Sponcy Castle instead.
This way multiple people dont need to maintain rebased versions of BC
-rw-r--r-- | AndroidManifest.xml | 3 | ||||
-rw-r--r-- | pom.xml | 62 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/Apg.java | 87 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java | 9 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/DecryptActivity.java | 6 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/EditKeyActivity.java | 6 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/EncryptActivity.java | 10 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/Id.java | 2 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/KeyListActivity.java | 6 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/Preferences.java | 4 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/PreferencesActivity.java | 4 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/PublicKeyListActivity.java | 2 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/provider/Database.java | 10 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/ui/widget/KeyEditor.java | 4 | ||||
-rw-r--r-- | src/org/thialfihar/android/apg/ui/widget/SectionView.java | 4 |
15 files changed, 142 insertions, 77 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 47197a129..8c7dd53fe 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -17,8 +17,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.thialfihar.android.apg" - android:versionCode="10900" android:versionName="1.0.9 beta 00" - android:installLocation="auto"> + android:versionCode="10900" android:versionName="1.0.9 beta 00"> <application android:icon="@drawable/icon" diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..ea65d3172 --- /dev/null +++ b/pom.xml @@ -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> diff --git a/src/org/thialfihar/android/apg/Apg.java b/src/org/thialfihar/android/apg/Apg.java index 34c2acc6b..3ec12ced6 100644 --- a/src/org/thialfihar/android/apg/Apg.java +++ b/src/org/thialfihar/android/apg/Apg.java @@ -45,42 +45,42 @@ import java.util.Map; import java.util.Vector; import java.util.regex.Pattern; -import org.bouncycastle2.bcpg.ArmoredInputStream; -import org.bouncycastle2.bcpg.ArmoredOutputStream; -import org.bouncycastle2.bcpg.BCPGOutputStream; -import org.bouncycastle2.bcpg.CompressionAlgorithmTags; -import org.bouncycastle2.bcpg.HashAlgorithmTags; -import org.bouncycastle2.bcpg.SymmetricKeyAlgorithmTags; -import org.bouncycastle2.bcpg.sig.KeyFlags; -import org.bouncycastle2.jce.provider.BouncyCastleProvider; -import org.bouncycastle2.jce.spec.ElGamalParameterSpec; -import org.bouncycastle2.openpgp.PGPCompressedData; -import org.bouncycastle2.openpgp.PGPCompressedDataGenerator; -import org.bouncycastle2.openpgp.PGPEncryptedData; -import org.bouncycastle2.openpgp.PGPEncryptedDataGenerator; -import org.bouncycastle2.openpgp.PGPEncryptedDataList; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPKeyPair; -import org.bouncycastle2.openpgp.PGPKeyRingGenerator; -import org.bouncycastle2.openpgp.PGPLiteralData; -import org.bouncycastle2.openpgp.PGPLiteralDataGenerator; -import org.bouncycastle2.openpgp.PGPObjectFactory; -import org.bouncycastle2.openpgp.PGPOnePassSignature; -import org.bouncycastle2.openpgp.PGPOnePassSignatureList; -import org.bouncycastle2.openpgp.PGPPBEEncryptedData; -import org.bouncycastle2.openpgp.PGPPrivateKey; -import org.bouncycastle2.openpgp.PGPPublicKey; -import org.bouncycastle2.openpgp.PGPPublicKeyEncryptedData; -import org.bouncycastle2.openpgp.PGPPublicKeyRing; -import org.bouncycastle2.openpgp.PGPSecretKey; -import org.bouncycastle2.openpgp.PGPSecretKeyRing; -import org.bouncycastle2.openpgp.PGPSignature; -import org.bouncycastle2.openpgp.PGPSignatureGenerator; -import org.bouncycastle2.openpgp.PGPSignatureList; -import org.bouncycastle2.openpgp.PGPSignatureSubpacketGenerator; -import org.bouncycastle2.openpgp.PGPSignatureSubpacketVector; -import org.bouncycastle2.openpgp.PGPUtil; -import org.bouncycastle2.openpgp.PGPV3SignatureGenerator; +import org.spongycastle.bcpg.ArmoredInputStream; +import org.spongycastle.bcpg.ArmoredOutputStream; +import org.spongycastle.bcpg.BCPGOutputStream; +import org.spongycastle.bcpg.CompressionAlgorithmTags; +import org.spongycastle.bcpg.HashAlgorithmTags; +import org.spongycastle.bcpg.SymmetricKeyAlgorithmTags; +import org.spongycastle.bcpg.sig.KeyFlags; +import org.spongycastle.jce.provider.BouncyCastleProvider; +import org.spongycastle.jce.spec.ElGamalParameterSpec; +import org.spongycastle.openpgp.PGPCompressedData; +import org.spongycastle.openpgp.PGPCompressedDataGenerator; +import org.spongycastle.openpgp.PGPEncryptedData; +import org.spongycastle.openpgp.PGPEncryptedDataGenerator; +import org.spongycastle.openpgp.PGPEncryptedDataList; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPKeyPair; +import org.spongycastle.openpgp.PGPKeyRingGenerator; +import org.spongycastle.openpgp.PGPLiteralData; +import org.spongycastle.openpgp.PGPLiteralDataGenerator; +import org.spongycastle.openpgp.PGPObjectFactory; +import org.spongycastle.openpgp.PGPOnePassSignature; +import org.spongycastle.openpgp.PGPOnePassSignatureList; +import org.spongycastle.openpgp.PGPPBEEncryptedData; +import org.spongycastle.openpgp.PGPPrivateKey; +import org.spongycastle.openpgp.PGPPublicKey; +import org.spongycastle.openpgp.PGPPublicKeyEncryptedData; +import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.spongycastle.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPSecretKeyRing; +import org.spongycastle.openpgp.PGPSignature; +import org.spongycastle.openpgp.PGPSignatureGenerator; +import org.spongycastle.openpgp.PGPSignatureList; +import org.spongycastle.openpgp.PGPSignatureSubpacketGenerator; +import org.spongycastle.openpgp.PGPSignatureSubpacketVector; +import org.spongycastle.openpgp.PGPUtil; +import org.spongycastle.openpgp.PGPV3SignatureGenerator; import org.thialfihar.android.apg.provider.DataProvider; import org.thialfihar.android.apg.provider.Database; import org.thialfihar.android.apg.provider.KeyRings; @@ -739,6 +739,7 @@ public class Apg { return key.getPublicKey().getCreationTime(); } + @SuppressWarnings("unchecked") public static PGPPublicKey getMasterKey(PGPPublicKeyRing keyRing) { if (keyRing == null) { return null; @@ -752,6 +753,7 @@ public class Apg { return null; } + @SuppressWarnings("unchecked") public static PGPSecretKey getMasterKey(PGPSecretKeyRing keyRing) { if (keyRing == null) { return null; @@ -765,6 +767,7 @@ public class Apg { return null; } + @SuppressWarnings("unchecked") public static Vector<PGPPublicKey> getEncryptKeys(PGPPublicKeyRing keyRing) { Vector<PGPPublicKey> encryptKeys = new Vector<PGPPublicKey>(); @@ -777,6 +780,7 @@ public class Apg { return encryptKeys; } + @SuppressWarnings("unchecked") public static Vector<PGPSecretKey> getSigningKeys(PGPSecretKeyRing keyRing) { Vector<PGPSecretKey> signingKeys = new Vector<PGPSecretKey>(); @@ -884,6 +888,7 @@ public class Apg { return signingKeys.get(0); } + @SuppressWarnings("unchecked") public static String getMainUserId(PGPPublicKey key) { for (String userId : new IterableIterator<String>(key.getUserIDs())) { return userId; @@ -891,6 +896,7 @@ public class Apg { return null; } + @SuppressWarnings("unchecked") public static String getMainUserId(PGPSecretKey key) { for (String userId : new IterableIterator<String>(key.getUserIDs())) { return userId; @@ -914,6 +920,7 @@ public class Apg { return userId; } + @SuppressWarnings("unchecked") public static boolean isEncryptionKey(PGPPublicKey key) { if (!key.isEncryptionKey()) { return false; @@ -958,6 +965,7 @@ public class Apg { return isEncryptionKey(key.getPublicKey()); } + @SuppressWarnings("unchecked") public static boolean isSigningKey(PGPPublicKey key) { if (key.getVersion() <= 3) { return true; @@ -1129,11 +1137,8 @@ public class Apg { if (keyRing == null) { return null; } - try { - return keyRing.getPublicKey(keyId); - } catch (PGPException e) { - return null; - } + + return keyRing.getPublicKey(keyId); } public static Vector<Integer> getKeyRingIds(int type) { diff --git a/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java b/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java index 829244e0d..dc65ff762 100644 --- a/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java +++ b/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java @@ -16,11 +16,10 @@ package org.thialfihar.android.apg; -import org.bouncycastle2.jce.provider.BouncyCastleProvider; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPPrivateKey; -import org.bouncycastle2.openpgp.PGPSecretKey; -import org.thialfihar.android.apg.Apg.GeneralException; +import org.spongycastle.jce.provider.BouncyCastleProvider; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPPrivateKey; +import org.spongycastle.openpgp.PGPSecretKey; import android.app.Activity; import android.app.AlertDialog; diff --git a/src/org/thialfihar/android/apg/DecryptActivity.java b/src/org/thialfihar/android/apg/DecryptActivity.java index 576b6d531..22d23087b 100644 --- a/src/org/thialfihar/android/apg/DecryptActivity.java +++ b/src/org/thialfihar/android/apg/DecryptActivity.java @@ -26,9 +26,9 @@ import java.security.Security; import java.security.SignatureException; import java.util.regex.Matcher; -import org.bouncycastle2.jce.provider.BouncyCastleProvider; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPPublicKeyRing; +import org.spongycastle.jce.provider.BouncyCastleProvider; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPPublicKeyRing; import org.thialfihar.android.apg.provider.DataProvider; import android.app.AlertDialog; diff --git a/src/org/thialfihar/android/apg/EditKeyActivity.java b/src/org/thialfihar/android/apg/EditKeyActivity.java index 4bb8899ca..54007f2bc 100644 --- a/src/org/thialfihar/android/apg/EditKeyActivity.java +++ b/src/org/thialfihar/android/apg/EditKeyActivity.java @@ -22,9 +22,9 @@ import java.security.NoSuchProviderException; import java.security.SignatureException; import java.util.Vector; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPSecretKey; -import org.bouncycastle2.openpgp.PGPSecretKeyRing; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPSecretKeyRing; import org.thialfihar.android.apg.provider.Database; import org.thialfihar.android.apg.ui.widget.KeyEditor; import org.thialfihar.android.apg.ui.widget.SectionView; diff --git a/src/org/thialfihar/android/apg/EncryptActivity.java b/src/org/thialfihar/android/apg/EncryptActivity.java index 9ba71f570..9c5f77462 100644 --- a/src/org/thialfihar/android/apg/EncryptActivity.java +++ b/src/org/thialfihar/android/apg/EncryptActivity.java @@ -26,11 +26,11 @@ import java.security.NoSuchProviderException; import java.security.SignatureException; import java.util.Vector; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPPublicKey; -import org.bouncycastle2.openpgp.PGPPublicKeyRing; -import org.bouncycastle2.openpgp.PGPSecretKey; -import org.bouncycastle2.openpgp.PGPSecretKeyRing; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPPublicKey; +import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.spongycastle.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPSecretKeyRing; import org.thialfihar.android.apg.provider.DataProvider; import org.thialfihar.android.apg.utils.Choice; diff --git a/src/org/thialfihar/android/apg/Id.java b/src/org/thialfihar/android/apg/Id.java index ebc1ecf87..1ce53eabd 100644 --- a/src/org/thialfihar/android/apg/Id.java +++ b/src/org/thialfihar/android/apg/Id.java @@ -16,7 +16,7 @@ package org.thialfihar.android.apg; -import org.bouncycastle2.bcpg.CompressionAlgorithmTags; +import org.spongycastle.bcpg.CompressionAlgorithmTags; public final class Id { public static final class menu { diff --git a/src/org/thialfihar/android/apg/KeyListActivity.java b/src/org/thialfihar/android/apg/KeyListActivity.java index 57a7f5de1..585d0259b 100644 --- a/src/org/thialfihar/android/apg/KeyListActivity.java +++ b/src/org/thialfihar/android/apg/KeyListActivity.java @@ -26,9 +26,9 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Vector; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPPublicKeyRing; -import org.bouncycastle2.openpgp.PGPSecretKeyRing; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.spongycastle.openpgp.PGPSecretKeyRing; import org.thialfihar.android.apg.provider.KeyRings; import org.thialfihar.android.apg.provider.Keys; import org.thialfihar.android.apg.provider.UserIds; diff --git a/src/org/thialfihar/android/apg/Preferences.java b/src/org/thialfihar/android/apg/Preferences.java index 36325a126..f1a538282 100644 --- a/src/org/thialfihar/android/apg/Preferences.java +++ b/src/org/thialfihar/android/apg/Preferences.java @@ -2,8 +2,8 @@ package org.thialfihar.android.apg; import java.util.Vector; -import org.bouncycastle2.bcpg.HashAlgorithmTags; -import org.bouncycastle2.openpgp.PGPEncryptedData; +import org.spongycastle.bcpg.HashAlgorithmTags; +import org.spongycastle.openpgp.PGPEncryptedData; import android.content.Context; import android.content.SharedPreferences; diff --git a/src/org/thialfihar/android/apg/PreferencesActivity.java b/src/org/thialfihar/android/apg/PreferencesActivity.java index 0d0d76318..175bc10c8 100644 --- a/src/org/thialfihar/android/apg/PreferencesActivity.java +++ b/src/org/thialfihar/android/apg/PreferencesActivity.java @@ -20,8 +20,8 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Vector; -import org.bouncycastle2.bcpg.HashAlgorithmTags; -import org.bouncycastle2.openpgp.PGPEncryptedData; +import org.spongycastle.bcpg.HashAlgorithmTags; +import org.spongycastle.openpgp.PGPEncryptedData; import org.thialfihar.android.apg.ui.widget.IntegerListPreference; import android.content.Intent; diff --git a/src/org/thialfihar/android/apg/PublicKeyListActivity.java b/src/org/thialfihar/android/apg/PublicKeyListActivity.java index 4cc3b4df9..509a81374 100644 --- a/src/org/thialfihar/android/apg/PublicKeyListActivity.java +++ b/src/org/thialfihar/android/apg/PublicKeyListActivity.java @@ -16,7 +16,7 @@ package org.thialfihar.android.apg; -import org.bouncycastle2.openpgp.PGPPublicKeyRing; +import org.spongycastle.openpgp.PGPPublicKeyRing; import android.content.Intent; import android.os.Bundle; diff --git a/src/org/thialfihar/android/apg/provider/Database.java b/src/org/thialfihar/android/apg/provider/Database.java index 05beb980d..064d90f7f 100644 --- a/src/org/thialfihar/android/apg/provider/Database.java +++ b/src/org/thialfihar/android/apg/provider/Database.java @@ -5,11 +5,11 @@ import java.util.Date; import java.util.HashMap; import java.util.Vector; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPPublicKey; -import org.bouncycastle2.openpgp.PGPPublicKeyRing; -import org.bouncycastle2.openpgp.PGPSecretKey; -import org.bouncycastle2.openpgp.PGPSecretKeyRing; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPPublicKey; +import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.spongycastle.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPSecretKeyRing; import org.thialfihar.android.apg.Apg; import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.utils.IterableIterator; diff --git a/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java b/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java index dbdae9def..2266a266b 100644 --- a/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java +++ b/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java @@ -22,8 +22,8 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.Vector; -import org.bouncycastle2.openpgp.PGPPublicKey; -import org.bouncycastle2.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPPublicKey; +import org.spongycastle.openpgp.PGPSecretKey; import org.thialfihar.android.apg.Apg; import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.R; diff --git a/src/org/thialfihar/android/apg/ui/widget/SectionView.java b/src/org/thialfihar/android/apg/ui/widget/SectionView.java index 124c1c9da..f726903f7 100644 --- a/src/org/thialfihar/android/apg/ui/widget/SectionView.java +++ b/src/org/thialfihar/android/apg/ui/widget/SectionView.java @@ -22,8 +22,8 @@ import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.util.Vector; -import org.bouncycastle2.openpgp.PGPException; -import org.bouncycastle2.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPException; +import org.spongycastle.openpgp.PGPSecretKey; import org.thialfihar.android.apg.Apg; import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.R; |