kopia lustrzana https://github.com/ryukoposting/Signal-Android
Remove aspectj for now.
rodzic
6cbd68fe9f
commit
59f7ee6682
|
@ -16,10 +16,9 @@ buildscript {
|
|||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.2'
|
||||
classpath 'com.android.tools.build:gradle:4.1.1'
|
||||
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
|
||||
classpath 'com.archinamon:android-gradle-aspectj:4.2.0'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,22 +26,9 @@ apply plugin: 'com.android.application'
|
|||
apply plugin: 'com.google.protobuf'
|
||||
apply plugin: 'androidx.navigation.safeargs'
|
||||
apply plugin: 'witness'
|
||||
apply plugin: 'com.archinamon.aspectj-ext'
|
||||
apply from: 'translations.gradle'
|
||||
apply from: 'witness-verifications.gradle'
|
||||
|
||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Internal")) {
|
||||
aspectj {
|
||||
includeJar 'sqlcipher'
|
||||
includeAspectsFromJar 'Signal-Android'
|
||||
java = JavaVersion.VERSION_1_8
|
||||
}
|
||||
} else if (getGradle().getStartParameter().getTaskRequests().toString().contains("Test")) {
|
||||
aspectj {
|
||||
compileTests = false
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "https://raw.github.com/signalapp/maven/master/photoview/releases/"
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
package org.thoughtcrime.securesms.tracing;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
|
||||
/**
|
||||
* Uses AspectJ to augment relevant methods to be traced with the {@link TracerImpl}.
|
||||
*/
|
||||
@Aspect
|
||||
public class TraceAspect {
|
||||
|
||||
@Pointcut("within(@org.thoughtcrime.securesms.tracing.Trace *)")
|
||||
public void withinAnnotatedClass() {}
|
||||
|
||||
@Pointcut("execution(!synthetic * *(..)) && withinAnnotatedClass()")
|
||||
public void methodInsideAnnotatedType() {}
|
||||
|
||||
@Pointcut("execution(!synthetic *.new(..)) && withinAnnotatedClass()")
|
||||
public void constructorInsideAnnotatedType() {}
|
||||
|
||||
@Pointcut("execution(@org.thoughtcrime.securesms.tracing.Trace * *(..)) || methodInsideAnnotatedType()")
|
||||
public void annotatedMethod() {}
|
||||
|
||||
@Pointcut("execution(@org.thoughtcrime.securesms.tracing.Trace *.new(..)) || constructorInsideAnnotatedType()")
|
||||
public void annotatedConstructor() {}
|
||||
|
||||
@Pointcut("execution(* *(..)) && within(net.sqlcipher.database.*)")
|
||||
public void sqlcipher() {}
|
||||
|
||||
@Pointcut("execution(* net.sqlcipher.database.SQLiteDatabase.rawQuery(..)) || " +
|
||||
"execution(* net.sqlcipher.database.SQLiteDatabase.query(..)) || " +
|
||||
"execution(* net.sqlcipher.database.SQLiteDatabase.insert(..)) || " +
|
||||
"execution(* net.sqlcipher.database.SQLiteDatabase.insertOrThrow(..)) || " +
|
||||
"execution(* net.sqlcipher.database.SQLiteDatabase.insertWithOnConflict(..)) || " +
|
||||
"execution(* net.sqlcipher.database.SQLiteDatabase.delete(..)) || " +
|
||||
"execution(* net.sqlcipher.database.SQLiteDatabase.update(..))")
|
||||
public void sqlcipherQuery() {}
|
||||
|
||||
@Around("annotatedMethod() || annotatedConstructor() || (sqlcipher() && !sqlcipherQuery())")
|
||||
public @NonNull Object profile(@NonNull ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
String methodName = joinPoint.getSignature().toShortString();
|
||||
|
||||
Tracer.getInstance().start(methodName);
|
||||
Object result = joinPoint.proceed();
|
||||
Tracer.getInstance().end(methodName);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Around("sqlcipherQuery()")
|
||||
public @NonNull Object profileQuery(@NonNull ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
String table;
|
||||
String query;
|
||||
|
||||
if (joinPoint.getSignature().getName().equals("query")) {
|
||||
if (joinPoint.getArgs().length == 9) {
|
||||
table = (String) joinPoint.getArgs()[1];
|
||||
query = (String) joinPoint.getArgs()[3];
|
||||
} else if (joinPoint.getArgs().length == 7 || joinPoint.getArgs().length == 8) {
|
||||
table = (String) joinPoint.getArgs()[0];
|
||||
query = (String) joinPoint.getArgs()[2];
|
||||
} else {
|
||||
table = "N/A";
|
||||
query = "N/A";
|
||||
}
|
||||
} else if (joinPoint.getSignature().getName().equals("rawQuery")) {
|
||||
table = "";
|
||||
query = (String) joinPoint.getArgs()[0];
|
||||
} else if (joinPoint.getSignature().getName().equals("insert")) {
|
||||
table = (String) joinPoint.getArgs()[0];
|
||||
query = "";
|
||||
} else if (joinPoint.getSignature().getName().equals("insertOrThrow")) {
|
||||
table = (String) joinPoint.getArgs()[0];
|
||||
query = "";
|
||||
} else if (joinPoint.getSignature().getName().equals("insertWithOnConflict")) {
|
||||
table = (String) joinPoint.getArgs()[0];
|
||||
query = "";
|
||||
} else if (joinPoint.getSignature().getName().equals("delete")) {
|
||||
table = (String) joinPoint.getArgs()[0];
|
||||
query = (String) joinPoint.getArgs()[1];
|
||||
} else if (joinPoint.getSignature().getName().equals("update")) {
|
||||
table = (String) joinPoint.getArgs()[0];
|
||||
query = (String) joinPoint.getArgs()[2];
|
||||
} else {
|
||||
table = "N/A";
|
||||
query = "N/A";
|
||||
}
|
||||
|
||||
query = query == null ? "null" : query;
|
||||
query = "[" + table + "] " + query;
|
||||
|
||||
String methodName = joinPoint.getSignature().toShortString();
|
||||
|
||||
Tracer.getInstance().start(methodName, "query", query);
|
||||
Object result = joinPoint.proceed();
|
||||
Tracer.getInstance().end(methodName);
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -420,9 +420,6 @@ dependencyVerification {
|
|||
['org.apache.httpcomponents:httpclient-android:4.3.5',
|
||||
'6f56466a9bd0d42934b90bfbfe9977a8b654c058bf44a12bdc2877c4e1f033f1'],
|
||||
|
||||
['org.aspectj:aspectjrt:1.9.4',
|
||||
'4ff12340d4f1197b95fc9d53dd43b7ada6150426d685778979ceca4304361698'],
|
||||
|
||||
['org.conscrypt:conscrypt-android:2.0.0',
|
||||
'400ca559a49b860a82862b22cee0e3110764bdcf7ee7c79e7479895c25cdfc09'],
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue