Skip to content

Commit

Permalink
Remove Proguard
Browse files Browse the repository at this point in the history
Proguard usage was introduced when this was a commercial product and we wanted obfuscation, but now it's open source having the stack traces easily understandable is more useful.
  • Loading branch information
alsutton committed Jun 27, 2020
1 parent c8595e4 commit 7907e5f
Show file tree
Hide file tree
Showing 79 changed files with 121 additions and 371 deletions.
79 changes: 1 addition & 78 deletions build.gradle
Expand Up @@ -44,7 +44,6 @@ buildscript {
}

dependencies {
classpath 'net.sf.proguard:proguard-gradle:6.2.2'
classpath 'com.bmuschko:gradle-tomcat-plugin:2.5'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.2.0'
}
Expand All @@ -67,80 +66,4 @@ jacocoTestReport {
csv.enabled false
html.destination file("${buildDir}/reports/coverage")
}
}

task proguard(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
configurations.runtime.each {
println it
}

injars jar.archivePath

outjars 'passwordsafe.jar'

libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
libraryjars "${System.getProperty('java.home')}/lib/jce.jar"
libraryjars(configurations.runtime)

printmapping 'proguard.map'

dontusemixedcaseclassnames
dontshrink

keepclassmembers 'class * extends java.lang.Enum { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'

keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'

keep 'public class * implements javax.servlet.Filter'
keep 'public class * implements javax.servlet.Servlet'

keep 'public class com.enterprisepasswordsafe.engine.configuration.JDBCConfiguration'
keep 'public class * implements com.enterprisepasswordsafe.engine.dbabstraction.AbstractDAL'
keep 'public interface com.enterprisepasswordsafe.engine.integration.PasswordChanger'
keep 'public class com.enterprisepasswordsafe.engine.integration.PasswordChangerProperty'
keep 'public class * implements com.enterprisepasswordsafe.engine.integration.PasswordChanger { \
public void rollbackChange(java.sql.Connection, java.util.Map, java.util.Map, java.lang.String); \
public void changePassword(java.sql.Connection, java.util.Map, java.util.Map, java.lang.String); \
public java.util.List getProperties(); \
public void install(java.sql.Connection); \
public void uninstall(java.sql.Connection); \
}'
keepclassmembers 'public class * implements javax.security.auth.spi.LoginModule { \
void initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map<java.lang.String,?>, java.util.Map<java.lang.String,?>); \
boolean login(); \
boolean commit(); \
boolean abort(); \
boolean logout(); \
}'

keep 'public interface com.enterprisepasswordsafe.proguard.ExternalInterface'
keep 'public class * implements com.enterprisepasswordsafe.proguard.ExternalInterface { \
public *** *; \
public *** *(...); \
}'

keep 'public interface com.enterprisepasswordsafe.proguard.JavaBean'
keep 'public class * implements com.enterprisepasswordsafe.proguard.JavaBean { \
void set*(***); \
void set*(int, ***); \
boolean is*(); \
boolean is*(int); \
*** get*(); \
*** get*(int); \
}'

keepclassmembers 'public class com.enterprisepasswordsafe.engine.database.ConfigurationListenersDAO { \
void addListener( java.lang.String, com.enterprisepasswordsafe.engine.database.ConfigurationListenersDAO$ConfigurationListener ); \
}'

}
}
Expand Up @@ -16,18 +16,14 @@

package com.enterprisepasswordsafe.engine;

import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;

import com.enterprisepasswordsafe.engine.database.Decrypter;
import com.enterprisepasswordsafe.engine.database.Encrypter;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Interface implemented by any object capable of decrypting an access control.
*/

public interface AccessControlDecryptor extends ExternalInterface {
public interface AccessControlDecryptor {

/**
* Gets the key decrypter method for use with the keystore
Expand Down
Expand Up @@ -16,17 +16,10 @@

package com.enterprisepasswordsafe.engine.configuration;

import com.enterprisepasswordsafe.engine.dbabstraction.SupportedDatabase;
import com.enterprisepasswordsafe.engine.preferences.PreferencesRepository;
import com.enterprisepasswordsafe.engine.preferences.UserPreferencesRepository;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.List;

public class EnvironmentVariableBackedJDBCConfigurationRepository
implements JDBCConfigurationRepository, ExternalInterface {
implements JDBCConfigurationRepository {

private JDBCConnectionInformation connectionInformation;

Expand Down
Expand Up @@ -18,14 +18,12 @@

import com.enterprisepasswordsafe.engine.accesscontrol.AccessControl;
import com.enterprisepasswordsafe.engine.users.UserClassifier;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.sql.SQLException;

public abstract class AccessControlDAO
implements ExternalInterface {
public abstract class AccessControlDAO {

private UserClassifier userClassifier = new UserClassifier();

Expand Down
Expand Up @@ -16,15 +16,13 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.JavaBean;

import java.security.PrivateKey;
import java.security.PublicKey;

/**
* Interface implemented by all objects which are subject to access control.
*/
public interface AccessControledObject extends JavaBean {
public interface AccessControledObject {

/**
* Return the ID of the object
Expand Down
Expand Up @@ -16,17 +16,14 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.ExternalInterface;
import com.enterprisepasswordsafe.proguard.JavaBean;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
* Base class for all access roles for restricted access items.
*/

public abstract class AccessRole implements ExternalInterface {
public abstract class AccessRole {
/**
* The requestor-only role
*/
Expand Down Expand Up @@ -156,7 +153,7 @@ public void setRole(String role) {
*/

public static class ApproverSummary
implements Comparable<ApproverSummary>, JavaBean {
implements Comparable<ApproverSummary> {
/**
* The ID of the approver.
*/
Expand Down
Expand Up @@ -23,13 +23,11 @@
import java.util.Set;

import com.enterprisepasswordsafe.engine.database.AccessRole.ApproverSummary;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Data access object for the user objects.
*/
public final class AccessRoleDAO
implements ExternalInterface {
public final class AccessRoleDAO {

/**
* The SQL to get an access role for a particular actor
Expand Down
Expand Up @@ -16,13 +16,11 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.JavaBean;

/**
* Summary of a group holding only it's group name and id.
*/
public class AccessSummary
implements Comparable<AccessSummary>, JavaBean {
implements Comparable<AccessSummary> {

/**
* The actor id.
Expand Down
Expand Up @@ -16,13 +16,10 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Class holding the list of approvers for a particular item.
*/
public class ApproverList
implements ExternalInterface {
public class ApproverList {

/**
* The state marker for a user who has approved a request.
Expand Down
Expand Up @@ -25,13 +25,12 @@

import com.enterprisepasswordsafe.engine.utils.DateFormatter;
import com.enterprisepasswordsafe.engine.utils.IDGenerator;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Data access object for the user objects.
*/

public final class ApproverListDAO implements ExternalInterface {
public final class ApproverListDAO {

/**
* SQL to count the number of approvers in this list.
Expand Down
Expand Up @@ -29,15 +29,13 @@
import com.enterprisepasswordsafe.engine.jaas.LDAPLoginModule;
import com.enterprisepasswordsafe.engine.jaas.LDAPSearchAndBindLoginModule;
import com.enterprisepasswordsafe.engine.utils.IDGenerator;
import com.enterprisepasswordsafe.proguard.ExternalInterface;


/**
* Class representing an authentication source.
*/

public final class AuthenticationSource
implements Comparable<AuthenticationSource>, ExternalInterface {
implements Comparable<AuthenticationSource> {

/**
* The name parameter.
Expand Down
Expand Up @@ -27,16 +27,11 @@
import java.util.List;
import java.util.Map;

import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Data access object for the user access control.
*
* @author Compaq_Owner
*/

public class AuthenticationSourceDAO
implements ExternalInterface {
public class AuthenticationSourceDAO {

/**
* The SQL to get all the properties associated with a authorisation source.
Expand Down
Expand Up @@ -19,20 +19,16 @@
import java.security.GeneralSecurityException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.enterprisepasswordsafe.engine.Repositories;
import com.enterprisepasswordsafe.engine.configuration.JDBCConnectionInformation;
import com.enterprisepasswordsafe.engine.dbabstraction.DALInterface;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Factory for handling and releasing business object managers.
*/

public final class BOMFactory
implements ExternalInterface {
public final class BOMFactory {

//---------------------------------------

Expand Down
Expand Up @@ -16,8 +16,6 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.ExternalInterface;

/**
* Object responsible for handling user configuration options.
*/
Expand Down
Expand Up @@ -23,11 +23,8 @@
import java.util.List;
import java.util.Map;

import com.enterprisepasswordsafe.proguard.ExternalInterface;

public final class ConfigurationDAO
extends JDBCBase
implements ExternalInterface {
extends JDBCBase {

private static final String GET_SQL =
"SELECT property_value FROM configuration WHERE property_name = ?";
Expand Down
Expand Up @@ -16,14 +16,12 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.ExternalInterface;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public final class ConfigurationListenersDAO implements ExternalInterface {
public final class ConfigurationListenersDAO {

private static final Map<String, List<ConfigurationListener>> listeners = new HashMap<>();

Expand All @@ -48,8 +46,8 @@ public static List<ConfigurationListener> getListenersForProperty( String proper
}
}

public interface ConfigurationListener extends ExternalInterface {
public void configurationChange( String propertyName, String propertyValue );
public interface ConfigurationListener {
void configurationChange(String propertyName, String propertyValue);
}

}
Expand Up @@ -17,9 +17,8 @@
package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.engine.passwords.AuditingLevel;
import com.enterprisepasswordsafe.proguard.ExternalInterface;

public enum ConfigurationOption implements ExternalInterface {
public enum ConfigurationOption {

ALLOW_BACK_BUTTON_TO_ACCESS_PASSWORD("password.back_to_password_allowed", "false"),
DAYS_BEFORE_EXPIRY_TO_WARN("EPASSWARN", null),
Expand Down
Expand Up @@ -16,14 +16,12 @@

package com.enterprisepasswordsafe.engine.database;

import com.enterprisepasswordsafe.proguard.ExternalInterface;

import java.security.GeneralSecurityException;

/**
* Interface for classes which can decrypt access keys.
*/
public interface Encrypter extends ExternalInterface {
public interface Encrypter {

/**
* Encrypt a byte array and return a byte array which is the encrypted data.
Expand All @@ -32,5 +30,5 @@ public interface Encrypter extends ExternalInterface {
*
* @return The encrypted data.
*/
public byte[] encrypt(byte[] data) throws GeneralSecurityException;
byte[] encrypt(byte[] data) throws GeneralSecurityException;
}

0 comments on commit 7907e5f

Please sign in to comment.