2023-01-20 17:39:16 +00:00
|
|
|
import com.android.tools.profgen.ArtProfileKt
|
|
|
|
import com.android.tools.profgen.ArtProfileSerializer
|
|
|
|
import com.android.tools.profgen.DexFile
|
|
|
|
|
2021-03-15 08:51:51 +00:00
|
|
|
plugins {
|
2024-11-22 20:59:39 +00:00
|
|
|
alias libs.plugins.android.application
|
|
|
|
alias libs.plugins.kotlin.android
|
|
|
|
alias libs.plugins.kotlin.compose
|
|
|
|
alias libs.plugins.kotlin.kapt
|
|
|
|
alias libs.plugins.kotlin.parcelize
|
|
|
|
alias libs.plugins.checkstyle
|
|
|
|
alias libs.plugins.sonarqube
|
|
|
|
alias libs.plugins.hilt
|
2021-03-15 08:51:51 +00:00
|
|
|
}
|
|
|
|
|
2015-09-04 00:15:03 +00:00
|
|
|
android {
|
2023-10-31 20:31:16 +00:00
|
|
|
compileSdk 34
|
2022-09-17 13:47:03 +00:00
|
|
|
namespace 'org.schabi.newpipe'
|
2015-09-04 00:15:03 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "org.schabi.newpipe"
|
2020-02-23 08:46:42 +00:00
|
|
|
resValue "string", "app_name", "NewPipe"
|
2022-07-06 20:30:30 +00:00
|
|
|
minSdk 21
|
2022-11-05 22:44:35 +00:00
|
|
|
targetSdk 33
|
2024-08-11 02:41:50 +00:00
|
|
|
versionCode 999
|
|
|
|
versionName "0.27.2"
|
2017-06-28 05:27:32 +00:00
|
|
|
|
2019-10-04 12:59:08 +00:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2019-04-28 20:43:52 +00:00
|
|
|
|
|
|
|
javaCompileOptions {
|
|
|
|
annotationProcessorOptions {
|
|
|
|
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 00:15:03 +00:00
|
|
|
}
|
2018-08-11 13:43:52 +00:00
|
|
|
|
2015-09-04 00:15:03 +00:00
|
|
|
buildTypes {
|
2017-08-07 13:02:30 +00:00
|
|
|
debug {
|
|
|
|
debuggable true
|
2020-02-23 08:46:42 +00:00
|
|
|
|
2020-02-23 19:56:56 +00:00
|
|
|
// suffix the app id and the app name with git branch name
|
2020-03-02 19:50:35 +00:00
|
|
|
def workingBranch = getGitWorkingBranch()
|
2020-09-26 20:32:11 +00:00
|
|
|
def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "")
|
2020-03-02 19:50:35 +00:00
|
|
|
if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" || workingBranch == "dev") {
|
|
|
|
// default values when branch name could not be determined or is master or dev
|
2020-02-23 08:46:42 +00:00
|
|
|
applicationIdSuffix ".debug"
|
|
|
|
resValue "string", "app_name", "NewPipe Debug"
|
|
|
|
} else {
|
2020-03-02 19:50:35 +00:00
|
|
|
applicationIdSuffix ".debug." + normalizedWorkingBranch
|
2020-02-23 08:46:42 +00:00
|
|
|
resValue "string", "app_name", "NewPipe " + workingBranch
|
2020-03-25 21:47:29 +00:00
|
|
|
archivesBaseName = 'NewPipe_' + normalizedWorkingBranch
|
2020-02-23 08:46:42 +00:00
|
|
|
}
|
2017-08-07 13:02:30 +00:00
|
|
|
}
|
2020-04-11 20:17:39 +00:00
|
|
|
|
|
|
|
release {
|
2021-09-12 18:19:45 +00:00
|
|
|
if (System.properties.containsKey('packageSuffix')) {
|
|
|
|
applicationIdSuffix System.getProperty('packageSuffix')
|
|
|
|
resValue "string", "app_name", "NewPipe " + System.getProperty('packageSuffix')
|
|
|
|
archivesBaseName = 'NewPipe_' + System.getProperty('packageSuffix')
|
|
|
|
}
|
2020-04-11 20:17:39 +00:00
|
|
|
minifyEnabled true
|
2020-07-23 19:19:21 +00:00
|
|
|
shrinkResources false // disabled to fix F-Droid's reproducible build
|
2020-04-11 20:17:39 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
archivesBaseName = 'app'
|
|
|
|
}
|
2015-09-04 00:15:03 +00:00
|
|
|
}
|
2015-12-24 13:55:33 +00:00
|
|
|
|
2022-01-21 21:25:11 +00:00
|
|
|
lint {
|
2015-12-01 20:31:10 +00:00
|
|
|
checkReleaseBuilds false
|
|
|
|
// Or, if you prefer, you can continue to check for errors in release builds,
|
|
|
|
// but continue the build even when errors are found:
|
|
|
|
abortOnError false
|
2021-04-19 13:56:15 +00:00
|
|
|
// suppress false warning ("Resource IDs will be non-final in Android Gradle Plugin version
|
|
|
|
// 5.0, avoid using them in switch case statements"), which affects only library projects
|
|
|
|
disable 'NonConstantResourceId'
|
2015-12-01 20:31:10 +00:00
|
|
|
}
|
2018-08-11 13:43:52 +00:00
|
|
|
|
2016-02-05 16:09:29 +00:00
|
|
|
compileOptions {
|
2020-06-25 11:12:59 +00:00
|
|
|
// Flag to enable support for the new language APIs
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
|
2023-04-20 09:31:45 +00:00
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2020-04-13 20:40:44 +00:00
|
|
|
encoding 'utf-8'
|
2016-02-05 16:09:29 +00:00
|
|
|
}
|
2019-04-28 20:43:54 +00:00
|
|
|
|
2020-09-13 11:50:29 +00:00
|
|
|
kotlinOptions {
|
2023-04-20 09:31:45 +00:00
|
|
|
jvmTarget = JavaVersion.VERSION_17
|
2020-09-13 11:50:29 +00:00
|
|
|
}
|
|
|
|
|
2020-03-07 17:46:32 +00:00
|
|
|
sourceSets {
|
|
|
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
|
|
|
}
|
2020-10-31 04:37:18 +00:00
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
viewBinding true
|
2024-02-27 19:03:46 +00:00
|
|
|
compose true
|
2024-10-22 19:40:16 +00:00
|
|
|
buildConfig true
|
2020-10-31 04:37:18 +00:00
|
|
|
}
|
2023-04-04 15:42:34 +00:00
|
|
|
|
|
|
|
packagingOptions {
|
2023-04-20 08:24:19 +00:00
|
|
|
resources {
|
|
|
|
// remove two files which belong to jsoup
|
|
|
|
// no idea how they ended up in the META-INF dir...
|
2023-11-17 21:58:30 +00:00
|
|
|
excludes += ['META-INF/README.md', 'META-INF/CHANGES',
|
|
|
|
// 'COPYRIGHT' belongs to RxJava...
|
|
|
|
'META-INF/COPYRIGHT']
|
2023-04-20 08:24:19 +00:00
|
|
|
}
|
2023-04-04 15:42:34 +00:00
|
|
|
}
|
2015-09-04 00:15:03 +00:00
|
|
|
}
|
|
|
|
|
2020-06-28 12:59:44 +00:00
|
|
|
configurations {
|
|
|
|
checkstyle
|
2020-10-31 20:55:45 +00:00
|
|
|
ktlint
|
2020-06-28 12:59:44 +00:00
|
|
|
}
|
|
|
|
|
2020-03-27 19:45:26 +00:00
|
|
|
checkstyle {
|
2022-03-18 18:58:59 +00:00
|
|
|
getConfigDirectory().set(rootProject.file("checkstyle"))
|
2020-03-27 19:45:26 +00:00
|
|
|
ignoreFailures false
|
|
|
|
showViolations true
|
2024-11-22 20:59:39 +00:00
|
|
|
toolVersion = libs.versions.checkstyle.get()
|
2020-03-27 19:45:26 +00:00
|
|
|
}
|
|
|
|
|
2023-11-01 01:28:24 +00:00
|
|
|
tasks.register('runCheckstyle', Checkstyle) {
|
2020-03-27 19:45:26 +00:00
|
|
|
source 'src'
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
exclude '**/R.java'
|
|
|
|
exclude '**/BuildConfig.java'
|
|
|
|
exclude 'main/java/us/shandian/giga/**'
|
|
|
|
|
2020-06-28 12:59:44 +00:00
|
|
|
classpath = configurations.checkstyle
|
2020-03-27 19:45:26 +00:00
|
|
|
|
|
|
|
showViolations true
|
|
|
|
|
|
|
|
reports {
|
2021-07-06 16:16:20 +00:00
|
|
|
xml.getRequired().set(true)
|
|
|
|
html.getRequired().set(true)
|
2020-03-27 19:45:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-31 20:55:45 +00:00
|
|
|
def outputDir = "${project.buildDir}/reports/ktlint/"
|
|
|
|
def inputFiles = project.fileTree(dir: "src", include: "**/*.kt")
|
|
|
|
|
2023-11-01 01:28:24 +00:00
|
|
|
tasks.register('runKtlint', JavaExec) {
|
2020-10-31 20:55:45 +00:00
|
|
|
inputs.files(inputFiles)
|
|
|
|
outputs.dir(outputDir)
|
2021-07-06 16:16:20 +00:00
|
|
|
getMainClass().set("com.pinterest.ktlint.Main")
|
2020-10-31 20:55:45 +00:00
|
|
|
classpath = configurations.ktlint
|
|
|
|
args "src/**/*.kt"
|
2023-04-25 16:37:04 +00:00
|
|
|
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
|
2020-10-31 20:55:45 +00:00
|
|
|
}
|
|
|
|
|
2023-11-01 01:28:24 +00:00
|
|
|
tasks.register('formatKtlint', JavaExec) {
|
2020-10-31 20:55:45 +00:00
|
|
|
inputs.files(inputFiles)
|
|
|
|
outputs.dir(outputDir)
|
2021-07-06 16:16:20 +00:00
|
|
|
getMainClass().set("com.pinterest.ktlint.Main")
|
2020-10-31 20:55:45 +00:00
|
|
|
classpath = configurations.ktlint
|
|
|
|
args "-F", "src/**/*.kt"
|
2023-04-25 16:37:04 +00:00
|
|
|
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
|
2020-10-31 20:55:45 +00:00
|
|
|
}
|
2020-05-01 18:09:52 +00:00
|
|
|
|
2024-11-26 18:32:44 +00:00
|
|
|
apply from: 'check-dependencies.gradle'
|
|
|
|
|
2020-04-20 15:01:36 +00:00
|
|
|
afterEvaluate {
|
2021-08-06 16:11:22 +00:00
|
|
|
if (!System.properties.containsKey('skipFormatKtlint')) {
|
|
|
|
preDebugBuild.dependsOn formatKtlint
|
|
|
|
}
|
2024-11-26 18:32:44 +00:00
|
|
|
preDebugBuild.dependsOn runCheckstyle, runKtlint, checkDependenciesOrder
|
2020-04-20 15:01:36 +00:00
|
|
|
}
|
2020-03-27 19:45:26 +00:00
|
|
|
|
2022-11-29 16:20:31 +00:00
|
|
|
sonar {
|
2021-03-15 08:51:51 +00:00
|
|
|
properties {
|
|
|
|
property "sonar.projectKey", "TeamNewPipe_NewPipe"
|
|
|
|
property "sonar.organization", "teamnewpipe"
|
|
|
|
property "sonar.host.url", "https://sonarcloud.io"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-21 19:17:26 +00:00
|
|
|
kapt {
|
|
|
|
correctErrorTypes true
|
|
|
|
}
|
|
|
|
|
2015-09-04 00:15:03 +00:00
|
|
|
dependencies {
|
2021-03-31 15:49:55 +00:00
|
|
|
/** Desugaring **/
|
2024-11-22 20:59:39 +00:00
|
|
|
coreLibraryDesugaring libs.desugar.jdk.libs.nio
|
2020-06-25 11:12:59 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** NewPipe libraries **/
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.teamnewpipe.nanojson
|
|
|
|
implementation libs.teamnewpipe.newpipe.extractor
|
|
|
|
implementation libs.teamnewpipe.nononsense.filepicker
|
2020-05-01 14:06:02 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** Checkstyle **/
|
2024-11-22 20:59:39 +00:00
|
|
|
checkstyle libs.tools.checkstyle
|
|
|
|
ktlint libs.tools.ktlint
|
2017-06-28 05:27:32 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** Kotlin **/
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.kotlin.stdlib
|
2017-03-27 19:34:37 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** AndroidX **/
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.androidx.appcompat
|
|
|
|
implementation libs.androidx.cardview
|
|
|
|
implementation libs.androidx.constraintlayout
|
|
|
|
implementation libs.androidx.core.ktx
|
|
|
|
implementation libs.androidx.documentfile
|
|
|
|
implementation libs.androidx.fragment.compose
|
|
|
|
implementation libs.androidx.lifecycle.livedata
|
|
|
|
implementation libs.androidx.lifecycle.viewmodel
|
|
|
|
implementation libs.androidx.localbroadcastmanager
|
|
|
|
implementation libs.androidx.media
|
|
|
|
implementation libs.androidx.preference
|
|
|
|
implementation libs.androidx.recyclerview
|
|
|
|
implementation libs.androidx.room.runtime
|
|
|
|
implementation libs.androidx.room.rxjava3
|
|
|
|
kapt libs.androidx.room.compiler
|
|
|
|
implementation libs.androidx.swiperefreshlayout
|
2021-10-19 21:31:59 +00:00
|
|
|
// Newer version specified to prevent accessibility regressions with RecyclerView, see:
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-alpha01
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.androidx.viewpager2
|
|
|
|
implementation libs.androidx.work.runtime
|
|
|
|
implementation libs.androidx.work.rxjava3
|
|
|
|
implementation libs.androidx.material
|
2017-04-26 19:32:20 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** Third-party libraries **/
|
|
|
|
// Instance state boilerplate elimination
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.livefront.bridge
|
|
|
|
implementation libs.android.state
|
|
|
|
kapt libs.android.state.processor
|
2020-10-16 11:27:04 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// HTML parser
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.jsoup
|
2017-04-26 19:32:20 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// HTTP client
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.okhttp
|
2018-03-30 01:24:30 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Media player
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.exoplayer.core
|
|
|
|
implementation libs.exoplayer.dash
|
|
|
|
implementation libs.exoplayer.database
|
|
|
|
implementation libs.exoplayer.datasource
|
|
|
|
implementation libs.exoplayer.hls
|
|
|
|
implementation libs.exoplayer.smoothstreaming
|
|
|
|
implementation libs.exoplayer.ui
|
|
|
|
implementation libs.extension.mediasession
|
2017-08-07 13:02:30 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Metadata generator for service descriptors
|
2024-11-22 20:59:39 +00:00
|
|
|
compileOnly libs.auto.service
|
|
|
|
kapt libs.auto.service.kapt
|
2020-07-28 09:02:01 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Manager for complex RecyclerView layouts
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.lisawray.groupie
|
|
|
|
implementation libs.lisawray.groupie.viewbinding
|
2018-06-16 09:55:57 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Image loading
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.coil.compose
|
2020-02-08 08:56:37 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Markdown library for Android
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.markwon.core
|
|
|
|
implementation libs.markwon.linkify
|
2020-05-01 14:06:02 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Crash reporting
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.acra.core
|
2020-05-01 14:06:02 +00:00
|
|
|
|
2021-09-06 18:47:44 +00:00
|
|
|
// Properly restarting
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.process.phoenix
|
2021-09-06 18:47:44 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Reactive extensions for Java VM
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.rxjava3.rxjava
|
|
|
|
implementation libs.rxjava3.rxandroid
|
2021-03-31 15:49:55 +00:00
|
|
|
// RxJava binding APIs for Android UI widgets
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.rxbinding4.rxbinding
|
2020-05-01 14:06:02 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
// Date and time formatting
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.prettytime
|
2020-11-22 12:49:09 +00:00
|
|
|
|
2024-02-27 19:03:46 +00:00
|
|
|
// Jetpack Compose
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
|
|
implementation libs.androidx.compose.material3
|
|
|
|
implementation libs.androidx.compose.adaptive
|
|
|
|
implementation libs.androidx.activity.compose
|
|
|
|
implementation libs.androidx.compose.ui.tooling.preview
|
|
|
|
implementation libs.androidx.lifecycle.viewmodel.compose
|
|
|
|
implementation libs.androidx.compose.ui.text // Needed for parsing HTML to AnnotatedString
|
|
|
|
implementation libs.androidx.compose.material.icons.extended
|
2024-10-21 19:17:26 +00:00
|
|
|
|
|
|
|
// Jetpack Compose related dependencies
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.androidx.paging.compose
|
|
|
|
implementation libs.androidx.navigation.compose
|
2024-06-18 02:29:24 +00:00
|
|
|
|
2024-08-23 14:21:32 +00:00
|
|
|
// Coroutines interop
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.kotlinx.coroutines.rx3
|
2024-02-27 19:03:46 +00:00
|
|
|
|
2024-10-21 19:17:26 +00:00
|
|
|
// Hilt
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.hilt.android
|
|
|
|
kapt(libs.hilt.compiler)
|
2024-10-21 19:17:26 +00:00
|
|
|
|
|
|
|
// Scroll
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.lazycolumnscrollbar
|
2024-10-21 19:17:26 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** Debugging **/
|
|
|
|
// Memory leak detection
|
2024-11-22 20:59:39 +00:00
|
|
|
debugImplementation libs.leakcanary.object.watcher
|
|
|
|
debugImplementation libs.leakcanary.plumber.android
|
|
|
|
debugImplementation libs.leakcanary.android.core
|
2021-03-31 15:49:55 +00:00
|
|
|
// Debug bridge for Android
|
2024-11-22 20:59:39 +00:00
|
|
|
debugImplementation libs.stetho
|
|
|
|
debugImplementation libs.stetho.okhttp3
|
2021-03-31 15:49:55 +00:00
|
|
|
|
2024-02-27 19:03:46 +00:00
|
|
|
// Jetpack Compose
|
2024-11-22 20:59:39 +00:00
|
|
|
debugImplementation libs.androidx.compose.ui.tooling
|
2024-02-27 19:03:46 +00:00
|
|
|
|
2021-03-31 15:49:55 +00:00
|
|
|
/** Testing **/
|
2024-11-22 20:59:39 +00:00
|
|
|
testImplementation libs.junit
|
|
|
|
testImplementation libs.mockito.core
|
2020-11-22 12:49:09 +00:00
|
|
|
|
2024-11-22 20:59:39 +00:00
|
|
|
androidTestImplementation libs.androidx.junit
|
|
|
|
androidTestImplementation libs.androidx.runner
|
|
|
|
androidTestImplementation libs.androidx.room.testing
|
|
|
|
androidTestImplementation libs.assertj.core
|
2015-09-04 00:15:03 +00:00
|
|
|
}
|
2020-03-13 23:10:37 +00:00
|
|
|
|
|
|
|
static String getGitWorkingBranch() {
|
|
|
|
try {
|
|
|
|
def gitProcess = "git rev-parse --abbrev-ref HEAD".execute()
|
|
|
|
gitProcess.waitFor()
|
|
|
|
if (gitProcess.exitValue() == 0) {
|
|
|
|
return gitProcess.text.trim()
|
|
|
|
} else {
|
|
|
|
// not a git repository
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
} catch (IOException ignored) {
|
|
|
|
// git was not found
|
|
|
|
return ""
|
|
|
|
}
|
2020-03-27 19:45:26 +00:00
|
|
|
}
|
2023-01-20 17:39:16 +00:00
|
|
|
|
2023-04-04 15:42:34 +00:00
|
|
|
// fix reproducible builds
|
2023-01-20 17:39:16 +00:00
|
|
|
project.afterEvaluate {
|
|
|
|
tasks.compileReleaseArtProfile.doLast {
|
|
|
|
outputs.files.each { file ->
|
|
|
|
if (file.toString().endsWith(".profm")) {
|
|
|
|
println("Sorting ${file} ...")
|
|
|
|
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
|
|
|
|
def profile = ArtProfileKt.ArtProfile(file)
|
|
|
|
def keys = new ArrayList(profile.profileData.keySet())
|
|
|
|
def sortedData = new LinkedHashMap()
|
|
|
|
Collections.sort keys, new DexFile.Companion()
|
|
|
|
keys.each { key -> sortedData[key] = profile.profileData[key] }
|
|
|
|
new FileOutputStream(file).with {
|
|
|
|
write(version.magicBytes$profgen)
|
|
|
|
write(version.versionBytes$profgen)
|
|
|
|
version.write$profgen(it, sortedData, "")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|