Created
January 27, 2017 05:22
-
-
Save Stuie/d3a3971cda79fa394df9c8121debb0ae to your computer and use it in GitHub Desktop.
A diff to add Hugo to Signal for timing app start methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/build.gradle b/build.gradle | |
index 11b5606..3101a79 100644 | |
--- a/build.gradle | |
+++ b/build.gradle | |
@@ -6,6 +6,7 @@ buildscript { | |
} | |
} | |
dependencies { | |
+ classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1' | |
classpath 'com.android.tools.build:gradle:2.2.3' | |
classpath files('libs/gradle-witness.jar') | |
} | |
@@ -13,6 +14,7 @@ buildscript { | |
apply plugin: 'com.android.application' | |
apply plugin: 'witness' | |
+apply plugin: 'com.jakewharton.hugo' | |
repositories { | |
maven { | |
diff --git a/src/org/thoughtcrime/securesms/ApplicationContext.java b/src/org/thoughtcrime/securesms/ApplicationContext.java | |
index 63a36dc..6c634e7 100644 | |
--- a/src/org/thoughtcrime/securesms/ApplicationContext.java | |
+++ b/src/org/thoughtcrime/securesms/ApplicationContext.java | |
@@ -49,6 +49,7 @@ import org.whispersystems.libsignal.logging.SignalProtocolLoggerProvider; | |
import org.whispersystems.libsignal.util.AndroidSignalProtocolLogger; | |
import dagger.ObjectGraph; | |
+import hugo.weaving.DebugLog; | |
/** | |
* Will be called once when the TextSecure process is created. | |
@@ -72,6 +73,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc | |
return (ApplicationContext)context.getApplicationContext(); | |
} | |
+ @DebugLog | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
@@ -102,6 +104,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc | |
return expiringMessageManager; | |
} | |
+ @DebugLog | |
private void initializeDeveloperBuild() { | |
if (BuildConfig.DEV_BUILD) { | |
StrictMode.setThreadPolicy(new ThreadPolicy.Builder().detectAll() | |
@@ -111,14 +114,17 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc | |
} | |
} | |
+ @DebugLog | |
private void initializeRandomNumberFix() { | |
PRNGFixes.apply(); | |
} | |
+ @DebugLog | |
private void initializeLogging() { | |
SignalProtocolLoggerProvider.setProvider(new AndroidSignalProtocolLogger()); | |
} | |
+ @DebugLog | |
private void initializeJobManager() { | |
this.jobManager = JobManager.newBuilder(this) | |
.withName("TextSecureJobs") | |
@@ -136,12 +142,14 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc | |
mediaNetworkRequirementProvider.notifyMediaControlEvent(); | |
} | |
+ @DebugLog | |
private void initializeDependencyInjection() { | |
this.objectGraph = ObjectGraph.create(new SignalCommunicationModule(this, new SignalServiceNetworkAccess(this)), | |
new RedPhoneCommunicationModule(this), | |
new AxolotlStorageModule(this)); | |
} | |
+ @DebugLog | |
private void initializeGcmCheck() { | |
if (TextSecurePreferences.isPushRegistered(this) && | |
TextSecurePreferences.getGcmRegistrationId(this) == null) | |
@@ -150,23 +158,28 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc | |
} | |
} | |
+ @DebugLog | |
private void initializeSignedPreKeyCheck() { | |
if (!TextSecurePreferences.isSignedPreKeyRegistered(this)) { | |
jobManager.add(new CreateSignedPreKeyJob(this)); | |
} | |
} | |
+ @DebugLog | |
private void initializeExpiringMessageManager() { | |
this.expiringMessageManager = new ExpiringMessageManager(this); | |
} | |
+ @DebugLog | |
private void initializePeriodicTasks() { | |
RotateSignedPreKeyListener.schedule(this); | |
DirectoryRefreshListener.schedule(this); | |
} | |
+ @DebugLog | |
private void initializeCircumvention() { | |
new AsyncTask<Void, Void, Void>() { | |
+ @DebugLog | |
@Override | |
protected Void doInBackground(Void... params) { | |
if (new SignalServiceNetworkAccess(ApplicationContext.this).isCensored(ApplicationContext.this)) { | |
diff --git a/src/org/thoughtcrime/securesms/ConversationListActivity.java b/src/org/thoughtcrime/securesms/ConversationListActivity.java | |
index 2533d61..69a5c21 100644 | |
--- a/src/org/thoughtcrime/securesms/ConversationListActivity.java | |
+++ b/src/org/thoughtcrime/securesms/ConversationListActivity.java | |
@@ -45,6 +45,8 @@ import org.thoughtcrime.securesms.util.DynamicLanguage; | |
import org.thoughtcrime.securesms.util.DynamicTheme; | |
import org.thoughtcrime.securesms.util.TextSecurePreferences; | |
+import hugo.weaving.DebugLog; | |
+ | |
public class ConversationListActivity extends PassphraseRequiredActionBarActivity | |
implements ConversationListFragment.ConversationSelectedListener | |
{ | |
@@ -57,12 +59,14 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit | |
private ContentObserver observer; | |
private MasterSecret masterSecret; | |
+ @DebugLog | |
@Override | |
protected void onPreCreate() { | |
dynamicTheme.onCreate(this); | |
dynamicLanguage.onCreate(this); | |
} | |
+ @DebugLog | |
@Override | |
protected void onCreate(Bundle icicle, @NonNull MasterSecret masterSecret) { | |
this.masterSecret = masterSecret; | |
@@ -76,6 +80,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit | |
RatingManager.showRatingDialogIfNecessary(this); | |
} | |
+ @DebugLog | |
@Override | |
public void onResume() { | |
super.onResume(); | |
@@ -221,6 +226,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit | |
} | |
} | |
+ @DebugLog | |
private void initializeContactUpdatesReceiver() { | |
observer = new ContentObserver(null) { | |
@Override | |
diff --git a/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java b/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java | |
index 0d7d364..a271e1a 100644 | |
--- a/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java | |
+++ b/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java | |
@@ -21,6 +21,8 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences; | |
import java.util.Locale; | |
+import hugo.weaving.DebugLog; | |
+ | |
public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarActivity implements MasterSecretListener { | |
private static final String TAG = PassphraseRequiredActionBarActivity.class.getSimpleName(); | |
@@ -98,6 +100,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA | |
return initFragment(target, fragment, masterSecret, null); | |
} | |
+ @DebugLog | |
protected <T extends Fragment> T initFragment(@IdRes int target, | |
@NonNull T fragment, | |
@NonNull MasterSecret masterSecret, | |
diff --git a/src/org/thoughtcrime/securesms/components/RatingManager.java b/src/org/thoughtcrime/securesms/components/RatingManager.java | |
index e06cbb9..6f576e6 100644 | |
--- a/src/org/thoughtcrime/securesms/components/RatingManager.java | |
+++ b/src/org/thoughtcrime/securesms/components/RatingManager.java | |
@@ -15,6 +15,8 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences; | |
import java.util.concurrent.TimeUnit; | |
+import hugo.weaving.DebugLog; | |
+ | |
public class RatingManager { | |
private static final int DAYS_SINCE_INSTALL_THRESHOLD = 7; | |
@@ -22,6 +24,7 @@ public class RatingManager { | |
private static final String TAG = RatingManager.class.getSimpleName(); | |
+ @DebugLog | |
public static void showRatingDialogIfNecessary(Context context) { | |
if (!TextSecurePreferences.isRatingEnabled(context)) return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment