Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Lyndir/MasterPassword
Browse files Browse the repository at this point in the history
Conflicts:
	.gitmodules
  • Loading branch information
lhunath committed Dec 19, 2013
2 parents 4c3d323 + d543173 commit f5c66ff
Show file tree
Hide file tree
Showing 18 changed files with 2,116 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
[submodule "External/RHStatusItemView"]
path = External/RHStatusItemView
url = git://github.com/lhunath/RHStatusItemView.git
[submodule "External/DCIntrospect"]
path = External/DCIntrospect
url = https://github.com/lhunath/DCIntrospect.git
[submodule "External/LoveLyndir"]
path = External/LoveLyndir
url = git://github.com/Lyndir/love-lyndir.client.git
[submodule "External/DCIntrospect"]
path = External/DCIntrospect
url = https://github.com/lhunath/DCIntrospect.git
Empty file added MasterPassword/Java/.mvn-tools
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ public MPTemplates(final Map<MPElementType, List<MPTemplate>> templates) {
this.templates = templates;
}

public static MPTemplates load() {

return loadFromPList( "ciphers.plist" );
}

public static MPTemplates loadFromPList(final String templateResource) {

@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
InputStream templateStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( templateResource );
Preconditions.checkNotNull( templateStream, "Not found: %s", templateResource );
try {
NSObject plistObject = PropertyListParser.parse( templateStream );
Preconditions.checkState( NSDictionary.class.isAssignableFrom( plistObject.getClass() ) );
Expand Down Expand Up @@ -98,6 +104,6 @@ public MPTemplate getTemplateForTypeAtRollingIndex(final MPElementType type, fin

public static void main(final String... arguments) {

loadFromPList( "templates.plist" );
load();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class MasterPassword {
private static final ByteOrder MP_byteOrder = ByteOrder.BIG_ENDIAN;
private static final MessageDigests MP_hash = MessageDigests.SHA256;
private static final MessageAuthenticationDigests MP_mac = MessageAuthenticationDigests.HmacSHA256;
private static final MPTemplates templates = MPTemplates.loadFromPList( "templates.plist" );
private static final MPTemplates templates = MPTemplates.load();

public static byte[] keyForPassword(final String password, final String username) {

Expand Down
49 changes: 34 additions & 15 deletions MasterPassword/Java/masterpassword-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,49 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.lyndir.lhunath.masterpassword.CLI</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>prepare-package</id>
<phase>prepare-package</phase>
<configuration>
<target>
<chmod file="${project.build.directory}/install" perm="755"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
<goal>shade</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.lyndir.lhunath.masterpassword.CLI</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
Expand Down
Loading

0 comments on commit f5c66ff

Please sign in to comment.