├── settings.gradle ├── app ├── .gitignore ├── keystore │ ├── debug.keystore │ └── release.keystore ├── libs │ └── armeabi │ │ └── libstlport_shared.so ├── 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 │ │ ├── java │ │ │ └── tinker │ │ │ │ └── sample │ │ │ │ └── android │ │ │ │ ├── app │ │ │ │ ├── Bean.java │ │ │ │ ├── BaseBuildInfo.java │ │ │ │ ├── BuildInfo.java │ │ │ │ ├── SampleApplicationLike.java │ │ │ │ └── MainActivity.java │ │ │ │ ├── util │ │ │ │ ├── SampleApplicationContext.java │ │ │ │ ├── TinkerManager.java │ │ │ │ ├── Utils.java │ │ │ │ └── UpgradePatchRetry.java │ │ │ │ ├── Log │ │ │ │ └── MyLogImp.java │ │ │ │ ├── reporter │ │ │ │ ├── SamplePatchReporter.java │ │ │ │ ├── SampleLoadReporter.java │ │ │ │ ├── SamplePatchListener.java │ │ │ │ └── SampleTinkerReport.java │ │ │ │ ├── service │ │ │ │ └── SampleResultService.java │ │ │ │ └── crash │ │ │ │ └── SampleUncaughtExceptionHandler.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── tinker │ │ │ └── sample │ │ │ └── android │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── tinker │ │ └── sample │ │ └── android │ │ └── ApplicationTest.java ├── keep_in_main_dex.txt ├── proguard-rules.pro └── build.gradle ├── screenshots ├── patch.png ├── bug_apk.png ├── tinker.gif ├── assembleDebug.png └── tinkerPatchDebug.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .idea ├── vcs.xml ├── modules.xml └── runConfigurations.xml ├── updateTinkerLib.sh ├── proguard-rules.pro ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | 3 | /version.properties 4 | -------------------------------------------------------------------------------- /screenshots/patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/screenshots/patch.png -------------------------------------------------------------------------------- /screenshots/bug_apk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/screenshots/bug_apk.png -------------------------------------------------------------------------------- /screenshots/tinker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/screenshots/tinker.gif -------------------------------------------------------------------------------- /app/keystore/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/keystore/debug.keystore -------------------------------------------------------------------------------- /app/keystore/release.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/keystore/release.keystore -------------------------------------------------------------------------------- /screenshots/assembleDebug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/screenshots/assembleDebug.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /screenshots/tinkerPatchDebug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/screenshots/tinkerPatchDebug.png -------------------------------------------------------------------------------- /app/libs/armeabi/libstlport_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/libs/armeabi/libstlport_shared.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xinghongfei/Hello-Tinker/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | /.idea/ 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /updateTinkerLib.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | rm -rf ~/.gradle/caches/modules-2/metadata-2.16/descriptors/com.tencent.tinker 3 | 4 | #rm -rf ~/.m2/repository/com/tencent/tinker 5 | #adb push ./app/build/outputs/tinkerPatch/debug/patch_signed_7zip.apk /storage/sdcard0/ -------------------------------------------------------------------------------- /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 | #Wed Oct 21 11:34:03 PDT 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-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/tinker/sample/android/app/Bean.java: -------------------------------------------------------------------------------- 1 | package tinker.sample.android.app; 2 | 3 | /** 4 | * Created by xinghongfei on 16/10/10. 5 | */ 6 | 7 | public class Bean { 8 | private String mString="小主Bug已修复"; 9 | private String mBug="小主有一个Bug"; 10 | 11 | public String getMessage(){ 12 | return mBug; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /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/zhangshaowen/Library/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 | -------------------------------------------------------------------------------- /app/keep_in_main_dex.txt: -------------------------------------------------------------------------------- 1 | # you can copy the tinker keep rule at 2 | # build/intermediates/tinker_intermediates/tinker_multidexkeep.pro 3 | 4 | -keep class com.tencent.tinker.loader.** { 5 | *; 6 | } 7 | 8 | -keep class tinker.sample.android.app.SampleApplication { 9 | *; 10 | } 11 | 12 | -keep public class * implements com.tencent.tinker.loader.app.ApplicationLifeCycle { 13 | *; 14 | } 15 | 16 | -keep public class * extends com.tencent.tinker.loader.TinkerLoader { 17 | *; 18 | } 19 | 20 | -keep public class * extends com.tencent.tinker.loader.app.TinkerApplication { 21 | *; 22 | } 23 | 24 | # here, it is your own keep rules. 25 | # you must be careful that the class name you write won't be proguard 26 | # but the tinker class above is OK, we have already keep for you! 27 | -------------------------------------------------------------------------------- /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 /Users/zhangshaowen/Library/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 | -keepattributes SourceFile,LineNumberTable 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | TINKER_VERSION=1.6.2 21 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/tinker/sample/android/app/BaseBuildInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tinker available. 3 | * 4 | * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in 7 | * compliance with the License. You may obtain a copy of the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | * either express or implied. See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package tinker.sample.android.app; 18 | 19 | /** 20 | * Created by zhangshaowen on 16/6/30. 21 | * we add BaseBuildInfo to loader pattern, so it won't change with patch! 22 | */ 23 | public class BaseBuildInfo { 24 | public static String TEST_MESSAGE = "I won't change with tinker patch!"; 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/tinker/sample/android/util/SampleApplicationContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tinker available. 3 | * 4 | * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in 7 | * compliance with the License. You may obtain a copy of the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | * either express or implied. See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package tinker.sample.android.util; 18 | 19 | import android.app.Application; 20 | import android.content.Context; 21 | 22 | /** 23 | * Created by zhangshaowen on 16/8/9. 24 | */ 25 | public class SampleApplicationContext { 26 | public static Application application = null; 27 | public static Context context = null; 28 | } 29 | -------------------------------------------------------------------------------- /app/src/test/java/tinker/sample/android/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tinker available. 3 | * 4 | * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in 7 | * compliance with the License. You may obtain a copy of the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | * either express or implied. See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package tinker.sample.android; 18 | 19 | import org.junit.Test; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | /** 24 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 25 | */ 26 | public class ExampleUnitTest { 27 | @Test 28 | public void addition_isCorrect() throws Exception { 29 | assertEquals(4, 2 + 2); 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/tinker/sample/android/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tinker available. 3 | * 4 | * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in 7 | * compliance with the License. You may obtain a copy of the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | * either express or implied. See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package tinker.sample.android; 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 | } -------------------------------------------------------------------------------- /app/src/main/java/tinker/sample/android/app/BuildInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tinker available. 3 | * 4 | * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in 7 | * compliance with the License. You may obtain a copy of the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | * either express or implied. See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package tinker.sample.android.app; 18 | 19 | import tinker.sample.android.BuildConfig; 20 | 21 | /** 22 | * Created by zhangshaowen on 16/6/30. 23 | * we use BuildInfo instead of {@link BuildInfo} to make less change 24 | */ 25 | public class BuildInfo { 26 | /** 27 | * they are not final, so they won't change with the BuildConfig values! 28 | */ 29 | public static boolean DEBUG = BuildConfig.DEBUG; 30 | public static String VERSION_NAME = BuildConfig.VERSION_NAME; 31 | public static int VERSION_CODE = BuildConfig.VERSION_CODE; 32 | 33 | public static String MESSAGE = BuildConfig.MESSAGE; 34 | public static String CLIENTVERSION = BuildConfig.CLIENTVERSION; 35 | public static String PLATFORM = BuildConfig.PLATFORM; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 |