├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── values-ru │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── content_info.xml │ │ │ │ ├── activity_info.xml │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── archinamon │ │ │ │ └── example │ │ │ │ ├── dagger │ │ │ │ ├── ForApplication.java │ │ │ │ ├── TestComponent.java │ │ │ │ ├── MyAppScopeModule.java │ │ │ │ └── AndroidAppModule.java │ │ │ │ ├── MyApplication.java │ │ │ │ └── MainActivity.java │ │ ├── aspectj │ │ │ └── com │ │ │ │ └── archinamon │ │ │ │ └── xpoint │ │ │ │ ├── TestMutator.aj │ │ │ │ ├── LibDecorator.aj │ │ │ │ ├── EventRepeater.aj │ │ │ │ ├── JvmLangDecorator.aj │ │ │ │ └── LocaleMonitor.aj │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── archinamon │ │ │ │ └── kotlin │ │ │ │ ├── ToastHelper.kt │ │ │ │ └── InfoActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── archinamon │ │ │ └── test │ │ │ └── ExperimentalTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── archinamon │ │ └── example │ │ └── ApplicationTest.java ├── proguard-rules.pro ├── build.gradle └── app.iml ├── libAjProfiler ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── aspectj │ │ └── com │ │ └── archinamon │ │ └── profiler │ │ ├── annotation │ │ ├── ProfileClass.java │ │ ├── ProfileDynamic.java │ │ ├── ProfileField.java │ │ ├── ProfileStatic.java │ │ ├── ProfileInstance.java │ │ ├── ProfileCall.java │ │ ├── ProfileExecution.java │ │ └── ProfileErrors.java │ │ └── core │ │ ├── ProfilerImpl.aj │ │ ├── Profiler.aj │ │ ├── AnnotationProfilerImpl.aj │ │ └── AnnotationProfiler.aj ├── build.gradle └── proguard-rules.pro ├── libExample ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ └── java │ │ └── com │ │ └── archinamon │ │ └── example │ │ └── lib │ │ └── LibExample.java ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .travis.yml ├── README.md ├── gradle.properties ├── AspectJExampleAndroid.iml ├── gradlew.bat ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libAjProfiler/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libExample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml 3 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':libExample', ':libAjProfiler' -------------------------------------------------------------------------------- /libAjProfiler/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /libExample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /libExample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | My Library 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archinamon/AndroidAspectJExample/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archinamon/AndroidAspectJExample/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archinamon/AndroidAspectJExample/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archinamon/AndroidAspectJExample/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archinamon/AndroidAspectJExample/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 03 15:25:10 MSK 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /libExample/src/main/java/com/archinamon/example/lib/LibExample.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.example.lib; 2 | 3 | /** 4 | * TODO: Add description 5 | * 6 | * @author archinamon on 01/03/17. 7 | */ 8 | public class LibExample { 9 | 10 | public String hello() { 11 | return "hello from lib"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/archinamon/example/dagger/ForApplication.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.example.dagger; 2 | 3 | import java.lang.annotation.Retention; 4 | import javax.inject.Qualifier; 5 | 6 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 7 | 8 | @Qualifier 9 | @Retention(RUNTIME) 10 | public @interface ForApplication { 11 | } -------------------------------------------------------------------------------- /app/src/main/aspectj/com/archinamon/xpoint/TestMutator.aj: -------------------------------------------------------------------------------- 1 | package com.archinamon.xpoint; 2 | 3 | /** 4 | * @author archinamon on 12/05/16. 5 | */ 6 | privileged aspect TestMutator { 7 | 8 | pointcut mutate(): 9 | within(com.archinamon.test.*) && 10 | call(String *(..)); 11 | 12 | String around(): mutate() { 13 | return "mutable"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/archinamon/kotlin/ToastHelper.kt: -------------------------------------------------------------------------------- 1 | package com.archinamon.kotlin 2 | 3 | import android.content.Context 4 | import android.widget.Toast 5 | import com.archinamon.libinstantparcelable.parcel.Parcelable 6 | 7 | fun sendToast(ctx: Context, info: TextInfo) { 8 | Toast.makeText(ctx, info.text, Toast.LENGTH_LONG).show() 9 | } 10 | 11 | data @Parcelable class TextInfo(val text: String = "") -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/archinamon/example/dagger/TestComponent.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.example.dagger; 2 | 3 | import com.archinamon.example.MainActivity; 4 | import javax.inject.Singleton; 5 | import dagger.Component; 6 | import dagger.Module; 7 | 8 | @Singleton 9 | @Component(modules={AndroidAppModule.class, MyAppScopeModule.class}) 10 | public interface TestComponent { 11 | 12 | void inject(MainActivity activity); 13 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | .idea/ 13 | bin/ 14 | gen/ 15 | *.iml 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | /*/build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileClass.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.TYPE; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * Created by archinamon on 15/01/16. 11 | */ 12 | @Retention(RUNTIME) 13 | @Target(TYPE) 14 | public @interface ProfileClass {} 15 | -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileDynamic.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.TYPE; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * Created by archinamon on 15/01/16. 11 | */ 12 | @Retention(RUNTIME) 13 | @Target(TYPE) 14 | public @interface ProfileDynamic {} 15 | -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileField.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.FIELD; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * Created by archinamon on 15/01/16. 11 | */ 12 | @Target(FIELD) 13 | @Retention(RUNTIME) 14 | public @interface ProfileField {} 15 | -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileStatic.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.TYPE; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * Created by archinamon on 15/01/16. 11 | */ 12 | @Retention(RUNTIME) 13 | @Target(TYPE) 14 | public @interface ProfileStatic {} 15 | -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileInstance.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.TYPE; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * Created by archinamon on 15/01/16. 11 | */ 12 | @Retention(RUNTIME) 13 | @Target(TYPE) 14 | public @interface ProfileInstance {} 15 | -------------------------------------------------------------------------------- /libExample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 26 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AspectJExample 3 | 4 | Привет, мир! 5 | Рабочий язык — 6 | Настройки 7 | Кнопка 1 8 | Кнопка 2 9 | Кнопка 3 10 | Что-то нажали! 11 | 12 | -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileCall.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 7 | import static java.lang.annotation.ElementType.METHOD; 8 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 9 | 10 | /** 11 | * Created by archinamon on 15/01/16. 12 | */ 13 | @Retention(RUNTIME) 14 | @Target({CONSTRUCTOR, METHOD}) 15 | public @interface ProfileCall {} 16 | -------------------------------------------------------------------------------- /libAjProfiler/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.archinamon.aspectj-provides' 3 | 4 | android { 5 | compileSdkVersion 26 6 | buildToolsVersion "26.0.2" 7 | 8 | 9 | defaultConfig { 10 | minSdkVersion 14 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /libAjProfiler/src/main/aspectj/com/archinamon/profiler/annotation/ProfileExecution.java: -------------------------------------------------------------------------------- 1 | package com.archinamon.profiler.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 7 | import static java.lang.annotation.ElementType.METHOD; 8 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 9 | 10 | /** 11 | * Created by archinamon on 15/01/16. 12 | */ 13 | @Retention(RUNTIME) 14 | @Target({CONSTRUCTOR, METHOD}) 15 | public @interface ProfileExecution {} 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |