Rename package

This commit is contained in:
AsamK 2015-12-13 11:05:08 +01:00
parent 5859e7b9f7
commit 27d9424f1e
17 changed files with 27 additions and 20 deletions

View file

@ -4,7 +4,7 @@ apply plugin: 'application'
sourceCompatibility = JavaVersion.VERSION_1_7 sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7
mainClassName = 'cli.Main' mainClassName = 'org.asamk.textsecure.Main'
version = '0.1.0' version = '0.1.0'

View file

@ -1,5 +1,7 @@
package cli; package org.asamk;
import org.asamk.textsecure.AttachmentInvalidException;
import org.asamk.textsecure.GroupNotFoundException;
import org.freedesktop.dbus.DBusInterface; import org.freedesktop.dbus.DBusInterface;
import org.whispersystems.textsecure.api.push.exceptions.EncapsulatedExceptions; import org.whispersystems.textsecure.api.push.exceptions.EncapsulatedExceptions;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
public class AttachmentInvalidException extends Exception { public class AttachmentInvalidException extends Exception {
private final String attachment; private final String attachment;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
/** /**
* <p>Encodes and decodes to and from Base64 notation.</p> * <p>Encodes and decodes to and from Base64 notation.</p>

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
public class GroupNotFoundException extends Exception { public class GroupNotFoundException extends Exception {
private final byte[] groupId; private final byte[] groupId;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;

View file

@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package cli; package org.asamk.textsecure;
import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.impl.Arguments; import net.sourceforge.argparse4j.impl.Arguments;
import net.sourceforge.argparse4j.inf.*; import net.sourceforge.argparse4j.inf.*;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.asamk.TextSecure;
import org.freedesktop.dbus.DBusConnection; import org.freedesktop.dbus.DBusConnection;
import org.freedesktop.dbus.exceptions.DBusException; import org.freedesktop.dbus.exceptions.DBusException;
import org.whispersystems.textsecure.api.crypto.UntrustedIdentityException; import org.whispersystems.textsecure.api.crypto.UntrustedIdentityException;
@ -38,6 +39,9 @@ import java.util.List;
public class Main { public class Main {
public static final String TEXTSECURE_BUSNAME = "org.asamk.TextSecure";
public static final String TEXTSECURE_OBJECTPATH = "/org/asamk/TextSecure";
public static void main(String[] args) { public static void main(String[] args) {
// Workaround for BKS truststore // Workaround for BKS truststore
Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1); Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1);
@ -63,7 +67,7 @@ public class Main {
} }
dBusConn = DBusConnection.getConnection(busType); dBusConn = DBusConnection.getConnection(busType);
ts = (TextSecure) dBusConn.getRemoteObject( ts = (TextSecure) dBusConn.getRemoteObject(
"org.asamk.TextSecure", "/org/asamk/TextSecure", TEXTSECURE_BUSNAME, TEXTSECURE_OBJECTPATH,
TextSecure.class); TextSecure.class);
} catch (DBusException e) { } catch (DBusException e) {
e.printStackTrace(); e.printStackTrace();
@ -284,8 +288,8 @@ public class Main {
busType = DBusConnection.SESSION; busType = DBusConnection.SESSION;
} }
conn = DBusConnection.getConnection(busType); conn = DBusConnection.getConnection(busType);
conn.requestBusName("org.asamk.TextSecure"); conn.requestBusName(TEXTSECURE_BUSNAME);
conn.exportObject("/org/asamk/TextSecure", m); conn.exportObject(TEXTSECURE_OBJECTPATH, m);
} catch (DBusException e) { } catch (DBusException e) {
e.printStackTrace(); e.printStackTrace();
System.exit(3); System.exit(3);

View file

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package cli; package org.asamk.textsecure;
import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.annotation.PropertyAccessor;
@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
import org.asamk.TextSecure;
import org.whispersystems.libaxolotl.*; import org.whispersystems.libaxolotl.*;
import org.whispersystems.libaxolotl.ecc.Curve; import org.whispersystems.libaxolotl.ecc.Curve;
import org.whispersystems.libaxolotl.ecc.ECKeyPair; import org.whispersystems.libaxolotl.ecc.ECKeyPair;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom; import java.security.SecureRandom;

View file

@ -1,4 +1,4 @@
package cli; package org.asamk.textsecure;
import org.whispersystems.textsecure.api.push.TrustStore; import org.whispersystems.textsecure.api.push.TrustStore;
@ -8,7 +8,7 @@ class WhisperTrustStore implements TrustStore {
@Override @Override
public InputStream getKeyStoreInputStream() { public InputStream getKeyStoreInputStream() {
return cli.WhisperTrustStore.class.getResourceAsStream("whisper.store"); return WhisperTrustStore.class.getResourceAsStream("whisper.store");
} }
@Override @Override