Skip to content

Commit f55948a

Browse files
committed
1. Update xDL to v1.0.4.
2. Switch from JCenter to Maven Central. 3. Change maven groupId:artifactId to io.hexhacking:xunwind.
1 parent 542e4ee commit f55948a

10 files changed

Lines changed: 134 additions & 105 deletions

File tree

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
44
![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)
5-
![](https://img.shields.io/badge/release-1.0.0-red.svg?style=flat)
5+
![](https://img.shields.io/badge/release-1.0.2-red.svg?style=flat)
66
![](https://img.shields.io/badge/Android-4.1%20--%2011-blue.svg?style=flat)
77
![](https://img.shields.io/badge/arch-armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)
88

@@ -35,11 +35,17 @@ xUnwind is a collection of Android native stack unwinding solutions.
3535

3636
## Usage
3737

38-
xUnwind uses [Prefab](https://google.github.io/prefab/) package format, which is supported by Android Gradle Plugin 4.0+.
38+
### 1. Add dependency in build.gradle
3939

40-
More information: [Using native dependencies](https://developer.android.com/studio/build/native-dependencies)
40+
xUnwind is published on [Maven Central](https://search.maven.org/), and uses [Prefab](https://google.github.io/prefab/) package format for [native dependencies](https://developer.android.com/studio/build/native-dependencies), which is supported by [Android Gradle Plugin 4.0+](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#native-dependencies).
4141

42-
### 1. Add dependency in build.gradle
42+
```Gradle
43+
allprojects {
44+
repositories {
45+
mavenCentral()
46+
}
47+
}
48+
```
4349

4450
```Gradle
4551
android {
@@ -49,7 +55,7 @@ android {
4955
}
5056
5157
dependencies {
52-
implementation 'io.hexhacking.xunwind:xunwind-android-lib:1.0.0'
58+
implementation 'io.hexhacking:xunwind:1.0.2'
5359
}
5460
```
5561

README.zh-CN.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
44
![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)
5-
![](https://img.shields.io/badge/release-1.0.0-red.svg?style=flat)
5+
![](https://img.shields.io/badge/release-1.0.2-red.svg?style=flat)
66
![](https://img.shields.io/badge/Android-4.1%20--%2011-blue.svg?style=flat)
77
![](https://img.shields.io/badge/arch-armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)
88

@@ -35,11 +35,17 @@ xUnwind 是一个安卓 native 栈回溯方案的集合。
3535

3636
## 使用
3737

38-
xUnwind 使用从 Android Gradle Plugin 4.0+ 开始支持的 [Prefab](https://google.github.io/prefab/) 包格式。
38+
### 1. 在 build.gradle 中增加依赖
3939

40-
更多信息: [使用 native 依赖项](https://developer.android.com/studio/build/native-dependencies)
40+
xUnwind 发布在 [Maven Central](https://search.maven.org/) 上。为了使用 [native 依赖项](https://developer.android.com/studio/build/native-dependencies),xUnwind 使用了从 [Android Gradle Plugin 4.0+](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#native-dependencies) 开始支持的 [Prefab](https://google.github.io/prefab/) 包格式。
4141

42-
### 1. 在 build.gradle 中增加依赖
42+
```Gradle
43+
allprojects {
44+
repositories {
45+
mavenCentral()
46+
}
47+
}
48+
```
4349

4450
```Gradle
4551
android {
@@ -49,7 +55,7 @@ android {
4955
}
5056
5157
dependencies {
52-
implementation 'io.hexhacking.xunwind:xunwind-android-lib:1.0.0'
58+
implementation 'io.hexhacking:xunwind:1.0.2'
5359
}
5460
```
5561

build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ buildscript {
55
}
66
dependencies {
77
classpath "com.android.tools.build:gradle:4.1.2"
8-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
98
}
109
}
1110

1211
allprojects {
1312
repositories {
1413
// mavenLocal()
1514
google()
15+
mavenCentral()
1616
jcenter()
1717
}
1818
}
@@ -32,9 +32,9 @@ ext {
3232
abiFilters = "armeabi-v7a,arm64-v8a,x86,x86_64"
3333
useASAN = false
3434

35-
POM_GROUP_ID = "io.hexhacking.xunwind"
36-
POM_ARTIFACT_ID = "xunwind-android-lib"
37-
POM_VERSION_NAME = "1.0.0"
35+
POM_GROUP_ID = "io.hexhacking"
36+
POM_ARTIFACT_ID = "xunwind"
37+
POM_VERSION_NAME = "1.0.2"
3838

3939
POM_NAME = "xUnwind Android Lib"
4040
POM_DESCRIPTION = "xUnwind is a collection of Android native stack unwinding solutions."
@@ -53,8 +53,4 @@ ext {
5353

5454
POM_DEVELOPER_ID = "HexHacking"
5555
POM_DEVELOPER_NAME = "HexHacking Team"
56-
57-
BINTRAY_REPO = "maven"
58-
BINTRAY_ORGANIZATION = "hexhacking"
59-
BINTRAY_LICENCE = ['MIT']
6056
}

gradle/publish.gradle

Lines changed: 66 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
apply plugin: 'maven-publish'
2-
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'signing'
33

4-
def readPropertyFromLocalProperties(String key) {
5-
Properties properties = new Properties()
6-
try {
7-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
8-
} catch (Exception e) {
9-
println("load local.properties failed. msg: ${e.message}")
10-
}
11-
return properties.getProperty(key)
12-
}
13-
14-
def getBintrayUser() {
15-
return readPropertyFromLocalProperties('BINTRAY_USER')
16-
}
4+
ext["signing.keyId"] = ''
5+
ext["signing.password"] = ''
6+
ext["signing.secretKeyRingFile"] = ''
7+
ext["ossrhUsername"] = ''
8+
ext["ossrhPassword"] = ''
179

18-
def getBintrayApikey() {
19-
return readPropertyFromLocalProperties('BINTRAY_APIKEY')
10+
File secretPropsFile = project.rootProject.file('local.properties')
11+
if (secretPropsFile.exists()) {
12+
Properties p = new Properties()
13+
p.load(new FileInputStream(secretPropsFile))
14+
p.each { name, value ->
15+
ext[name] = value
16+
}
17+
} else {
18+
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
19+
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
20+
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
21+
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
22+
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
2023
}
2124

2225
task sourcesJar(type: Jar) {
@@ -35,73 +38,65 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
3538
}
3639

3740
project.afterEvaluate {
38-
publishing.publications {
39-
mavenAar(MavenPublication) {
40-
from components.release
41+
publishing {
42+
publications {
43+
release(MavenPublication) {
44+
from components.release
4145

42-
artifact sourcesJar
43-
artifact javadocJar
46+
artifact sourcesJar
47+
artifact javadocJar
4448

45-
artifactId POM_ARTIFACT_ID
46-
groupId POM_GROUP_ID
47-
version POM_VERSION_NAME
49+
artifactId POM_ARTIFACT_ID
50+
groupId POM_GROUP_ID
51+
version POM_VERSION_NAME
4852

49-
pom {
50-
name = POM_NAME
51-
description = POM_DESCRIPTION
52-
url = POM_URL
53-
inceptionYear = POM_INCEPTION_YEAR
54-
packaging = POM_PACKAGING
55-
scm {
56-
connection = POM_SCM_CONNECTION
53+
pom {
54+
name = POM_NAME
55+
description = POM_DESCRIPTION
5756
url = POM_URL
58-
}
59-
issueManagement {
60-
system = POM_ISSUE_SYSTEM
61-
url = POM_ISSUE_URL
62-
}
63-
licenses {
64-
license {
65-
name = POM_LICENCE_NAME
66-
url = POM_LICENCE_URL
67-
distribution = POM_LICENCE_DIST
57+
inceptionYear = POM_INCEPTION_YEAR
58+
packaging = POM_PACKAGING
59+
scm {
60+
connection = POM_SCM_CONNECTION
61+
url = POM_URL
6862
}
69-
}
70-
developers {
71-
developer {
72-
id = POM_DEVELOPER_ID
73-
name = POM_DEVELOPER_NAME
63+
issueManagement {
64+
system = POM_ISSUE_SYSTEM
65+
url = POM_ISSUE_URL
66+
}
67+
licenses {
68+
license {
69+
name = POM_LICENCE_NAME
70+
url = POM_LICENCE_URL
71+
distribution = POM_LICENCE_DIST
72+
}
73+
}
74+
developers {
75+
developer {
76+
id = POM_DEVELOPER_ID
77+
name = POM_DEVELOPER_NAME
78+
}
7479
}
7580
}
7681
}
7782
}
78-
}
79-
}
83+
repositories {
84+
maven {
85+
name = "sonatype"
8086

81-
bintray {
82-
user = getBintrayUser()
83-
key = getBintrayApikey()
84-
publications = ['mavenAar']
85-
pkg {
86-
repo = BINTRAY_REPO
87-
name = "${POM_GROUP_ID}:${POM_ARTIFACT_ID}"
88-
userOrg = BINTRAY_ORGANIZATION
89-
desc = POM_DESCRIPTION
90-
websiteUrl = POM_URL
91-
issueTrackerUrl = POM_ISSUE_URL
92-
vcsUrl = POM_SCM_CONNECTION
93-
licenses = BINTRAY_LICENCE
94-
publicDownloadNumbers = true
95-
publish = true
96-
dryRun = false
87+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
88+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
89+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
9790

98-
version {
99-
name = POM_VERSION_NAME
100-
released = new Date()
101-
vcsTag = POM_VERSION_NAME
102-
gpg {
103-
sign = true
91+
credentials {
92+
username ossrhUsername
93+
password ossrhPassword
94+
}
10495
}
10596
}
10697
}
10798
}
99+
100+
signing {
101+
sign publishing.publications
102+
}

xunwind/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ android {
5151
}
5252

5353
dependencies {
54-
implementation 'io.hexhacking.xdl:xdl-android-lib:1.0.2'
54+
implementation 'io.hexhacking:xdl:1.0.4'
5555
}
5656

5757
apply from: rootProject.file('gradle/check.gradle')

xunwind/src/main/cpp/include/xunwind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// Created by caikelun on 2020-10-21.
2323

2424
//
25-
// xUnwind version: 1.0.0
25+
// xUnwind version: 1.0.2
2626
//
2727
// You can always get the latest version from:
2828
// https://github.com/hexhacking/xUnwind

xunwind/src/main/cpp/xu_libcorkscrew.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ int xu_libcorkscrew_init(void)
122122
ret = 0;
123123

124124
end:
125-
dlclose(handle);
125+
//dlclose(handle);
126126
return ret;
127127
}
128128

xunwind/src/main/cpp/xunwind.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@
4141
#include "xu_log.h"
4242
#include "xdl.h"
4343

44-
__attribute__((constructor)) static void xunwind_init(void)
45-
{
46-
#pragma clang diagnostic push
47-
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
48-
#define LOG(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "xunwind", fmt, ##__VA_ARGS__)
49-
#pragma clang diagnostic pop
50-
51-
if(0 != xu_cfi_init()) LOG("CFI init FAILED");
52-
if(0 != xu_fp_init()) LOG("FP init FAILED");
53-
}
54-
5544
void xunwind_cfi_log(pid_t pid, pid_t tid, void *context, const char *logtag, android_LogPriority priority, const char *prefix)
5645
{
5746
if(priority < ANDROID_LOG_VERBOSE || ANDROID_LOG_FATAL < priority) return;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) 2020-present, HexHacking Team. All rights reserved.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in all
11+
// copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
// SOFTWARE.
20+
//
21+
22+
// Created by caikelun on 2020-10-21.
23+
24+
#include <android/log.h>
25+
#include "xu_cfi.h"
26+
#include "xu_fp.h"
27+
28+
__attribute__((constructor)) static void xunwind_init(void)
29+
{
30+
#pragma clang diagnostic push
31+
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
32+
#define LOG(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "xunwind", fmt, ##__VA_ARGS__)
33+
#pragma clang diagnostic pop
34+
35+
if(0 != xu_cfi_init()) LOG("CFI init FAILED");
36+
if(0 != xu_fp_init()) LOG("FP init FAILED");
37+
}

xunwind_sample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ android {
4242

4343
dependencies {
4444
implementation 'androidx.appcompat:appcompat:1.2.0'
45-
implementation 'com.google.android.material:material:1.2.1'
45+
implementation 'com.google.android.material:material:1.3.0'
4646
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
4747

4848
implementation project(':xunwind')
49-
// implementation 'io.hexhacking.xunwind:xunwind-android-lib:1.0.0'
49+
// implementation 'io.hexhacking:xunwind:1.0.2'
5050
}
5151

5252
apply from: rootProject.file('gradle/sanitizer.gradle')

0 commit comments

Comments
 (0)