wait for runtime manager to init properly in bgutils settings

pull/1323/head
deniscerri 4 weeks ago
commit fba51e595f
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -1,7 +1,6 @@
name: Android CI
env:
# The name of the main module repository
main_project_module: app
permissions: {}
@ -16,200 +15,95 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'corretto'
cache: 'gradle'
- name: Create base64 jks file
run: echo "${{ secrets.BASE_64_SIGNING_KEY }}" > app/release_keystore.txt
- name: Create jks file
run: base64 -d "app/release_keystore.txt" > app/release_keystore.jks
- name: Create Blank Local Properties File
run: touch local.properties
- name: Create Keystore Properties File
run: echo "${{ secrets.LOCAL_PROPERTIES }}" > keystore.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
# Create APK Github Release
- name: Build apk release project (APK)
run: ./gradlew assembleGithubRelease --warning-mode all
# Upload Artifact Build
- name: Find Release Github arm64
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/github/release/ -type f -name '*arm64*.apk')" >> $GITHUB_ENV
- name: Upload APK Release Github arm64
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-arm64-v8a-github-release
path: ${{ env.APK_PATH }}
- name: Find Release Github armeabiv7
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/github/release/ -type f -name '*armeabi*.apk')" >> $GITHUB_ENV
- name: Upload APK Release Github armeabiv7
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-armeabi-v7a-github-release
path: ${{ env.APK_PATH }}
- name: Find Release Github universal
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/github/release/ -type f -name '*universal*.apk')" >> $GITHUB_ENV
- name: Upload APK Release Github universal
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-universal-github-release
path: ${{ env.APK_PATH }}
- name: Find Release Github x86
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/github/release/ -type f -name '*x86-*.apk')" >> $GITHUB_ENV
- name: Upload APK Release Github x86
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-x86-github-release
path: ${{ env.APK_PATH }}
- name: Find Release Github x86_64
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/github/release/ -type f -name '*x86_64*.apk')" >> $GITHUB_ENV
- name: Upload APK Release Github x86_64
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-x86_64-github-release
path: ${{ env.APK_PATH }}
# Noted For Output [main_project_module]/build/outputs/apk/github/release/
- name: Upload APK Release
uses: actions/upload-artifact@v4
with:
name: YTDLnis APK release github generated
path: ${{ env.main_project_module }}/build/outputs/apk/github/release/
# Create APK FOSS Release
- name: Build apk release project (APK)
run: ./gradlew assembleFossRelease --warning-mode all
- name: Find Release FOSS arm64
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/foss/release/ -type f -name '*arm64*.apk')" >> $GITHUB_ENV
- name: Upload APK Release FOSS arm64
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-arm64-v8a-foss-release
path: ${{ env.APK_PATH }}
- name: Find Release FOSS armeabiv7
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/foss/release/ -type f -name '*armeabi*.apk')" >> $GITHUB_ENV
- name: Upload APK Release FOSS armeabiv7
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-armeabi-v7a-foss-release
path: ${{ env.APK_PATH }}
- name: Find Release FOSS universal
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/foss/release/ -type f -name '*universal*.apk')" >> $GITHUB_ENV
- name: Upload APK Release FOSS universal
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-universal-foss-release
path: ${{ env.APK_PATH }}
- name: Find Release FOSS x86
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/foss/release/ -type f -name '*x86-*.apk')" >> $GITHUB_ENV
- name: Upload APK Release FOSS x86
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-x86-foss-release
path: ${{ env.APK_PATH }}
- name: Find Release FOSS x86_64
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/foss/release/ -type f -name '*x86_64*.apk')" >> $GITHUB_ENV
- name: Upload APK Release FOSS x86_64
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-x86_64-foss-release
path: ${{ env.APK_PATH }}
- name: Upload APK Release
uses: actions/upload-artifact@v4
with:
name: YTDLnis APK release FOSS generated
path: ${{ env.main_project_module }}/build/outputs/apk/foss/release/
# Send Message To Telegram
- name: send telegram message on push or pull
continue-on-error: true
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
# # Start Creating Pre-Release
# - name: Start Pre-Release
# uses: actions/checkout@v4
# with:
# persist-credentials: false
# # returns null if no pre-release exists
# - name: Get Commit SHA of Latest Pre-release
# run: |
# # Install Required Packages
# sudo apt-get updated
# sudo apt-get install -y curl jq
# echo "COMMIT_SHA_TAG=$(jq -r 'map(select(.prerelease)) | first | .tag_name' <<< $(curl -s https://api.github.com/repos/deniscerri/ytdlnis/releases))" >> $GITHUB_ENV
#
# - run: gh release delete ${{ env.COMMIT_SHA_TAG }} --cleanup-tag
# if: (env.COMMIT_SHA_TAG != 'null' && contains('Auto-Release', env.COMMIT_SHA_TAG))
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# # Make sure that an old ci that still runs on main doesn't recreate a prerelease
# - name: Check Pullable Commits
# id: check_commits
# run: |
# git fetch
# CHANGES=$(git rev-list HEAD..origin/main --count)
# echo "CHANGES=$CHANGES" >> $GITHUB_ENV
#
# - name: Get Release Name
# id: get_last_release_tag
# run: |
# LASTRELEASE=$(curl "https://api.github.com/repos/deniscerri/ytdlnis/releases/latest")
# ISPRERELEASE=$(echo $LASTRELEASE | jq -r '.prerelease')
# NEWRELEASENAME=$(echo $LASTRELEASE | jq -r '.name')
# if ! $ISPRERELEASE; then NEWRELEASENAME=$(echo $NEWRELEASENAME'.1'); else NEWRELEASENAME=$(echo $NEWRELEASENAME | sed -E 's/(.*\.)([0-9]+)$/echo "\1$((\2 + 1))"/e'); fi
# echo "NEWRELEASENAME=$NEWRELEASENAME" >> $GITHUB_ENV
#
# - name: Get last commit SHA
# id: last_commit
# run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
#
# - name: Get commmit date
# id: commit_date
# run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
#
#
# # Create a new pre-release, the other upload_binaries.yml will upload the binaries
# # to this pre-release.
# - name: Create Prerelease
# if: github.ref.name == 'main' && env.CHANGES == '0'
# uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
# with:
# name: ${{ env.NEWRELEASENAME }} [Auto-Release] [${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}]
# tag_name: v${{ env.NEWRELEASENAME }}-beta
# body: ${{ github.event.commits[0].message }}
# prerelease: true
# files: |
# ${{ env.main_project_module }}/build/outputs/apk/release/*
strategy:
fail-fast: false
matrix:
include:
- flavor: github
task: assembleGithubRelease
display_name: github
- flavor: foss
task: assembleFossRelease
display_name: FOSS
- flavor: izzy
task: assembleIzzyRelease
display_name: Izzy
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'corretto'
cache: 'gradle'
- name: Configure Keystore & Properties
run: |
echo "${{ secrets.BASE_64_SIGNING_KEY }}" | base64 -d > app/release_keystore.jks
touch local.properties
echo "${{ secrets.LOCAL_PROPERTIES }}" > keystore.properties
chmod +x gradlew
# Build ONLY the specific flavor assigned to this matrix runner
- name: Build ${{ matrix.flavor }} APK release
run: ./gradlew ${{ matrix.task }} --warning-mode all
# Upload individual ABI artifacts for this runner's flavor
- name: Upload arm64
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-arm64-v8a-${{ matrix.flavor }}-release
path: ${{ env.main_project_module }}/build/outputs/apk/${{ matrix.flavor }}/release/*arm64*.apk
- name: Upload armeabiv7
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-armeabi-v7a-${{ matrix.flavor }}-release
path: ${{ env.main_project_module }}/build/outputs/apk/${{ matrix.flavor }}/release/*armeabi*.apk
- name: Upload universal
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-universal-${{ matrix.flavor }}-release
path: ${{ env.main_project_module }}/build/outputs/apk/${{ matrix.flavor }}/release/*universal*.apk
- name: Upload x86
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-x86-${{ matrix.flavor }}-release
path: ${{ env.main_project_module }}/build/outputs/apk/${{ matrix.flavor }}/release/*x86-*.apk
- name: Upload x86_64
uses: actions/upload-artifact@v4
with:
name: ytdlnis-autogenerated-x86_64-${{ matrix.flavor }}-release
path: ${{ env.main_project_module }}/build/outputs/apk/${{ matrix.flavor }}/release/*x86_64*.apk
- name: Upload Full Folder
uses: actions/upload-artifact@v4
with:
name: YTDLnis APK release ${{ matrix.display_name }} generated
path: ${{ env.main_project_module }}/build/outputs/apk/${{ matrix.flavor }}/release/
# Separate job for Telegram so you only get ONE notification when all builds finish
notify:
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- name: Send Telegram Message
continue-on-error: true
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }}

3
.gitignore vendored

@ -9,4 +9,5 @@
.externalNativeBuild
/benchmark
*.png
app/src/main/jniLibs
app/src/main/jniLibs
.kotlin

@ -94,6 +94,9 @@ android {
foss {
dimension "version"
}
izzy {
dimension "version"
}
}
@ -163,19 +166,18 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs_nio:2.1.5"
// implementation "com.github.yausername.youtubedl-android:library:$youtubedlAndroidVer"
// implementation "com.github.yausername.youtubedl-android:ffmpeg:$youtubedlAndroidVer"
// implementation "com.github.yausername.youtubedl-android:aria2c:$youtubedlAndroidVer"
implementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
//implementation "io.github.junkfood02.youtubedl-android:library:0.17.4"
githubImplementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
githubImplementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"
githubImplementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.17.2"
//implementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.18.1"
//noinspection NewerVersionAvailable
implementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.17.2"
fossImplementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
fossImplementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"
fossImplementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.17.2"
implementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"
//implementation "io.github.junkfood02.youtubedl-android:aria2c:0.17.2"
izzyImplementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
izzyImplementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"
izzyImplementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.17.2"
implementation "androidx.appcompat:appcompat:1.7.1"
implementation "androidx.constraintlayout:constraintlayout:2.2.1"

@ -79,6 +79,7 @@ class GenerateYoutubePoTokensFragment : Fragment() {
).toMutableList()
}.getOrDefault(mutableListOf())
RuntimeManager.getInstance().assertInit()
initBGUtils()
initWeb()
}
@ -337,9 +338,12 @@ class GenerateYoutubePoTokensFragment : Fragment() {
conf.enabled = switch.isChecked
useVisitorData.isEnabled = switch.isChecked
configuration.add(conf)
preferences.edit()
.putString("youtube_generated_po_tokens", Gson().toJson(configuration).toString())
.apply()
preferences.edit(commit = true) {
putString(
"youtube_generated_po_tokens",
Gson().toJson(configuration).toString()
)
}
if (conf.poTokens.isEmpty()) {
regenerate.performClick()
}

@ -137,6 +137,7 @@
<item>English</item>
<item>العربية</item>
<item>Azərbaycanca</item>
<item>Asamiya</item>
<item>বাংলা</item>
<item>বাংলা (India)</item>
<item>български</item>
@ -184,6 +185,7 @@
<item>en</item>
<item>ar</item>
<item>az</item>
<item>as</item>
<item>bn</item>
<item>bn-IN</item>
<item>bg</item>

Loading…
Cancel
Save