Skip to content

Commit 3860cf4

Browse files
authored
Merge pull request 5A59#1 from 5A59/hotfix
Hotfix
2 parents 2b8b204 + 6a7eef7 commit 3860cf4

File tree

81 files changed

+2558
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2558
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Groovy 使用及源码分析
1414
#### 常用技术篇 -- 开发进阶必备
1515
* [插件化](./common-tec/android-插件化.md)
16-
* 热修复
16+
* [热修复](./common-tec/android-热修复.md)
1717
* 组件化
1818
* 自定义控件
1919
* App 架构模式(MVC / MVP / MVVM)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Sets the minimum version of CMake required to build your native library.
2+
# This ensures that a certain set of CMake features is available to
3+
# your build.
4+
5+
cmake_minimum_required(VERSION 3.4.1)
6+
7+
# Specifies a library name, specifies whether the library is STATIC or
8+
# SHARED, and provides relative paths to the source code. You can
9+
# define multiple libraries by adding multiple add.library() commands,
10+
# and CMake builds them for you. When you build your app, Gradle
11+
# automatically packages shared libraries with your APK.
12+
13+
add_library( # Specifies the name of the library.
14+
native-hook
15+
16+
# Sets the library as a shared library.
17+
SHARED
18+
19+
# Provides a relative path to your source file(s).
20+
src/main/cpp/native-hook.cpp )
21+
22+
include_directories(src/main/cpp/)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apply plugin: 'com.android.application'
2+
3+
apply plugin: 'kotlin-android'
4+
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
android {
8+
compileSdkVersion 28
9+
buildToolsVersion "29.0.1"
10+
11+
defaultConfig {
12+
applicationId "com.zy.hotfix"
13+
minSdkVersion 19
14+
targetSdkVersion 28
15+
versionCode 1
16+
versionName "1.0"
17+
externalNativeBuild {
18+
ndk {
19+
abiFilters 'armeabi', 'x86'
20+
}
21+
cmake {
22+
// Use the following syntax when passing arguments to variables:
23+
// arguments "-DVAR_NAME=ARGUMENT".
24+
//api level 19的so不能使用libc++编译,需要使用libstdc++
25+
arguments "-DANDROID_ARM_NEON=TRUE",
26+
// If you're passing multiple arguments to a variable, pass them together:
27+
// arguments "-DVAR_NAME=ARG_1 ARG_2"
28+
// The following line passes 'rtti' and 'exceptions' to 'ANDROID_CPP_FEATURES'.
29+
"-DANDROID_STL=c++_shared"
30+
cppFlags "-std=gnu++11"
31+
}
32+
}
33+
}
34+
35+
buildTypes {
36+
release {
37+
minifyEnabled false
38+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
39+
}
40+
}
41+
42+
externalNativeBuild {
43+
cmake {
44+
path "CMakeLists.txt"
45+
}
46+
}
47+
}
48+
49+
dependencies {
50+
implementation fileTree(dir: 'libs', include: ['*.jar'])
51+
implementation 'com.android.support:appcompat-v7:28.0.0'
52+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
53+
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
54+
}
55+
56+
project.afterEvaluate {
57+
project.tasks.each {
58+
if (it.name == 'mergeDebugAssets') {
59+
it.dependsOn ':patch:assembleDebug'
60+
}
61+
}
62+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.zy.hotfix;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.zy.hotfix", appContext.getPackageName());
25+
}
26+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.zy.hotfix">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN"/>
15+
16+
<category android:name="android.intent.category.LAUNCHER"/>
17+
</intent-filter>
18+
</activity>
19+
<activity android:name=".PatchActivity"/>
20+
</application>
21+
22+
</manifest>
Binary file not shown.

0 commit comments

Comments
 (0)