1) move PUSH_URL from Release.java into BuildConfig.java

2) use textsecure-service-staging.whispersystems.org for test build

// FREEBIE

hack
This commit is contained in:
Rhodey Orbits 2015-05-14 18:14:42 -07:00 committed by Moxie Marlinspike
parent ce77cb81df
commit e3760630bf
5 changed files with 11 additions and 16 deletions

View file

@ -141,6 +141,7 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L" buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
buildConfigField "String", "PUSH_URL", "\"https://textsecure-service.whispersystems.org\""
} }
compileOptions { compileOptions {
@ -186,6 +187,7 @@ android {
testing.initWith(buildTypes.debug) testing.initWith(buildTypes.debug)
testing { testing {
proguardFile 'proguard-testing.pro' proguardFile 'proguard-testing.pro'
buildConfigField "String", "PUSH_URL", "\"https://textsecure-service-staging.whispersystems.org\""
} }
} }

View file

@ -1,7 +0,0 @@
package org.thoughtcrime.securesms;
public class Release {
public static final String PUSH_URL = "https://textsecure-service.whispersystems.org";
// public static final String PUSH_URL = "http://192.168.1.135:8080";
}

View file

@ -2,7 +2,7 @@ package org.thoughtcrime.securesms.dependencies;
import android.content.Context; import android.content.Context;
import org.thoughtcrime.securesms.Release; import org.thoughtcrime.securesms.BuildConfig;
import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.storage.TextSecureAxolotlStore; import org.thoughtcrime.securesms.crypto.storage.TextSecureAxolotlStore;
import org.thoughtcrime.securesms.jobs.AttachmentDownloadJob; import org.thoughtcrime.securesms.jobs.AttachmentDownloadJob;
@ -47,7 +47,7 @@ public class TextSecureCommunicationModule {
} }
@Provides TextSecureAccountManager provideTextSecureAccountManager() { @Provides TextSecureAccountManager provideTextSecureAccountManager() {
return new TextSecureAccountManager(Release.PUSH_URL, return new TextSecureAccountManager(BuildConfig.PUSH_URL,
new TextSecurePushTrustStore(context), new TextSecurePushTrustStore(context),
TextSecurePreferences.getLocalNumber(context), TextSecurePreferences.getLocalNumber(context),
TextSecurePreferences.getPushServerPassword(context)); TextSecurePreferences.getPushServerPassword(context));
@ -57,7 +57,7 @@ public class TextSecureCommunicationModule {
return new TextSecureMessageSenderFactory() { return new TextSecureMessageSenderFactory() {
@Override @Override
public TextSecureMessageSender create(MasterSecret masterSecret) { public TextSecureMessageSender create(MasterSecret masterSecret) {
return new TextSecureMessageSender(Release.PUSH_URL, return new TextSecureMessageSender(BuildConfig.PUSH_URL,
new TextSecurePushTrustStore(context), new TextSecurePushTrustStore(context),
TextSecurePreferences.getLocalNumber(context), TextSecurePreferences.getLocalNumber(context),
TextSecurePreferences.getPushServerPassword(context), TextSecurePreferences.getPushServerPassword(context),
@ -69,7 +69,7 @@ public class TextSecureCommunicationModule {
} }
@Provides TextSecureMessageReceiver provideTextSecureMessageReceiver() { @Provides TextSecureMessageReceiver provideTextSecureMessageReceiver() {
return new TextSecureMessageReceiver(Release.PUSH_URL, return new TextSecureMessageReceiver(BuildConfig.PUSH_URL,
new TextSecurePushTrustStore(context), new TextSecurePushTrustStore(context),
new DynamicCredentialsProvider(context)); new DynamicCredentialsProvider(context));
} }

View file

@ -5,7 +5,7 @@ import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.util.Log; import android.util.Log;
import org.thoughtcrime.securesms.Release; import org.thoughtcrime.securesms.BuildConfig;
import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.GroupDatabase; import org.thoughtcrime.securesms.database.GroupDatabase;
@ -95,7 +95,7 @@ public class AvatarDownloadJob extends MasterSecretJob {
} }
private File downloadAttachment(String relay, long contentLocation) throws IOException { private File downloadAttachment(String relay, long contentLocation) throws IOException {
PushServiceSocket socket = new PushServiceSocket(Release.PUSH_URL, PushServiceSocket socket = new PushServiceSocket(BuildConfig.PUSH_URL,
new TextSecurePushTrustStore(context), new TextSecurePushTrustStore(context),
new StaticCredentialsProvider(TextSecurePreferences.getLocalNumber(context), new StaticCredentialsProvider(TextSecurePreferences.getLocalNumber(context),
TextSecurePreferences.getPushServerPassword(context), TextSecurePreferences.getPushServerPassword(context),

View file

@ -2,7 +2,7 @@ package org.thoughtcrime.securesms.push;
import android.content.Context; import android.content.Context;
import org.thoughtcrime.securesms.Release; import org.thoughtcrime.securesms.BuildConfig;
import org.thoughtcrime.securesms.crypto.SecurityEvent; import org.thoughtcrime.securesms.crypto.SecurityEvent;
import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.storage.TextSecureAxolotlStore; import org.thoughtcrime.securesms.crypto.storage.TextSecureAxolotlStore;
@ -20,14 +20,14 @@ import static org.whispersystems.textsecure.api.TextSecureMessageSender.EventLis
public class TextSecureCommunicationFactory { public class TextSecureCommunicationFactory {
public static TextSecureAccountManager createManager(Context context) { public static TextSecureAccountManager createManager(Context context) {
return new TextSecureAccountManager(Release.PUSH_URL, return new TextSecureAccountManager(BuildConfig.PUSH_URL,
new TextSecurePushTrustStore(context), new TextSecurePushTrustStore(context),
TextSecurePreferences.getLocalNumber(context), TextSecurePreferences.getLocalNumber(context),
TextSecurePreferences.getPushServerPassword(context)); TextSecurePreferences.getPushServerPassword(context));
} }
public static TextSecureAccountManager createManager(Context context, String number, String password) { public static TextSecureAccountManager createManager(Context context, String number, String password) {
return new TextSecureAccountManager(Release.PUSH_URL, new TextSecurePushTrustStore(context), return new TextSecureAccountManager(BuildConfig.PUSH_URL, new TextSecurePushTrustStore(context),
number, password); number, password);
} }