├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── let-sample ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ ├── layout │ │ │ │ ├── activity_fragment.xml │ │ │ │ ├── fragment.xml │ │ │ │ ├── fragment_contacts.xml │ │ │ │ └── activity_sample.xml │ │ │ ├── menu │ │ │ │ ├── menu_sample.xml │ │ │ │ └── menu_.xml │ │ │ └── values-w820dp │ │ │ │ └── dimens.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── canelmas │ │ │ │ └── let │ │ │ │ └── sample │ │ │ │ ├── SampleFragmentActivity.java │ │ │ │ ├── SampleV4FragmentActivity.java │ │ │ │ ├── SampleV4Fragment.java │ │ │ │ ├── SampleFragment.java │ │ │ │ ├── ContactsActivity.java │ │ │ │ └── SampleActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── canelmas │ │ │ └── permissioncompat │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── canelmas │ │ └── let │ │ └── ApplicationTest.java ├── proguard-let.pro ├── proguard-rules.pro └── build.gradle ├── .gitignore ├── let-runtime ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── canelmas │ │ │ └── permissioncompat │ │ │ └── ExampleUnitTest.java │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── canelmas │ │ │ └── let │ │ │ ├── LetException.java │ │ │ ├── RuntimePermissionListener.java │ │ │ ├── DeniedPermission.java │ │ │ ├── LetAspect.java │ │ │ ├── LetContext.java │ │ │ ├── DelayedTasks.java │ │ │ ├── Let.java │ │ │ └── RuntimePermissionRequest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── canelmas │ │ └── let │ │ └── ApplicationTest.java ├── gradle.properties ├── proguard-rules.pro └── build.gradle ├── let-plugin ├── gradle.properties ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── gradle-plugins │ │ │ └── let.properties │ │ └── groovy │ │ └── com │ │ └── canelmas │ │ └── let │ │ ├── LetPlugin.groovy │ │ └── LetTransform.groovy └── build.gradle ├── let-annotations ├── gradle.properties ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── canelmas │ └── let │ └── AskPermission.java ├── CHANGELOG.md ├── gradle.properties ├── gradlew.bat ├── gradle-mvn-push.gradle ├── gradlew ├── README.md └── LICENSE /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canelmas/let/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':let-annotations' 2 | include ':let-plugin' 3 | include ':let-runtime' 4 | include ':let-sample' -------------------------------------------------------------------------------- /let-sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canelmas/let/HEAD/let-sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /let-sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canelmas/let/HEAD/let-sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /let-sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canelmas/let/HEAD/let-sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /let-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canelmas/let/HEAD/let-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | *build 7 | /captures 8 | *.iml 9 | *.idea 10 | 11 | /CHANGELOG.md 12 | Notes -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 31 21:52:49 EEST 2015 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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /let-sample/proguard-let.pro: -------------------------------------------------------------------------------- 1 | # add following lines to your proguard config 2 | 3 | -keep class com.canelmas.let.** { *; } 4 | -keepnames class * implements com.canelmas.let.RuntimePermissionListener 5 | 6 | -keepclassmembers class * implements com.canelmas.let.RuntimePermissionListener { 7 | public void onRequestPermissionsResult(***); 8 | } 9 | 10 | -keepclasseswithmembernames class * { 11 | @com.canelmas.let.* ; 12 | } -------------------------------------------------------------------------------- /let-runtime/src/test/java/com/canelmas/permissioncompat/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.canelmas.let; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /let-sample/src/test/java/com/canelmas/permissioncompat/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.canelmas.let; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /let-plugin/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 Can Elmas 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | POM_NAME=Let Plugin 18 | POM_ARTIFACT_ID=let-plugin 19 | POM_PACKAGING=jar -------------------------------------------------------------------------------- /let-runtime/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 Can Elmas 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | POM_NAME=Let Runtime 18 | POM_ARTIFACT_ID=let-runtime 19 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /let-runtime/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /let-plugin/src/main/resources/META-INF/gradle-plugins/let.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 Can Elmas 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | implementation-class=com.canelmas.let.LetPlugin -------------------------------------------------------------------------------- /let-sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/can/Documents/android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /let-annotations/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 Can Elmas 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | POM_NAME=Let Annotations 18 | POM_ARTIFACT_ID=let-annotations 19 | POM_PACKAGING=jar -------------------------------------------------------------------------------- /let-runtime/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/can/Documents/android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | 4 | Version 1.0.0-beta1 *(2017-09-04)* 5 | ---------------------------------- 6 | * Use Transform API for weaving [#23](https://github.com/canelmas/let/issues/23) 7 | * Support Kotlin [#17](https://github.com/canelmas/let/issues/17) 8 | * Remove logger [#20](https://github.com/canelmas/let/issues/20) 9 | 10 | Version 0.1.11 *(2016-06-07)* 11 | ----------------------------- 12 | * Fix the potential java.lang.IllegalArgumentException: Can only use lower 13 | 8 bits for requestCode [#11](https://github.com/canelmas/let/issues/11) 14 | 15 | Version 0.1.10 *(2016-03-20)* 16 | ----------------------------- 17 | * Change: Set `@AskPermission` retention policy to `RUNTIME` (again) 18 | 19 | Version 0.1.9 *(2015-11-12)* 20 | ---------------------------- 21 | 22 | initial release -------------------------------------------------------------------------------- /let-runtime/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /let-sample/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 21 | 22 | -------------------------------------------------------------------------------- /let-sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /let-sample/src/main/res/layout/activity_fragment.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /let-sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 16dp 20 | 16dp 21 | 22 | -------------------------------------------------------------------------------- /let-sample/src/main/res/menu/menu_sample.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 19 | 21 | 22 | -------------------------------------------------------------------------------- /let-runtime/src/main/java/com/canelmas/let/LetException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Can Elmas 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.canelmas.let; 18 | 19 | final class LetException extends RuntimeException { 20 | 21 | public LetException(String detailMessage) { 22 | super(detailMessage); 23 | } 24 | 25 | public LetException(String detailMessage, Throwable throwable) { 26 | super(detailMessage, throwable); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /let-runtime/src/main/java/com/canelmas/let/RuntimePermissionListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Can Elmas 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.canelmas.let; 18 | 19 | import java.util.List; 20 | 21 | public interface RuntimePermissionListener { 22 | 23 | void onShowPermissionRationale(final List permissionList, final RuntimePermissionRequest permissionRequest); 24 | void onPermissionDenied(final List deniedPermissionList); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /let-sample/src/main/res/menu/menu_.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 22 | 23 | -------------------------------------------------------------------------------- /let-sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 21 | 64dp 22 | 23 | -------------------------------------------------------------------------------- /let-runtime/src/androidTest/java/com/canelmas/let/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Can Elmas 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.canelmas.let; 18 | 19 | import android.app.Application; 20 | import android.test.ApplicationTestCase; 21 | 22 | /** 23 | * Testing Fundamentals 24 | */ 25 | public class ApplicationTest extends ApplicationTestCase { 26 | public ApplicationTest() { 27 | super(Application.class); 28 | } 29 | } -------------------------------------------------------------------------------- /let-sample/src/androidTest/java/com/canelmas/let/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Can Elmas 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.canelmas.let; 18 | 19 | import android.app.Application; 20 | import android.test.ApplicationTestCase; 21 | 22 | /** 23 | * Testing Fundamentals 24 | */ 25 | public class ApplicationTest extends ApplicationTestCase { 26 | public ApplicationTest() { 27 | super(Application.class); 28 | } 29 | } -------------------------------------------------------------------------------- /let-runtime/src/main/java/com/canelmas/let/DeniedPermission.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Can Elmas 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.canelmas.let; 18 | 19 | public final class DeniedPermission { 20 | 21 | final String permission; 22 | final boolean neverAskAgain; 23 | 24 | DeniedPermission(final String permission, final boolean neverAskAgain) { 25 | this.permission = permission; 26 | this.neverAskAgain = neverAskAgain; 27 | } 28 | 29 | public String getPermission() { 30 | return permission; 31 | } 32 | 33 | public boolean isNeverAskAgainChecked() { 34 | return neverAskAgain; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /let-sample/src/main/res/layout/fragment.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | 27 |