├── settings.gradle ├── 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 │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── tinker │ │ └── sample │ │ └── android │ │ └── app │ │ ├── MainActivity.java │ │ └── SampleApplicationLike.java ├── tinkerMultidexKeep.pro ├── build.gradle ├── proguardRules.pro └── tinkerpatch.gradle ├── keystore └── debug.keystore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .travis.yml ├── README.md ├── .gitignore ├── gradle.properties ├── LICENSE ├── gradlew.bat └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | 3 | /version.properties 4 | -------------------------------------------------------------------------------- /keystore/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/keystore/debug.keystore -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerPatch/tinkerpatch-sample/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | tinker-sample-android 3 | I am in the base apk 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Nov 12 12:36:02 PST 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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | 4 | cache: 5 | directories: 6 | - .autoconf 7 | - $HOME/.m2 8 | 9 | android: 10 | components: 11 | - tools 12 | - tools # see https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943 13 | - platform-tools 14 | - build-tools-26.0.2 15 | - android-26 16 | - extra-android-m2repository 17 | 18 | script: ./gradlew clean check test 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This repository is DEPRECATED 2 | 3 | # TinkerPatch SDK Sample 4 | 5 | [![Build Status](https://travis-ci.org/TinkerPatch/tinkerpatch-sample.svg?branch=master)](https://travis-ci.org/TinkerPatch/tinkerpatch-sample) 6 | [![Download](https://api.bintray.com/packages/simsun/maven/tinkerpatch-android-sdk/images/download.svg) ](https://bintray.com/simsun/maven/tinkerpatch-android-sdk/_latestVersion) 7 | [![Join Slack](https://slack.tinkerpatch.com/badge.svg)](https://slack.tinkerpatch.com) 8 | 9 | [相关文档](http://tinkerpatch.com/Docs/intro) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | 39 | # Keystore files 40 | *.jks 41 | 42 | .idea 43 | test.tmp 44 | reports 45 | .DS_Store 46 | 47 | example 48 | -------------------------------------------------------------------------------- /app/tinkerMultidexKeep.pro: -------------------------------------------------------------------------------- 1 | 2 | #tinker multidex keep patterns: 3 | -keep public class * implements com.tencent.tinker.loader.app.ApplicationLifeCycle { 4 | (...); 5 | void onBaseContextAttached(android.content.Context); 6 | } 7 | 8 | -keep public class * extends com.tencent.tinker.loader.TinkerLoader { 9 | (...); 10 | } 11 | 12 | -keep public class * extends android.app.Application { 13 | (); 14 | void attachBaseContext(android.content.Context); 15 | } 16 | 17 | -keep class com.tencent.tinker.loader.TinkerTestAndroidNClassLoader { 18 | (...); 19 | } 20 | 21 | #your dex.loader patterns here 22 | -keep class tinker.sample.android.app.SampleApplication { 23 | (...); 24 | } 25 | 26 | -keep class com.tencent.tinker.loader.** { 27 | (...); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Thu Dec 08 22:20:28 CST 2016 16 | 17 | TINKER_VERSION=1.9.2 18 | TINKERPATCH_VERSION=1.2.2 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Shengjie Sim Sun 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | dependencies { 4 | implementation fileTree(dir: 'libs', include: ['*.jar']) 5 | implementation "com.android.support:appcompat-v7:25.3.1" 6 | implementation "com.android.support:multidex:1.0.2" 7 | //若使用annotation需要单独引用,对于tinker的其他库都无需再引用 8 | annotationProcessor("com.tinkerpatch.tinker:tinker-android-anno:${TINKER_VERSION}") { changing = true } 9 | compileOnly("com.tinkerpatch.tinker:tinker-android-anno:${TINKER_VERSION}") { changing = true } 10 | implementation("com.tinkerpatch.sdk:tinkerpatch-android-sdk:${TINKERPATCH_VERSION}") { changing = true } 11 | } 12 | 13 | 14 | android { 15 | compileSdkVersion 26 16 | buildToolsVersion "26.0.2" 17 | 18 | signingConfigs { 19 | debug { 20 | storeFile rootProject.file("keystore/debug.keystore") 21 | } 22 | } 23 | 24 | defaultConfig { 25 | applicationId "tinker.sample.android" 26 | minSdkVersion 10 27 | targetSdkVersion 22 28 | versionName "1.0.0" 29 | versionCode 1 30 | multiDexEnabled true 31 | multiDexKeepProguard file("tinkerMultidexKeep.pro") //keep specific classes using proguard syntax 32 | } 33 | 34 | buildTypes { 35 | release { 36 | minifyEnabled true 37 | shrinkResources true 38 | signingConfig signingConfigs.debug 39 | 40 | proguardFiles 'proguardRules.pro', getDefaultProguardFile('proguard-android.txt') 41 | } 42 | debug { 43 | debuggable true 44 | minifyEnabled false 45 | signingConfig signingConfigs.debug 46 | } 47 | } 48 | sourceSets { 49 | main { 50 | jniLibs.srcDirs = ['libs'] 51 | } 52 | } 53 | } 54 | 55 | apply from: 'tinkerpatch.gradle' 56 | -------------------------------------------------------------------------------- /app/proguardRules.pro: -------------------------------------------------------------------------------- 1 | # help us to debug 2 | -renamesourcefileattribute SourceFile 3 | -keepattributes Exceptions 4 | -keepattributes SourceFile,LineNumberTable,keepattributes 5 | -keepattributes InnerClasses 6 | -keepattributes EnclosingMethod 7 | -keepattributes Signature 8 | -keepattributes *Annotation* 9 | -dontshrink 10 | 11 | # Config need by TinkerPatch 12 | -keep class com.tinkerpatch.sdk.TinkerPatch { *; } 13 | -keep class com.tinkerpatch.sdk.BuildConfig { *; } 14 | 15 | -keep class com.tinkerpatch.sdk.TinkerPatch$Builder { *; } 16 | -keep class com.tinkerpatch.sdk.server.RequestLoader { *; } 17 | -keep class com.tinkerpatch.sdk.util.ContentLengthInputStream { *; } 18 | -keep interface com.tinkerpatch.sdk.server.model.DataFetcher { *; } 19 | -keep interface com.tinkerpatch.sdk.server.model.DataFetcher$DataCallback { *; } 20 | -keep class com.tinkerpatch.sdk.server.model.TinkerClientUrl { *; } 21 | -keep class com.tinkerpatch.sdk.server.callback.** { *; } 22 | -keep class com.tinkerpatch.sdk.tinker.callback.** { *; } 23 | -keep public class * extends android.app.Application 24 | -keep class com.tinkerpatch.sdk.loader.TinkerPatchApplicationLike { *; } 25 | -keep class com.tencent.tinker.** { *; } 26 | 27 | # Config from tinker 28 | -dontwarn com.tencent.tinker.anno.AnnotationProcessor 29 | -keep @com.tencent.tinker.anno.DefaultLifeCycle public class * 30 | -keep public class * extends android.app.Application { 31 | *; 32 | } 33 | 34 | -keep public class com.tencent.tinker.loader.app.ApplicationLifeCycle { 35 | *; 36 | } 37 | -keep public class * implements com.tencent.tinker.loader.app.ApplicationLifeCycle { 38 | *; 39 | } 40 | 41 | -keep public class com.tencent.tinker.loader.TinkerLoader { 42 | *; 43 | } 44 | -keep public class * extends com.tencent.tinker.loader.TinkerLoader { 45 | *; 46 | } 47 | -keep public class com.tencent.tinker.loader.TinkerTestDexLoad { 48 | *; 49 | } 50 | -keep public class com.tencent.tinker.loader.TinkerTestAndroidNClassLoader { 51 | *; 52 | } 53 | 54 | #your dex.loader patterns here 55 | -keep class tinker.sample.android.app.SampleApplication 56 | -keep class com.tencent.tinker.loader.** 57 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 |