[hebe-android] Update dependencies

This commit is contained in:
Mikołaj Pich 2022-05-03 11:37:44 +02:00
parent 2751b70235
commit b6a9527a11
10 changed files with 81 additions and 94 deletions

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -1,13 +1,11 @@
# UONET+ (hebe) Request Signer for Android
[![Bintray](https://img.shields.io/bintray/v/wulkanowy/wulkanowy/uonet-request-signer-hebe-android.svg?style=flat-square)](https://bintray.com/wulkanowy/wulkanowy/uonet-request-signer-hebe-android)
## Installation
```groovy
allprojects {
repositories {
maven { url "https://dl.bintray.com/wulkanowy/wulkanowy" }
mavenLocal()
}
}

View file

@ -1,14 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
defaultConfig {
applicationId "io.github.wulkanowy.signer.hebe.android.app"
minSdkVersion 18
targetSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -24,6 +22,6 @@ android {
dependencies {
implementation project(":lib")
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
}

View file

@ -11,7 +11,9 @@
android:theme="@style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity android:name="io.github.wulkanowy.signer.hebe.android.app.SignerActivity">
<activity
android:name="io.github.wulkanowy.signer.hebe.android.app.SignerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

View file

@ -1,21 +1,36 @@
package io.github.wulkanowy.signer.hebe.android.app
import android.annotation.SuppressLint
import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import io.github.wulkanowy.signer.hebe.android.generateKeyPair
import io.github.wulkanowy.signer.hebe.android.getKeyEntry
import io.github.wulkanowy.signer.hebe.android.getSignatureValues
import kotlinx.android.synthetic.main.activity_main.*
import java.util.*
import java.util.concurrent.TimeUnit
@SuppressLint("SetTextI18n")
class SignerActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val generate = findViewById<Button>(R.id.generate)
val timer = findViewById<TextView>(R.id.timer)
val certificate = findViewById<EditText>(R.id.certificate)
val fingerprint = findViewById<EditText>(R.id.fingerprint)
val privateKey = findViewById<EditText>(R.id.privateKey)
val filldata = findViewById<Button>(R.id.filldata)
val fullUrl = findViewById<EditText>(R.id.fullUrl)
val content = findViewById<EditText>(R.id.content)
val sign = findViewById<Button>(R.id.sign)
val result = findViewById<TextView>(R.id.result)
generate.setOnClickListener {
val start = Date()
val (certificateStr, fingerprintStr, _) = generateKeyPair(this, "KeyEntry")
@ -28,7 +43,7 @@ class SignerActivity : Activity() {
filldata.setOnClickListener {
certificate.setText("")
fingerprint.setText("7EBA57E1DDBA1C249D097A9FF1C9CCDD45351A6A".toLowerCase())
fingerprint.setText("7EBA57E1DDBA1C249D097A9FF1C9CCDD45351A6A".lowercase())
privateKey.setText("MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDCbF5Tt176EpB4cX5U+PZE0XytjJ9ABDZFaBFDkaexbkuNeuLOaARjQEOlUoBmpZQXxAF8HlYqeTvPiTcnSfQIS6EdqpICuQNdwvy6CHFAe2imkbbB0aHPsGep6zH8ZxHbssazkTCnGy0j2ZtGT2/iy1GEvc/p2bOkCVcR1H1GqFp+/X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nXHb0BDQ8br7twH+ZJ8wkC4yRXLXJVMzUujZJtrarHhAXNIRoVU/MXUkcV1m/3wRGV119M4IAbHFnQdbO0N8kaMTmwS4DxYzh0LzbHMM+JpGtPgDENRx3unWD/aYZzuvQnnQP3O9n7Kh46BwNQRWUMamL3+tY8n83WZwhqC4QKBgBTUzHy0sEEZ3hYgwU2ygbzC0vPladw2KqtKy+0LdHtx5pqE4/pvhVMpRRTNBDiAvb5lZmMB/B3CzoiMQOwczuus8Xsx7bEci28DzQ+g2zt0/bC2Xl+992Ass5PP5NtOrP/9QiTNgoFSCrVnZnNzQqpjCrFsjfOD2fiuFLCD6zi6")
fullUrl.setText("/powiatwulkanowy/123456/api/mobile/register/hebe")
content.setText("{}")
@ -43,19 +58,19 @@ class SignerActivity : Activity() {
val (digest, canonicalUrl, signature) = if (keyString.startsWith("AndroidKeyStore")) {
val (_, _, key) = getKeyEntry(keyString.split(" ")[1])!!
getSignatureValues(
fingerprint.text.toString(),
key,
content.text.toString(),
fullUrl.text.toString(),
Date()
fingerprint.text.toString(),
key,
content.text.toString(),
fullUrl.text.toString(),
Date()
)
} else {
getSignatureValues(
fingerprint.text.toString(),
keyString,
content.text.toString(),
fullUrl.text.toString(),
Date()
fingerprint.text.toString(),
keyString,
content.text.toString(),
fullUrl.text.toString(),
Date()
)
}

View file

@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="8dp">
android:padding="8dp"
tools:ignore="HardcodedText">
<LinearLayout
android:layout_width="match_parent"

View file

@ -1,26 +1,21 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.0'
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://dl.bintray.com/wulkanowy/wulkanowy" }
mavenCentral()
}
}

View file

@ -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-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

View file

@ -1,7 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
ext {
PUBLISH_VERSION = '0.1.0'
@ -13,12 +12,11 @@ group 'io.github.wulkanowy'
version PUBLISH_VERSION
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
defaultConfig {
minSdkVersion 18
targetSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName PUBLISH_VERSION
@ -35,70 +33,49 @@ android {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.brsanthu:migbase64:2.2"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
pkg {
repo = 'wulkanowy'
name = 'uonet-request-signer-hebe-android'
userOrg = 'wulkanowy'
licenses = ['Apache-2.0']
vcsUrl = GIT_URL
labels = ['aar', 'wulkanowy', 'uonet-request-signer', 'hebe', 'uonet-request-signer-hebe', 'android']
publicDownloadNumbers = true
publish = true
version {
name = PUBLISH_VERSION
vcsTag = PUBLISH_VERSION
released = new Date()
}
}
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
artifact androidSourcesJar
groupId = group
artifactId "uonet-request-signer-hebe-android"
name 'UONET+ (hebe) request signer for Android'
url SITE_URL
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
version = android.defaultConfig.versionName
pom {
name = 'UONET+ (hebe) request signer for Android'
url = SITE_URL
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
}
developers {
developer {
id 'kuba2k2'
name 'Kuba Szczodrzyński'
email 'kuba@szczodrzynski.pl'
developers {
developer {
id = 'kuba2k2'
name = 'Kuba Szczodrzyński'
email = 'kuba@szczodrzynski.pl'
}
}
scm {
connection = GIT_URL
developerConnection = GIT_URL
url = SITE_URL
}
}
scm {
connection GIT_URL
developerConnection GIT_URL
url SITE_URL
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}

View file

@ -29,7 +29,7 @@ private fun getEncodedPath(path: String): String {
val url = ("(api/mobile/.+)".toRegex().find(path))
?: throw IllegalArgumentException("The URL does not seem correct (does not match `(api/mobile/.+)` regex)")
return URLEncoder.encode(url.groupValues[0], "UTF-8").orEmpty().toLowerCase()
return URLEncoder.encode(url.groupValues[0], "UTF-8").orEmpty().lowercase()
}
private fun getHeadersList(body: String?, digest: String, canonicalUrl: String, timestamp: Date): Pair<String, String> {