18034727885
2026-04-07 ec026290cffbc8328546bfa81c6e279c0d42101f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
 
android {
    compileSdkVersion 35
    buildToolsVersion "33.0.3"
    namespace "com.igo.user"
    //签名
    signingConfigs {
        release {
            storeFile file("gopost_user.jks")
            storePassword "gopost"
            keyAlias "gopost"
            keyPassword "gopost"
        }
    }
 
    defaultConfig {
        applicationId "com.gopost.user"
        minSdkVersion 23
        targetSdkVersion 35
        versionCode 9
        versionName "1.9"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
 
    buildTypes {
        release {
            minifyEnabled false
            zipAlignEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            zipAlignEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
 
    compileOptions {
        // Flag to enable support for the new language APIs
        coreLibraryDesugaringEnabled true
        // Sets Java compatibility to Java 8
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = "17"  // 与上面保持一致
    }
 
    //netty 必须屏蔽这几个文件
    packagingOptions {
        jniLibs {
            useLegacyPackaging true
        }
        exclude 'META-INF/NOTICE' // will not include NOTICE file
        exclude 'META-INF/LICENSE' // will not include LICENSE file
        //netty files
        exclude 'META-INF/INDEX.LIST' // will not include this file
        exclude 'META-INF/io.netty.versions.properties' // will not include this file
    }
 
    buildFeatures {
        viewBinding true
        buildConfig = true  // 显式启用 BuildConfig
    }
 
}
// 在文件末尾添加
afterEvaluate {
    android.applicationVariants.all { variant ->
        def variantName = variant.name
        // 找到对应变体的bundle任务
        def bundleTask = tasks.findByName("bundle${variantName.capitalize()}")
        if (bundleTask != null) {
            bundleTask.doLast {
                // 输出目录
                def outputDir = file("${rootDir}/app/${variantName}/")
                if (outputDir.exists()) {
                    outputDir.listFiles().each { file ->
                        if (file.name.endsWith('.aab')) {
                            // 获取当前时间戳
                            def timestamp = new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+08"))
 
                            // 构建新的文件名
                            def newName = file.name.replace("app-${variantName}", "GoPost_user-${variant.versionName}-${timestamp}")
 
                            // 重命名文件
                            def newFile = new File(file.parentFile, newName)
 
                            if (file.renameTo(newFile)) {
                                println "✅ 文件重命名成功: ${file.name} -> ${newFile.name}"
                                println "📁 文件路径: ${newFile.absolutePath}"
                            } else {
                                println "❌ 文件重命名失败: ${file.name}"
                            }
                        }
                    }
                } else {
                    println "⚠️ 目录不存在: ${outputDir.absolutePath}"
                }
            }
        }
        // 找到对应变体的package任务
        def packageTask = tasks.findByName("package${variantName.capitalize()}")
        if (packageTask != null) {
            packageTask.doLast {
                // 输出目录
                def outputDir = file("${rootDir}/app/${variantName}/")
                if (outputDir.exists()) {
                    outputDir.listFiles().each { file ->
                        if (file.name.endsWith('.apk')) {
                            // 获取当前时间戳
                            def timestamp = new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+08"))
 
                            // 构建新的文件名
                            def newName = file.name.replace("app-${variantName}", "GoPost_user-${variant.versionName}-${timestamp}")
 
                            // 重命名文件
                            def newFile = new File(file.parentFile, newName)
 
                            if (file.renameTo(newFile)) {
                                println "✅ 文件重命名成功: ${file.name} -> ${newFile.name}"
                                println "📁 文件路径: ${newFile.absolutePath}"
                            } else {
                                println "❌ 文件重命名失败: ${file.name}"
                            }
                        }
                    }
                } else {
                    println "⚠️ 目录不存在: ${outputDir.absolutePath}"
                }
            }
        }
    }
}
repositories {
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    api "androidx.appcompat:appcompat:$support_version"
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.activity:activity:1.8.0'
    implementation("androidx.activity:activity-ktx:1.7.2")
    implementation 'com.google.android.gms:play-services-recaptcha:17.1.0'
    testImplementation 'junit:junit:4.12'
    //  androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    // androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation project(path: ':xldutils-kotlin')
    implementation 'com.google.android.material:material:1.3.0-alpha01'
    implementation project(path: ':rxnetty')
//    implementation project(path: ':umeng_sdk')
    implementation 'com.youth.banner:banner:2.0.11'
    implementation 'com.github.promeg:tinypinyin:2.0.3'
    implementation 'top.zibin:Luban:1.1.8'
    implementation 'com.aliyun.dpa:oss-android-sdk:2.9.3'
    implementation "com.daimajia.swipelayout:library:1.2.0@aar"
    implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.7'//二维码
    implementation 'com.haibin:calendarview:3.6.9'//日历
    implementation project(path: ':download')
    implementation 'com.google.android.libraries.places:places:2.7.0'
    implementation 'com.facebook.android:facebook-share:12.2.0' //脸书分享
    implementation 'com.facebook.android:facebook-login:12.2.0' //脸书登录
    implementation 'com.twitter.sdk.android:twitter:3.1.1'
    implementation 'org.greenrobot:eventbus:3.1.1'
 
 
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.3'
 
    //谷歌地图和乘客端sdk
    implementation 'com.google.android.gms:play-services-maps:18.1.0'
    implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-consumer:3.0.0'
 
 
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
 
    implementation 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.34' //微信官方依赖库
 
}