Skip to content

Commit

Permalink
xDL version upgrade to 2.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
caikelun committed Mar 3, 2023
1 parent c8ca4ff commit 6edc5e5
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 57 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 HexHacking Team
Copyright (c) 2020-2023 HexHacking Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/release-1.2.1-red.svg?style=flat)
![](https://img.shields.io/badge/release-2.0.0-red.svg?style=flat)
![](https://img.shields.io/badge/Android-4.1%20--%2013-blue.svg?style=flat)
![](https://img.shields.io/badge/arch-armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)

Expand Down Expand Up @@ -61,10 +61,25 @@ android {
}
dependencies {
implementation 'io.github.hexhacking:xdl:1.2.1'
implementation 'io.github.hexhacking:xdl:2.0.0'
}
```

**NOTE**:

1. Starting from version `2.0.0` of xDL, group ID changed from `io.hexhacking` to `io.github.hexhacking`.

| version range | group ID | artifact ID | Repository URL |
|:---------------|:-------------------------|:------------| :--------------|
| [1.0.3, 1.2.1] | io.hexhacking | xdl | [repo](https://repo1.maven.org/maven2/io/hexhacking/xdl/) |
| [2.0.0, ) | **io.github.hexhacking** | xdl | [repo](https://repo.maven.apache.org/maven2/io/github/hexhacking/xdl/) |

2. xDL uses the [prefab package schema v2](https://github.com/google/prefab/releases/tag/v2.0.0), which is configured by default since [Android Gradle Plugin 7.1.0](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#7-1-0). If you are using Android Gradle Plugin earlier than 7.1.0, please add the following configuration to `gradle.properties`:

```
android.prefabVersion=2.0.0
```

### 2. Add dependency in CMakeLists.txt or Android.mk

> CMakeLists.txt
Expand Down
19 changes: 17 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/release-1.2.1-red.svg?style=flat)
![](https://img.shields.io/badge/release-2.0.0-red.svg?style=flat)
![](https://img.shields.io/badge/Android-4.1%20--%2013-blue.svg?style=flat)
![](https://img.shields.io/badge/arch-armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)

Expand Down Expand Up @@ -61,10 +61,25 @@ android {
}
dependencies {
implementation 'io.github.hexhacking:xdl:1.2.1'
implementation 'io.github.hexhacking:xdl:2.0.0'
}
```

**注意**

1. xDL 从版本 `2.0.0` 开始,group ID 从 `io.hexhacking` 改为 `io.github.hexhacking`

| 版本号范围 | group ID | artifact ID | 仓库 URL |
|:---------------|:-------------------------|:------------|:-----------------------------------------------------------------------|
| [1.0.3, 1.2.1] | io.hexhacking | xdl | [repo](https://repo1.maven.org/maven2/io/hexhacking/xdl/) |
| [2.0.0, ) | **io.github.hexhacking** | xdl | [repo](https://repo.maven.apache.org/maven2/io/github/hexhacking/xdl/) |

2. xDL 使用 [prefab package schema v2](https://github.com/google/prefab/releases/tag/v2.0.0),它是从 [Android Gradle Plugin 7.1.0](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#7-1-0) 开始作为默认配置的。如果你使用的是 Android Gradle Plugin 7.1.0 之前的版本,请在 `gradle.properties` 中加入以下配置:

```
android.prefabVersion=2.0.0
```

### 2. 在 CMakeLists.txt 或 Android.mk 中增加依赖

> CMakeLists.txt
Expand Down
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
}

task clean(type: Delete) {
Expand All @@ -11,17 +11,18 @@ ext {
minSdkVersion = 16
compileSdkVersion = 33
targetSdkVersion = 33
buildToolsVersion = "33.0.1"
javaVersion = JavaVersion.VERSION_1_7
buildToolsVersion = "33.0.2"
javaVersion = JavaVersion.VERSION_1_8
ndkVersion = "23.2.8568313"
cmakeVersion = "3.22.1"
abiFilters = "armeabi-v7a,arm64-v8a,x86,x86_64"
useASAN = false
dependencyOnLocalLibrary = true
xdlVersion = "2.0.0"

POM_GROUP_ID = "io.github.hexhacking"
POM_ARTIFACT_ID = "xdl"
POM_VERSION_NAME = "1.2.1"
POM_VERSION_NAME = "2.0.0"

POM_NAME = "xDL Android Lib"
POM_DESCRIPTION = "xDL is an enhanced implementation of the Android DL series functions."
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.enableJetifier=true
android.disableAutomaticComponentCreation=true
26 changes: 4 additions & 22 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,14 @@ if (secretPropsFile.exists()) {
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
}

task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}

project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact sourcesJar
artifact javadocJar

artifactId POM_ARTIFACT_ID
groupId POM_GROUP_ID
artifactId POM_ARTIFACT_ID
version POM_VERSION_NAME

pom {
Expand Down Expand Up @@ -84,9 +66,9 @@ project.afterEvaluate {
maven {
name = "sonatype"

def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = POM_VERSION_NAME.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

credentials {
username ossrhUsername
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
}
rootProject.name = "xDL"
Expand Down
8 changes: 8 additions & 0 deletions xdl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace 'io.github.hexhacking.xdl'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
ndkVersion rootProject.ext.ndkVersion
Expand Down Expand Up @@ -40,12 +41,19 @@ android {
}
buildFeatures {
prefabPublishing true
buildConfig false
}
prefab {
xdl {
headers "src/main/cpp/include"
}
}
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
}

apply from: rootProject.file('gradle/publish.gradle')
3 changes: 1 addition & 2 deletions xdl/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.hexhacking.xdl">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
4 changes: 2 additions & 2 deletions xdl/src/main/cpp/include/xdl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -22,7 +22,7 @@
// Created by caikelun on 2020-10-04.

//
// xDL version: 1.2.1
// xDL version: 2.0.0
//
// xDL is an enhanced implementation of the Android DL series functions.
// For more information, documentation, and the latest version please check:
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_iterate.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_iterate.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_linker.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_linker.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_lzma.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_lzma.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_util.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xdl/src/main/cpp/xdl_util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 HexHacking Team
// Copyright (c) 2020-2023 HexHacking Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 6 additions & 8 deletions xdl_sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace 'io.github.hexhacking.xdl.sample'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
ndkVersion rootProject.ext.ndkVersion
Expand All @@ -18,9 +19,6 @@ android {
externalNativeBuild {
cmake {
abiFilters rootProject.ext.abiFilters.split(",")
if (rootProject.ext.dependencyOnLocalLibrary) {
arguments "-DDEPENDENCY_ON_LOCAL_LIBRARY=ON"
}
}
}
}
Expand All @@ -34,8 +32,8 @@ android {
// }
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility rootProject.ext.javaVersion
targetCompatibility rootProject.ext.javaVersion
}
buildTypes {
debug {
Expand All @@ -59,14 +57,14 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

if (rootProject.ext.dependencyOnLocalLibrary) {
implementation project(':xdl')
} else {
implementation 'io.github.hexhacking:xdl:1.2.1'
implementation 'io.github.hexhacking:xdl:' + rootProject.ext.xdlVersion
}
}

Expand Down
3 changes: 1 addition & 2 deletions xdl_sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.hexhacking.xdl.sample">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".MyCustomApplication"
Expand Down

0 comments on commit 6edc5e5

Please sign in to comment.