├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── android-proguard-annotations-app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── proguard │ │ └── annotations │ │ └── app │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ └── java │ └── proguard │ └── app │ ├── DontKeepMe.java │ ├── KeepMe.java │ ├── KeepMeWithoutMembers.java │ ├── UseKeepMeWithoutMembers.java │ └── UsedKeepMeWithoutMembers.java ├── android-proguard-annotations ├── annotations.pro ├── build.gradle ├── gradle.properties ├── mvn-push.gradle └── src │ └── main │ └── AndroidManifest.xml ├── art ├── proguard-annotations.png ├── proguard-annotations.svg └── proguard.png ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── proguard-annotations ├── build.gradle ├── gradle.properties ├── mvn-push.gradle └── src │ └── main │ └── java │ └── proguard │ └── annotation │ ├── Keep.java │ ├── KeepApplication.java │ ├── KeepClassMemberNames.java │ ├── KeepClassMembers.java │ ├── KeepGettersSetters.java │ ├── KeepImplementations.java │ ├── KeepName.java │ ├── KeepPublicClassMemberNames.java │ ├── KeepPublicClassMembers.java │ ├── KeepPublicGettersSetters.java │ ├── KeepPublicImplementations.java │ ├── KeepPublicProtectedClassMemberNames.java │ └── KeepPublicProtectedClassMembers.java ├── settings.gradle └── test /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath 3 | .settings/ 4 | bin/ 5 | gen/ 6 | 7 | # vim 8 | 9 | *~ 10 | *.sw* 11 | 12 | # git 13 | 14 | *.orig 15 | 16 | build/ 17 | .gradle/ 18 | 19 | local.properties 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: 3 | - oraclejdk7 4 | android: 5 | components: 6 | - build-tools-21.1.0 7 | - build-tools-21.0.2 8 | - build-tools-21.0.0 9 | - build-tools-20.0.0 10 | - android-20 11 | - android-21 12 | - extra-android-support 13 | - extra-android-m2repository 14 | licenses: 15 | - '.+' 16 | 17 | #after_success: 18 | # - if [[ $TRAVIS_PULL_REQUEST == 'false' && $TRAVIS_TAG ]]; then ./gradlew build uploadArchives -PNEXUS_USERNAME="${nexusUsername}" -PNEXUS_PASSWORD="${nexusPassword}" -PnexusUsername="${nexusUsername}" -PnexusPassword="${nexusPassword}" ; fi 19 | # 20 | before_install: 21 | - export JAVA7_HOME=/usr/lib/jvm/java-7-oracle 22 | - export JAVA8_HOME=/usr/lib/jvm/java-8-oracle 23 | script: 24 | - ./gradlew clean assemble check 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Andrew Chen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # proguard-annotations 2 | 3 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-proguard--annotations-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1833) 4 | ![JitPack](https://img.shields.io/github/tag/yongjhih/proguard-annotations.svg?label=maven) 5 | [![Download](https://api.bintray.com/packages/yongjhih/maven/proguard-annotations/images/download.svg) ](https://bintray.com/yongjhih/maven/proguard-annotations/_latestVersion) 6 | [![javadoc.io](https://javadocio-badges.herokuapp.com/com.infstory/proguard-annotations/badge.svg)](http://www.javadoc.io/doc/com.infstory/proguard-annotations/) 7 | [![Build Status](https://travis-ci.org/yongjhih/proguard-annotations.svg)](https://travis-ci.org/yongjhih/proguard-annotations) 8 | [![Join the chat at https://gitter.im/yongjhih/proguard-annotations](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yongjhih/proguard-annotations?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 9 | 10 | [![proguard-annotations](art/proguard-annotations.png)](art/proguard-annotations.png) 11 | 12 | Easy to use inline `@Keep` annotation to keep class. 13 | 14 | And easy to install. 15 | 16 | ## Usage 17 | 18 | ```java 19 | @Keep 20 | @KeepClassMembers 21 | public class KeepMe { 22 | String keepMe; 23 | } 24 | ``` 25 | 26 | ## Installation 27 | 28 | build.gradle: 29 | 30 | ```gradle 31 | dependencies { 32 | compile "com.infstory:proguard-annotations:1.0.2" 33 | } 34 | ``` 35 | 36 | ## Annotations 37 | 38 | [![javadoc.io](https://javadocio-badges.herokuapp.com/com.infstory/proguard-annotations/badge.svg)](http://www.javadoc.io/doc/com.infstory/proguard-annotations/) 39 | 40 | How annotations do? [proguard-annotations/annotations.pro](android-proguard-annotations/annotations.pro) 41 | 42 | ## See Also 43 | 44 | Import from official [proguard/examples/annotations/src/proguard/annotation](https://github.com/facebook/proguard/tree/master/examples/annotations/src/proguard/annotation) 45 | 46 | ref. http://proguard.sourceforge.net/manual/examples.html#annotated 47 | 48 | ## Test 49 | 50 | ``` 51 | $ /gradelw clean assembleRelease 52 | $ cd proguard-annotations-app/build/outputs/apk 53 | $ unzip proguard-annotations-app-release-unsigned.apk 54 | $ dex2jar classes.dex 55 | $ unzip classes_dex2jar.jar 56 | $ tree proguard 57 | proguard 58 | ├── annotation 59 | │   ├── BuildConfig.class 60 | │   ├── KeepApplication.class 61 | │   ├── Keep.class 62 | │   ├── KeepClassMemberNames.class 63 | │   ├── KeepClassMembers.class 64 | │   ├── KeepGettersSetters.class 65 | │   ├── KeepImplementations.class 66 | │   ├── KeepName.class 67 | │   ├── KeepPublicClassMemberNames.class 68 | │   ├── KeepPublicClassMembers.class 69 | │   ├── KeepPublicGettersSetters.class 70 | │   ├── KeepPublicImplementations.class 71 | │   ├── KeepPublicProtectedClassMemberNames.class 72 | │   └── KeepPublicProtectedClassMembers.class 73 | └── app 74 | ├── KeepMe.class 75 | └── KeepMeWithoutMembers.class 76 | 77 | $ jd-gui classes_dex2jar.jar # Optional 78 | ``` 79 | 80 | ``` 81 | $ tree proguard-annotations-app/src/main/java 82 | proguard-annotations-app/src/main/java 83 | └── proguard 84 | └── app 85 | ├── DontKeepMe.java 86 | ├── KeepMe.java 87 | └── KeepMeWithoutMembers.java 88 | ``` 89 | 90 | ## TODO 91 | 92 | * Test Cases 93 | 94 | ## FAQ 95 | 96 | > For which classes I have to use it ? Only classes i made for my items ? Or also activities and services and so on? 97 | 98 | It used to apply on reflection target. If you have not use relection, you just enable minify feature with default proguard config by the following build.gradle, and do nothing with proguard config: 99 | 100 | ```gradle 101 | android { 102 | buildTypes { 103 | release { 104 | minifyEnabled true 105 | proguardFiles getDefaultProguardFile('proguard-android.txt') 106 | } 107 | } 108 | } 109 | ``` 110 | 111 | > When to use @Keep and when to use @KeepClassMembers ? 112 | 113 | `@Keep` used to apply on runtime annotation for relection, it will keep class name and avoid be removed for optimization. `@KeepClassMembers` used to keep whole class with class members for POJO reflection. It's used to keep targets for Gson and Jackson JSON reflection libraries. 114 | 115 | > I don't need to write anything in my proguard rule file ? For my application or libraries or jars ? 116 | 117 | Yes, do nothing if nothing special. Just enable minify. 118 | 119 | ## See Also 120 | 121 | 122 | [Android Support Annotations - Keep](http://tools.android.com/tech-docs/support-annotations#TOC-Keep) 123 | 124 | In progress: 125 | 126 | > @Keep 127 | 128 | > We've also added @Keep to the support annotations. Note however that > that annotation hasn't been hooked up to the Gradle plugin yet (though > it's [in progress](https://android-review.googlesource.com/#/c/152983/).) When finished this will let you annotate methods and > > classes that should be retained when minimizing the app. 129 | 130 | ## [License] (LICENSE) 131 | 132 | ``` 133 | The MIT License (MIT) 134 | 135 | Copyright (c) 2014 Andrew Chen 136 | 137 | Permission is hereby granted, free of charge, to any person obtaining a copy 138 | of this software and associated documentation files (the "Software"), to deal 139 | in the Software without restriction, including without limitation the rights 140 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 141 | copies of the Software, and to permit persons to whom the Software is 142 | furnished to do so, subject to the following conditions: 143 | 144 | The above copyright notice and this permission notice shall be included in all 145 | copies or substantial portions of the Software. 146 | 147 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 148 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 149 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 150 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 151 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 152 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 153 | SOFTWARE. 154 | ``` 155 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:1.1.2' 8 | classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+' 9 | } 10 | } 11 | 12 | repositories { 13 | jcenter() 14 | } 15 | 16 | apply plugin: 'android-sdk-manager' 17 | apply plugin: 'com.android.application' 18 | 19 | android { 20 | compileSdkVersion 22 21 | buildToolsVersion "22.0.1" 22 | 23 | /* 24 | compileOptions { 25 | sourceCompatibility JavaVersion.VERSION_1_7 26 | targetCompatibility JavaVersion.VERSION_1_7 27 | } 28 | */ 29 | 30 | defaultConfig { 31 | applicationId "proguard.app" 32 | minSdkVersion 4 33 | targetSdkVersion 22 34 | versionCode 1 35 | versionName "1.0" 36 | } 37 | 38 | buildTypes { 39 | release { 40 | minifyEnabled true 41 | shrinkResources true 42 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 43 | } 44 | debug { 45 | } 46 | } 47 | } 48 | 49 | dependencies { 50 | //compile "com.infstory:proguard-annotations:1.0.1@aar" 51 | compile project(':android-proguard-annotations') 52 | } 53 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/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 /home/andrew/adt-bundle-linux/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 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/androidTest/java/proguard/annotations/app/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package proguard.annotations.app; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/main/java/proguard/app/DontKeepMe.java: -------------------------------------------------------------------------------- 1 | package proguard.app; 2 | 3 | import proguard.annotation.*; 4 | 5 | public class DontKeepMe { 6 | 7 | private String mDontKeepMe; 8 | 9 | public String getDontKeepMe() { 10 | return mDontKeepMe; 11 | } 12 | 13 | public void setDontKeepMe(String s) { 14 | mDontKeepMe = s; 15 | } 16 | 17 | public String dontKeepMe; 18 | } 19 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/main/java/proguard/app/KeepMe.java: -------------------------------------------------------------------------------- 1 | package proguard.app; 2 | 3 | import proguard.annotation.*; 4 | 5 | @Keep 6 | @KeepClassMembers 7 | public class KeepMe { 8 | 9 | private String mKeepMe; 10 | 11 | public String getKeepMe() { 12 | return mKeepMe; 13 | } 14 | 15 | public void setKeepMe(String s) { 16 | mKeepMe = s; 17 | } 18 | 19 | public String keepMe; 20 | } 21 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/main/java/proguard/app/KeepMeWithoutMembers.java: -------------------------------------------------------------------------------- 1 | package proguard.app; 2 | 3 | import proguard.annotation.*; 4 | 5 | @Keep 6 | public class KeepMeWithoutMembers { 7 | 8 | private String mDontKeepMe; 9 | 10 | public String getDontKeepMe() { 11 | return mDontKeepMe; 12 | } 13 | 14 | public void setDontKeepMe(String s) { 15 | mDontKeepMe = s; 16 | } 17 | 18 | public String dontKeepMe; 19 | } 20 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/main/java/proguard/app/UseKeepMeWithoutMembers.java: -------------------------------------------------------------------------------- 1 | package proguard.app; 2 | 3 | import proguard.annotation.*; 4 | 5 | @Keep 6 | public class UseKeepMeWithoutMembers { 7 | UseKeepMeWithoutMembers() { 8 | UsedKeepMeWithoutMembers obj = new UsedKeepMeWithoutMembers(); 9 | obj.getDontKeepMe(); 10 | //obj.setDontKeepMe(null); 11 | obj.dontKeepMe = null; 12 | } 13 | 14 | private String mDontKeepMe; 15 | 16 | public String getDontKeepMe() { 17 | return mDontKeepMe; 18 | } 19 | 20 | public void setDontKeepMe(String s) { 21 | mDontKeepMe = s; 22 | } 23 | 24 | public String dontKeepMe; 25 | } 26 | -------------------------------------------------------------------------------- /android-proguard-annotations-app/src/main/java/proguard/app/UsedKeepMeWithoutMembers.java: -------------------------------------------------------------------------------- 1 | package proguard.app; 2 | 3 | import proguard.annotation.*; 4 | 5 | @Keep 6 | public class UsedKeepMeWithoutMembers { 7 | 8 | private String mDontKeepMe; 9 | 10 | public String getDontKeepMe() { 11 | return mDontKeepMe; 12 | } 13 | 14 | public void setDontKeepMe(String s) { 15 | mDontKeepMe = s; 16 | } 17 | 18 | public String dontKeepMe; 19 | } 20 | -------------------------------------------------------------------------------- /android-proguard-annotations/annotations.pro: -------------------------------------------------------------------------------- 1 | # 2 | # This ProGuard configuration file specifies how annotations can be used 3 | # to configure the processing of other code. 4 | # Usage: 5 | # java -jar proguard.jar @annotations.pro -libraryjars annotations.jar ... 6 | # 7 | # Note that the other input/output options still have to be specified. 8 | # If you specify them in a separate file, you can simply include this file: 9 | # -include annotations.pro 10 | # 11 | # You can add any other options that are required. For instance, if you are 12 | # processing a library, you can still include the options from library.pro. 13 | 14 | 15 | # The annotations are defined in the accompanying jar. For now, we'll start 16 | # with these. You can always define your own annotations, if necessary. 17 | #-libraryjars annotations.jar 18 | -dontwarn proguard.annotation.** 19 | -keep class proguard.annotation.* 20 | 21 | # The following annotations can be specified with classes and with class 22 | # members. 23 | 24 | # @Keep specifies not to shrink, optimize, or obfuscate the annotated class 25 | # or class member as an entry point. 26 | 27 | -keep @proguard.annotation.Keep class * 28 | 29 | -keepclassmembers class * { 30 | @proguard.annotation.Keep *; 31 | } 32 | 33 | 34 | # @KeepName specifies not to optimize or obfuscate the annotated class or 35 | # class member as an entry point. 36 | 37 | -keepnames @proguard.annotation.KeepName class * 38 | 39 | -keepclassmembernames class * { 40 | @proguard.annotation.KeepName *; 41 | } 42 | 43 | 44 | # The following annotations can only be specified with classes. 45 | 46 | # @KeepImplementations and @KeepPublicImplementations specify to keep all, 47 | # resp. all public, implementations or extensions of the annotated class as 48 | # entry points. Note the extension of the java-like syntax, adding annotations 49 | # before the (wild-carded) interface name. 50 | 51 | -keep class * implements @proguard.annotation.KeepImplementations * 52 | -keep public class * implements @proguard.annotation.KeepPublicImplementations * 53 | 54 | # @KeepApplication specifies to keep the annotated class as an application, 55 | # together with its main method. 56 | 57 | -keepclasseswithmembers @proguard.annotation.KeepApplication public class * { 58 | public static void main(java.lang.String[]); 59 | } 60 | 61 | # @KeepClassMembers, @KeepPublicClassMembers, and 62 | # @KeepPublicProtectedClassMembers specify to keep all, all public, resp. 63 | # all public or protected, class members of the annotated class from being 64 | # shrunk, optimized, or obfuscated as entry points. 65 | 66 | -keepclassmembers @proguard.annotation.KeepClassMembers class * { 67 | *; 68 | } 69 | 70 | -keepclassmembers @proguard.annotation.KeepPublicClassMembers class * { 71 | public *; 72 | } 73 | 74 | -keepclassmembers @proguard.annotation.KeepPublicProtectedClassMembers class * { 75 | public protected *; 76 | } 77 | 78 | # @KeepClassMemberNames, @KeepPublicClassMemberNames, and 79 | # @KeepPublicProtectedClassMemberNames specify to keep all, all public, resp. 80 | # all public or protected, class members of the annotated class from being 81 | # optimized or obfuscated as entry points. 82 | 83 | -keepclassmembernames @proguard.annotation.KeepClassMemberNames class * { 84 | *; 85 | } 86 | 87 | -keepclassmembernames @proguard.annotation.KeepPublicClassMemberNames class * { 88 | public *; 89 | } 90 | 91 | -keepclassmembernames @proguard.annotation.KeepPublicProtectedClassMemberNames class * { 92 | public protected *; 93 | } 94 | 95 | # @KeepGettersSetters and @KeepPublicGettersSetters specify to keep all, resp. 96 | # all public, getters and setters of the annotated class from being shrunk, 97 | # optimized, or obfuscated as entry points. 98 | 99 | -keepclassmembers @proguard.annotation.KeepGettersSetters class * { 100 | void set*(***); 101 | void set*(int, ***); 102 | 103 | boolean is*(); 104 | boolean is*(int); 105 | 106 | *** get*(); 107 | *** get*(int); 108 | } 109 | 110 | -keepclassmembers @proguard.annotation.KeepPublicGettersSetters class * { 111 | public void set*(***); 112 | public void set*(int, ***); 113 | 114 | public boolean is*(); 115 | public boolean is*(int); 116 | 117 | public *** get*(); 118 | public *** get*(int); 119 | } 120 | -------------------------------------------------------------------------------- /android-proguard-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:1.1.2' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | apply plugin: 'com.android.library' 16 | 17 | dependencies { 18 | compile project(':proguard-annotations') 19 | } 20 | 21 | android { 22 | buildToolsVersion "21.1.0" 23 | compileSdkVersion 21 24 | 25 | defaultConfig { 26 | minSdkVersion 4 27 | targetSdkVersion 21 28 | versionCode = Integer.parseInt(VERSION_CODE) 29 | versionName = VERSION_NAME 30 | consumerProguardFiles 'annotations.pro' 31 | } 32 | } 33 | 34 | version = VERSION_NAME 35 | group = GROUP 36 | 37 | apply from: 'mvn-push.gradle' 38 | -------------------------------------------------------------------------------- /android-proguard-annotations/gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=1.0.2 2 | VERSION_CODE=102 3 | GROUP=com.infstory 4 | 5 | POM_DESCRIPTION=Proguard Annotations 6 | POM_URL=https://github.com/yongjhih/proguard-annotations 7 | POM_SCM_URL=https://github.com/yongjhih/proguard-annotations 8 | POM_SCM_CONNECTION=scm:git@github.com:yongjhih/proguard-annotations.git 9 | POM_SCM_DEV_CONNECTION=scm:git@github.com:yongjhih/proguard-annotations.git 10 | POM_LICENCE_NAME=The MIT License (MIT) 11 | POM_LICENCE_URL=https://github.com/yongjhih/proguard-annotations/blob/master/LICENSE 12 | POM_LICENCE_DIST=repo 13 | POM_DEVELOPER_ID=yongjhih 14 | POM_DEVELOPER_NAME=Andrew Chen 15 | 16 | POM_NAME=Proguard Annotations 17 | POM_ARTIFACT_ID=proguard-annotations 18 | POM_PACKAGING=aar 19 | 20 | RELEASE_REPOSITORY_URL=https://api.bintray.com/maven/yongjhih/maven/proguard-annotations/ 21 | -------------------------------------------------------------------------------- /android-proguard-annotations/mvn-push.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Banes 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 | apply plugin: 'maven' 18 | apply plugin: 'signing' 19 | 20 | def isReleaseBuild() { 21 | return VERSION_NAME.contains("SNAPSHOT") == false 22 | } 23 | 24 | def getReleaseRepositoryUrl() { 25 | return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL 26 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 27 | } 28 | 29 | def getSnapshotRepositoryUrl() { 30 | return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL 31 | : "https://oss.sonatype.org/content/repositories/snapshots/" 32 | } 33 | 34 | def getRepositoryUsername() { 35 | return hasProperty('BINTRAY_USER') ? BINTRAY_USER : "" 36 | } 37 | 38 | def getRepositoryPassword() { 39 | return hasProperty('BINTRAY_KEY') ? BINTRAY_KEY : "" 40 | } 41 | 42 | afterEvaluate { project -> 43 | uploadArchives { 44 | repositories { 45 | mavenDeployer { 46 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 47 | 48 | pom.groupId = GROUP 49 | pom.artifactId = POM_ARTIFACT_ID 50 | pom.version = VERSION_NAME 51 | 52 | repository(url: getReleaseRepositoryUrl()) { 53 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 54 | } 55 | snapshotRepository(url: getSnapshotRepositoryUrl()) { 56 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 57 | } 58 | 59 | pom.project { 60 | name POM_NAME 61 | packaging POM_PACKAGING 62 | description POM_DESCRIPTION 63 | url POM_URL 64 | 65 | scm { 66 | url POM_SCM_URL 67 | connection POM_SCM_CONNECTION 68 | developerConnection POM_SCM_DEV_CONNECTION 69 | } 70 | 71 | licenses { 72 | license { 73 | name POM_LICENCE_NAME 74 | url POM_LICENCE_URL 75 | distribution POM_LICENCE_DIST 76 | } 77 | } 78 | 79 | developers { 80 | developer { 81 | id POM_DEVELOPER_ID 82 | name POM_DEVELOPER_NAME 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | 90 | signing { 91 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } 92 | sign configurations.archives 93 | } 94 | 95 | task androidJavadocs(type: Javadoc) { 96 | source = android.sourceSets.main.java.srcDirs 97 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 98 | } 99 | 100 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { 101 | classifier = 'javadoc' 102 | from androidJavadocs.destinationDir 103 | } 104 | 105 | task androidSourcesJar(type: Jar) { 106 | classifier = 'sources' 107 | from android.sourceSets.main.java.sourceFiles 108 | } 109 | 110 | artifacts { 111 | archives androidSourcesJar 112 | archives androidJavadocsJar 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /android-proguard-annotations/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /art/proguard-annotations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongjhih/proguard-annotations/0555f3b13ec77ebd40a995a3378a82215ebb89f0/art/proguard-annotations.png -------------------------------------------------------------------------------- /art/proguard-annotations.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml# 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | @ 581 | 582 | -------------------------------------------------------------------------------- /art/proguard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongjhih/proguard-annotations/0555f3b13ec77ebd40a995a3378a82215ebb89f0/art/proguard.png -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongjhih/proguard-annotations/0555f3b13ec77ebd40a995a3378a82215ebb89f0/build.gradle -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongjhih/proguard-annotations/0555f3b13ec77ebd40a995a3378a82215ebb89f0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jul 31 19:27:13 CST 2014 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-2.2-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /proguard-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | } 6 | 7 | repositories { 8 | jcenter() 9 | } 10 | 11 | apply plugin: 'java' 12 | 13 | dependencies { 14 | } 15 | 16 | version = VERSION_NAME 17 | group = GROUP 18 | 19 | apply from: 'mvn-push.gradle' 20 | -------------------------------------------------------------------------------- /proguard-annotations/gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=1.0.2 2 | VERSION_CODE=102 3 | GROUP=com.infstory 4 | 5 | POM_DESCRIPTION=Proguard Annotations 6 | POM_URL=https://github.com/yongjhih/proguard-annotations 7 | POM_SCM_URL=https://github.com/yongjhih/proguard-annotations 8 | POM_SCM_CONNECTION=scm:git@github.com:yongjhih/proguard-annotations.git 9 | POM_SCM_DEV_CONNECTION=scm:git@github.com:yongjhih/proguard-annotations.git 10 | POM_LICENCE_NAME=The MIT License (MIT) 11 | POM_LICENCE_URL=https://github.com/yongjhih/proguard-annotations/blob/master/LICENSE 12 | POM_LICENCE_DIST=repo 13 | POM_DEVELOPER_ID=yongjhih 14 | POM_DEVELOPER_NAME=Andrew Chen 15 | 16 | POM_NAME=Proguard Annotations 17 | POM_ARTIFACT_ID=proguard-annotations 18 | POM_PACKAGING=jar 19 | 20 | RELEASE_REPOSITORY_URL=https://api.bintray.com/maven/yongjhih/maven/proguard-annotations/ 21 | -------------------------------------------------------------------------------- /proguard-annotations/mvn-push.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Banes 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 | apply plugin: 'maven' 18 | apply plugin: 'signing' 19 | 20 | def isReleaseBuild() { 21 | return VERSION_NAME.contains("SNAPSHOT") == false 22 | } 23 | 24 | def getReleaseRepositoryUrl() { 25 | return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL 26 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 27 | } 28 | 29 | def getSnapshotRepositoryUrl() { 30 | return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL 31 | : "https://oss.sonatype.org/content/repositories/snapshots/" 32 | } 33 | 34 | def getRepositoryUsername() { 35 | return hasProperty('BINTRAY_USER') ? BINTRAY_USER : "" 36 | } 37 | 38 | def getRepositoryPassword() { 39 | return hasProperty('BINTRAY_KEY') ? BINTRAY_KEY : "" 40 | } 41 | 42 | afterEvaluate { project -> 43 | uploadArchives { 44 | repositories { 45 | mavenDeployer { 46 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 47 | 48 | pom.groupId = GROUP 49 | pom.artifactId = POM_ARTIFACT_ID 50 | pom.version = VERSION_NAME 51 | 52 | repository(url: getReleaseRepositoryUrl()) { 53 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 54 | } 55 | snapshotRepository(url: getSnapshotRepositoryUrl()) { 56 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 57 | } 58 | 59 | pom.project { 60 | name POM_NAME 61 | packaging POM_PACKAGING 62 | description POM_DESCRIPTION 63 | url POM_URL 64 | 65 | scm { 66 | url POM_SCM_URL 67 | connection POM_SCM_CONNECTION 68 | developerConnection POM_SCM_DEV_CONNECTION 69 | } 70 | 71 | licenses { 72 | license { 73 | name POM_LICENCE_NAME 74 | url POM_LICENCE_URL 75 | distribution POM_LICENCE_DIST 76 | } 77 | } 78 | 79 | developers { 80 | developer { 81 | id POM_DEVELOPER_ID 82 | name POM_DEVELOPER_NAME 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | 90 | signing { 91 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } 92 | sign configurations.archives 93 | } 94 | 95 | task sourceJar(type: Jar) { 96 | classifier = 'sources' 97 | from sourceSets.main.allJava 98 | } 99 | 100 | task javadocJar(type: Jar) { 101 | classifier = 'javadoc' 102 | from javadoc 103 | } 104 | 105 | artifacts { 106 | archives sourceJar 107 | archives javadocJar 108 | } 109 | 110 | /* 111 | task androidJavadocs(type: Javadoc) { 112 | source = android.sourceSets.main.java.srcDirs 113 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 114 | } 115 | 116 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { 117 | classifier = 'javadoc' 118 | from androidJavadocs.destinationDir 119 | } 120 | 121 | task androidSourcesJar(type: Jar) { 122 | classifier = 'sources' 123 | from android.sourceSets.main.java.sourceFiles 124 | } 125 | 126 | artifacts { 127 | archives androidSourcesJar 128 | archives androidJavadocsJar 129 | } 130 | */ 131 | 132 | } 133 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/Keep.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies not to optimize or obfuscate the annotated class or 13 | * class member as an entry point. 14 | */ 15 | @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface Keep {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep the annotated class as an application, 13 | * together with its a main method. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepApplication {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepClassMemberNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all class members of the annotated class 13 | * from being optimized or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepClassMemberNames {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepClassMembers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all class members of the annotated class 13 | * from being shrunk, optimized, or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepClassMembers {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepGettersSetters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all getters and setters of the annotated 13 | * class from being shrunk, optimized, or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepGettersSetters {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepImplementations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all implementations or extensions of the 13 | * annotated class as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepImplementations {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies not to optimize or obfuscate the annotated class or 13 | * class member as an entry point. 14 | */ 15 | @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepName {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepPublicClassMemberNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all public class members of the annotated 13 | * class from being optimized or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepPublicClassMemberNames {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepPublicClassMembers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all public class members of the annotated 13 | * class from being shrunk, optimized, or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepPublicClassMembers {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepPublicGettersSetters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all public getters and setters of the 13 | * annotated class from being shrunk, optimized, or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepPublicGettersSetters {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepPublicImplementations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all public implementations or extensions 13 | * of the annotated class as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepPublicImplementations {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepPublicProtectedClassMemberNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all public or protected class members of 13 | * the annotated class from being optimized or obfuscated as entry points. 14 | */ 15 | @Target({ ElementType.TYPE }) 16 | @Retention(RetentionPolicy.CLASS) 17 | @Documented 18 | public @interface KeepPublicProtectedClassMemberNames {} 19 | -------------------------------------------------------------------------------- /proguard-annotations/src/main/java/proguard/annotation/KeepPublicProtectedClassMembers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 | * of Java bytecode. 4 | * 5 | * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) 6 | */ 7 | package proguard.annotation; 8 | 9 | import java.lang.annotation.*; 10 | 11 | /** 12 | * This annotation specifies to keep all public or protected class members of 13 | * the annotated class from being shrunk, optimized, or obfuscated as entry 14 | * points. 15 | */ 16 | @Target({ ElementType.TYPE }) 17 | @Retention(RetentionPolicy.CLASS) 18 | @Documented 19 | public @interface KeepPublicProtectedClassMembers {} 20 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':proguard-annotations' 2 | include ':android-proguard-annotations' 3 | include ':android-proguard-annotations-app' 4 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd proguard-annotations-app/build/outputs/apk 4 | unzip proguard-annotations-app-release-unsigned.apk 5 | dex2jar classes.dex 6 | unzip classes_dex2jar.jar 7 | tree proguard 8 | 9 | tree proguard | grep Dont > /dev/null 2>&1 10 | 11 | if [ $? ]; then 12 | echo Ok 13 | else 14 | echo No 15 | fi 16 | --------------------------------------------------------------------------------