From 4eb64284c6e873391471a68319d73b58e4f47e7f Mon Sep 17 00:00:00 2001 From: dlgt7 <102397160+dlgt7@users.noreply.github.com> Date: Tue, 30 Dec 2025 07:02:02 +0800 Subject: [PATCH] Add files via upload --- musicfree打包/TVBoxOSC.jks | Bin 0 -> 2258 bytes musicfree打包/build-beta.yml | 81 +++++++++++++++++ musicfree打包/build.gradle | 171 +++++++++++++++++++++++++++++++++++ musicfree打包/说明.txt | 5 +- 4 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 musicfree打包/TVBoxOSC.jks create mode 100644 musicfree打包/build-beta.yml create mode 100644 musicfree打包/build.gradle diff --git a/musicfree打包/TVBoxOSC.jks b/musicfree打包/TVBoxOSC.jks new file mode 100644 index 0000000000000000000000000000000000000000..d9ed79a2850d4634196d69a4fc0b8de1cbcaab16 GIT binary patch literal 2258 zcmc(g`8U)HAIIlAGc++nmdMy5(qkE4%ZMl%L?X$ONM(r-W2vExFqZ0OkbPguzRNnY zm7%d*F1aQYL$+urOcKNO-19u=x##o;JU_gDc)x!7ocDR3&wH1-%Y;B6(0u`a3vrj= zgb&2~JMV+A1bWId2!sO)lHj`_4=0xbCjbZJp?mk&(oSUtSXv5%ErBs5LqeR=FvEp+zoR-ZO#c01o*OvgXjfVoGd7{$G|NMW^X z0x@Xp1M!z5gjW?I)vLKx7xl$I8A|ojRl;Z8ggW%+u%}H0G9nhlMYgMzWK7CitIjJW z0O5qMxbhCCF0Uo|zF{PNAvAi|q%ME7Q;=v<7hpm99h=L_ZC<&~$I6P(?$(-yJ4^~{ zky}+ImGdhQ@YGzQHcMx%T*5L{Z*hvn5A8qZE^=1LpO5rLZ8RcSMeW2b>C6kefz~7to@7?9LmC{j3t(9CSJm!0F?zit3 z2Y#q3x)ay7k%xI9r9mshdgeqLaoL@pU&o-cP8~{!EOWI4TD-iMdcF;W$XDHbcP(Zq zkH%ec$LVfmzw{!tHAQpgQemx4>}}N$3RILgCl*ruM`rNcdI^3ltu<&>rq6}_aS?N{ z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p>^2Ups9HcV3$m+w0Dl z_{MwponcBJCabYb&Z^J!d{1@^kt(lTR6RDPzQpkDYPT$L>3|&~2NPD}^Cj27LcYax Xw*kCo!?Kj01jvjQb^DSaa3S(9_`Kr* literal 0 HcmV?d00001 diff --git a/musicfree打包/build-beta.yml b/musicfree打包/build-beta.yml new file mode 100644 index 0000000..d515c98 --- /dev/null +++ b/musicfree打包/build-beta.yml @@ -0,0 +1,81 @@ +name: Beta 构建 + +on: + push: + branches: [dev] + paths: ['package.json'] # 保留原逻辑,只在 package.json 变化时自动构建 + workflow_dispatch: # 手动触发,随时可以点“Run workflow” + +jobs: + build-beta: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'gradle' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Cache React Native dependencies + uses: actions/cache@v4 + with: + path: | + node_modules + ~/.gradle/caches + ~/.gradle/wrapper + android/.gradle + key: ${{ runner.os }}-rn-${{ hashFiles('package-lock.json', 'android/gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-rn- + + - name: Install Dependencies + run: npm ci --prefer-offline --no-audit + + - name: Configure TVBoxOSC Signing + run: | + cd android + ls -l app/TVBoxOSC.jks # 确认 keystore 存在(建议你已将 jks 文件提交到仓库或通过 secrets 解码) + + # 写入 gradle.properties,供 build.gradle 使用 + cat <<'EOF' >> gradle.properties + FONGMIBOX_STORE_FILE=../app/TVBoxOSC.jks + FONGMIBOX_KEY_ALIAS=TVBoxOSC + FONGMIBOX_STORE_PASSWORD=TVBoxOSC + FONGMIBOX_KEY_PASSWORD=TVBoxOSC + EOF + + - name: Make gradlew executable + run: chmod +x android/gradlew + + - name: Build Beta APK + run: | + cd android + ./gradlew assembleRelease --parallel --build-cache --configure-on-demand + + - name: List generated APKs + run: | + echo "📱 Generated APK files:" + find android/app/build/outputs/apk/release -name "*.apk" -exec ls -lh {} \; + + - name: Upload Beta APKs + uses: actions/upload-artifact@v4 + with: + name: beta-apks-$(date +'%Y%m%d-%H%M%S') # 用时间戳命名,避免冲突 + path: android/app/build/outputs/apk/release/*.apk + retention-days: 30 + + - name: Build Summary + run: | + echo "🎉 Beta build completed successfully!" + echo "🚀 Triggered by: ${{ github.event_name }}" + echo "👤 Actor: ${{ github.actor }}" diff --git a/musicfree打包/build.gradle b/musicfree打包/build.gradle new file mode 100644 index 0000000..e9ceca4 --- /dev/null +++ b/musicfree打包/build.gradle @@ -0,0 +1,171 @@ +apply plugin: "com.android.application" +apply plugin: "org.jetbrains.kotlin.android" +apply plugin: "com.facebook.react" + +import com.android.build.OutputFile +import groovy.json.JsonSlurper + +/** + * This is the configuration block to customize your React Native Android app. + * By default you don't need to apply any configuration, just uncomment the lines you need. + */ +react { + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") + + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "prodDebug"] + + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() + + // + // Added by install-expo-modules + entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim()) + cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim()) + bundleCommand = "export:embed" +} + +/** + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. + */ +def enableProguardInReleaseBuilds = false + +/** + * The preferred build flavor of JavaScriptCore (JSC) + */ +def jscFlavor = 'org.webkit:android-jsc:+' + +// !! Add lines +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('keystore.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + +static def getVersion() { + def inputFile = new File("../package.json") + def packageJson = new JsonSlurper().parseText(inputFile.text) + return packageJson["version"] +} + +def appVersion = getVersion() +def appVersionCode = 400011 + +android { + ndkVersion rootProject.ext.ndkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + compileSdk rootProject.ext.compileSdkVersion + + namespace "fun.upup.musicfree" + + defaultConfig { + applicationId "fun.upup.musicfree" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode appVersionCode + versionName appVersion + } + + // ==================== 彻底重写的签名配置 ==================== + signingConfigs { + debug { + storeFile file('ikunshare.keystore') + storePassword '@Ikun2.0.1.2' + keyAlias 'ikunshare' + keyPassword '@Ikun2.0.1.2' + } + + release { + // 安全获取属性(变量名故意改成不和属性冲突) + def keystoreFile = project.findProperty("FONGMIBOX_STORE_FILE") ?: "" + def keystorePass = project.findProperty("FONGMIBOX_STORE_PASSWORD") ?: "" + def keystoreAlias = project.findProperty("FONGMIBOX_KEY_ALIAS") ?: "" + def keystoreKeyPass = project.findProperty("FONGMIBOX_KEY_PASSWORD") ?: "" + + // 检查是否注入成功 + if (!keystoreFile || !keystorePass || !keystoreAlias || !keystoreKeyPass) { + throw new GradleException("TVBoxOSC signing properties missing in android/gradle.properties! Check workflow injection.") + } + + // 显式赋值,避免任何 DSL 歧义 + storeFile = file(keystoreFile) + storePassword = keystorePass + keyAlias = keystoreAlias + keyPassword = keystoreKeyPass + + v1SigningEnabled true + v2SigningEnabled true + enableV3Signing true + enableV4Signing true + } + } + + buildTypes { + debug { + signingConfig signingConfigs.debug + } + release { + signingConfig signingConfigs.release + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } + // =========================================================== +} + +// dependencies 块必须放在 android { } 闭合之后 +dependencies { + // The version of react-native is set by the React Native Gradle Plugin + implementation("com.facebook.react:react-android") + + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") + } else { + implementation jscFlavor + } + + // !! Add lines + implementation project(':react-native-fs') + implementation 'com.facebook.fresco:animated-gif:2.5.0' + // https://mvnrepository.com/artifact/net.jthink/jaudiotagger + implementation 'net.jthink:jaudiotagger:2.2.5' + implementation 'androidx.core:core-splashscreen:1.0.0' +} diff --git a/musicfree打包/说明.txt b/musicfree打包/说明.txt index bca70f3..7a4f32d 100644 --- a/musicfree打包/说明.txt +++ b/musicfree打包/说明.txt @@ -1 +1,4 @@ -q +文件放置的位置: +android/app/build.gradle +android/app/TVBoxOSC.jks +.github/workflows/build-beta.yml