commit 4309a64acb9041e6f93f8e77cc413cd2cdacdad2 Author: ivan Date: Thu Mar 26 16:33:11 2026 +0800 初始化工程 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3820a95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..89db5de --- /dev/null +++ b/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "ff37bef603469fb030f2b72995ab929ccfc227f0" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: android + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: ios + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: linux + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: macos + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: web + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: windows + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b10d7d --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# funymee_ai + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter) +- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..be3943c --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..15417ab --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.funymeeai.app" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.funymeeai.app" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8276453 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/funymeeai/app/MainActivity.kt b/android/app/src/main/kotlin/com/funymeeai/app/MainActivity.kt new file mode 100644 index 0000000..c0493bf --- /dev/null +++ b/android/app/src/main/kotlin/com/funymeeai/app/MainActivity.kt @@ -0,0 +1,5 @@ +package com.funymeeai.app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..499e7ff --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + 1684216162986495 + df562f4ff186aaac5ff56ba190020ffd + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/build/reports/problems/problems-report.html b/android/build/reports/problems/problems-report.html new file mode 100644 index 0000000..9effdc3 --- /dev/null +++ b/android/build/reports/problems/problems-report.html @@ -0,0 +1,663 @@ + + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..fbee1d8 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..e4ef43f --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..ca7fe06 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/assets/skin_config.json b/assets/skin_config.json new file mode 100644 index 0000000..0cc52b5 --- /dev/null +++ b/assets/skin_config.json @@ -0,0 +1,387 @@ +{ + "app": { + "name": "FunyMeeAI", + "id": "com.funymeeai.app", + "packageName": "com.funymeeai.app" + }, + "backend": { + "iosAppType": "HIOS", + "androidAppType": "HAndroid" + }, + "api": { + "preBaseUrl": "https://pre-ai.funymee.space", + "prodBaseUrl": "https://ai.funymee.space", + "proxyPath": "/workshop/lounge/hub/playground", + "debugBaseUrlOverride": null, + "alwaysUsePreBaseUrl": true, + "aesKey": "gLYeTRc2uNTcNH8e" + }, + "proxyKeys": { + "appIdField": "humor_level", + "pathField": "comedy_style", + "methodField": "avatar_mode", + "headerField": "filter_type", + "paramsField": "scene_id", + "bodyField": "clip_duration", + "noiseKeys": [ + "sample_rate", + "watermark_id", + "geo_radius", + "accuracy_m" + ] + }, + "v2": { + "levelField": "shell", + "levelFixedValue": 2, + "sanctumPath": [ + "capsule", + "envelope", + "container" + ], + "noiseKeys": [ + "shimmer", + "glimmer", + "flicker", + "sparkle", + "rustle", + "murmur", + "whisper", + "echo" + ] + }, + "analytics": { + "debugLogs": false, + "adjust": { + "appToken": "chflzzr4x5hc", + "environment": "sandbox", + "logLevel": "off", + "fbAppId": null + }, + "facebook": { + "appId": "TODO_FACEBOOK_APP_ID", + "clientToken": "TODO_FACEBOOK_CLIENT_TOKEN", + "debugLogs": false + } + }, + "adjustEvents": { + "firstPurchase": "qlw4fp", + "purchase": "b2ms4n", + "register": "2k7vm5", + "price_599": "mtzzqk", + "price_999": "m9ivl1", + "price_1999": "kp7a52", + "price_4999": "ojlx1r", + "price_9999": "hue6dt" + }, + "fieldMapping": { + "User_token": "comedy", + "accountId": "meme", + "accountName": "avatar", + "activityId": "character", + "activitys": "animate", + "actualAmount": "sketch", + "addCredits": "remix", + "adsTokenId": "humor", + "age": "intensity", + "amount": "cartoon", + "animate": "duration", + "app": "sticker", + "appFbConfig": "stylize", + "appType": "reaction", + "appraise": "render", + "approveState": "clip", + "aspectRatio": "caption", + "automaticRenewal": "punchline", + "avatar": "frequency", + "baseCredits": "opacity", + "baseUrl": "joke", + "begTime": "gag", + "bonus": "contrast", + "bonusCredits": "saturation", + "bonusRatio": "sharpness", + "businessId": "angle", + "businessType": "offset", + "campaignInfo": "parody", + "card": "spoof", + "categoryId": "scale", + "categoryName": "rotation", + "ch": "satire", + "channel": "skit", + "channelType": "reel", + "client": "filter", + "clientId": "template", + "code": "scene", + "coder": "panel", + "config": "edit", + "content": "gradient", + "contentType": "comic", + "count": "bubble", + "countId": "share", + "country": "overlay", + "countryCode": "publish", + "creatTime": "palette", + "createTime": "typography", + "createTimeText": "layout", + "credit": "export", + "creditPromotion": "apply", + "credits": "padding", + "creditsRecordUrl": "swap", + "cryptoInvoiceUrl": "merge", + "currency": "mascot", + "current": "blend", + "cvcCode": "persona", + "data": "costume", + "days": "backdrop", + "department": "resize", + "desc": "kurtosis", + "description": "crop", + "devId": "frame", + "deviceId": "stage", + "discountOff": "margin", + "domain": "theme", + "domains": "adjust", + "dt": "mood", + "duration": "preview", + "email": "draft", + "enable_music": "vibe", + "enabled": "customize", + "endTime": "expression", + "event": "gesture", + "expectedSize": "pose", + "expireMonth": "outfit", + "expireYear": "trait", + "expiresIn": "upload", + "ext": "profile", + "extConfig": "download", + "extJson": "gallery", + "face": "border", + "faceIndex": "radius", + "faceInfos": "discover", + "face_index": "shadow", + "fbClientId": "glow", + "fbClientToken": "blur", + "feature": "browse", + "features": "explore", + "feedbackId": "grain", + "feedbackIds": "showcase", + "fileName": "feed", + "fileName1": "trending", + "fileName2": "spotlight", + "filePath": "search", + "filePath1": "generate", + "filePath2": "transform", + "fileUrls": "texture", + "filterCountry": "collection", + "filterDomain": "badge", + "filterOwnerId": "reward", + "filterStatus": "quest", + "filterTaskType": "caucus", + "filterVip": "allowance", + "firstName": "appendix", + "firstRegister": "enhance", + "forcePayCenter": "convert", + "fps": "lineage", + "frameIndex": "pattern", + "frame_index": "motion", + "freeBlurTimes": "tag", + "freeTimes": "label", + "gender": "speed", + "googleClientId": "roster", + "h5UrlConfig": "rank", + "hasNext": "rate", + "hash": "medallion", + "hashIsZero": "member", + "headFaceIndex": "entry", + "headImg": "terminal", + "headPos": "repository", + "headType": "delegate", + "hint": "vote", + "hlsUrl": "precision", + "host": "nominee", + "icon": "delay", + "id": "timing", + "imageCount": "bounce", + "imageFaceIndex": "digest", + "imageId": "registration", + "imageInfos": "elastic", + "img": "circular", + "imgCount": "indicator", + "imgId": "histogram", + "imgList": "easing", + "imgType": "compressive", + "imgUrl": "boost", + "index": "weight", + "inviteBy": "socket", + "invitedCnt": "pin", + "isBlur": "archive", + "isVip": "restore", + "issuerUrl": "duplicate", + "keepUserId": "campus", + "label": "density", + "lang": "venture", + "lastName": "council", + "lastUpdateTime": "follow", + "launchImgUrl": "coverage", + "link": "capital", + "list": "ordinance", + "lowUrl": "durability", + "maxLimit": "like", + "method": "listing", + "methodActivitys": "comment", + "methodChannels": "collect", + "model": "exhibit", + "msg": "sprint", + "name": "alignment", + "needCredits": "colorize", + "needImage": "edge", + "needUndress": "authorization", + "needopt": "team", + "negativePrompt": "delegation", + "note": "spacing", + "openType": "morph", + "optimizeCountSql": "reface", + "optimizeJoinOfCountSql": "voice", + "orderId": "franchise", + "orders": "sync", + "originAmount": "brochure", + "owner": "heritage", + "p12KeyPath": "tally", + "packageName": "accolade", + "page": "session", + "pages": "loop", + "password": "scope", + "payCenterUrl": "schedule", + "payId": "depth", + "payMethod": "layer", + "payMethods": "cluster", + "payStatus": "submit", + "payTime": "channel", + "payTypeList": "introspect", + "payUrl": "objectify", + "paylink": "segment", + "paymentMethod": "ledger", + "paymentMethods": "invoke", + "permissions": "terminate", + "phone": "sponsor", + "pkg": "stakeholder", + "platform": "abstract", + "previewImage": "slice", + "previewVideo": "anchor", + "productType": "pivot", + "progress": "origin", + "prompt": "appointment", + "publicKey": "thread", + "purchaseData": "gauge", + "queueCnt": "endpoint", + "read": "midpoint", + "receipt": "funnel", + "recent": "fabricate", + "recentlyUsed": "breakpoint", + "recommend": "threshold", + "records": "create", + "redirectUrl": "reformat", + "referer": "link", + "refererType": "complex", + "reply": "amplitude", + "replyStatus": "calendar", + "requiredHeaders": "tokenize", + "resolution": "consortium", + "resolution480p": "span", + "resolution720p": "factor", + "resulotion": "correctness", + "rewardCredits": "sigma", + "rewardRatio": "gutter", + "role": "transport", + "searchCount": "transmit", + "selected": "adaptive", + "serviceAccountEmail": "balance", + "sharedSecret": "stake", + "showName": "constant", + "sign": "mandate", + "signature": "selection", + "size": "seminar", + "sort": "overtone", + "srcFaceImgBase64": "tournament", + "srcFaceIndex": "circuit", + "srcImg": "permission", + "srcImg1": "crew", + "srcImg1Url": "consulate", + "srcImg2": "lease", + "srcImg2Url": "glossary", + "srcImgBase64": "dynasty", + "srcImgUrl": "logbook", + "srcVideo": "commendation", + "state": "bitrate", + "status": "wallet", + "style": "module", + "subBusinessType": "keepalive", + "subPaymentMethod": "bundle", + "subScribeValidTime": "unicast", + "subscriptionActivitys": "cap", + "subscriptionPeriod": "unicast", + "sumCredits": "assert", + "sys": "load", + "t2IConfig": "reboot", + "tag": "remainder", + "tags": "enqueue", + "targetId": "manifest", + "targetInvitedCnt": "unpack", + "taskId": "exponential", + "taskIds": "vendor", + "taskType": "liaison", + "taskTypes": "synopsis", + "templateFaceUrl": "quantized", + "templateFifCredits": "compressed", + "templateFifDuration": "usability", + "templateFifUrl": "tension", + "templateName": "itinerary", + "templateTfCredits": "capitalization", + "templateTfDuration": "demodulation", + "templateTfUrl": "convergence", + "templateType": "ringing", + "templateTypes": "dialogue", + "templateUrl": "refractive", + "templates": "microscopic", + "tgId": "chart", + "tgName": "spend", + "tgOrderId": "microservice", + "theme": "capacity", + "title": "interval", + "token": "attachment", + "total": "insert", + "totalUnreadCount": "promote", + "transactionId": "installation", + "truePrompt": "coalition", + "ts": "debit", + "type": "revenue", + "types": "standard", + "unreadCountList": "weigh", + "updateTime": "overflow", + "uploadUrl": "update", + "uploadUrl1": "harden", + "uploadUrl2": "complete", + "url": "altitude", + "user": "resistance", + "userApplePayList": "variety", + "userId": "symposium", + "userInfoType": "carnival", + "userName": "supplement", + "userToken": "disambiguate", + "userType": "resample", + "username": "ring", + "usign": "reauthenticate", + "val": "compliance", + "value": "platoon", + "verifyCode": "taskforce", + "videoDuration": "hue", + "videoFaceIndex": "escrow", + "videoFrameIndex": "periodical", + "videoSize": "genealogy", + "videoUrl": "postprocess", + "waitTime": "acuity", + "x1": "angular", + "x2": "enthalpy", + "y1": "binormal", + "y2": "manifold" + } +} \ No newline at end of file diff --git a/docs/FunyMeeAI_client_guide.md b/docs/FunyMeeAI_client_guide.md new file mode 100644 index 0000000..dac698c --- /dev/null +++ b/docs/FunyMeeAI_client_guide.md @@ -0,0 +1,5139 @@ +# FunyMeeAI V2 客户端接入指引 + +**生成时间**:2026-03-25 17:39 + +--- + +## 通用信息 + +| 项目 | 值 | +|------|-----| +| 加密方式 | AES-128-ECB, PKCS5Padding, Base64 | +| AES Key | `gLYeTRc2uNTcNH8e` | +| 预发域名 | `pre-ai.funymee.space` | +| 生产域名 | `ai.funymee.space` | +| 代理入口 | `POST {baseUrl}/workshop/lounge/hub/playground` | +| 包名 | `com.funymeeai.app` | + +## 加密流程 + +``` + 构造业务参数 + | + v + 字段名映射 + (body + params + headers) + | + v + V2包装 + (body only) + | + v + JSON序列化 + | + v + AES + Base64 + | + v + 填入代理请求 b/p 参数 + | + v + POST 代理入口 +``` + +## 代理请求结构 + +所有接口统一 POST 到代理入口,请求体结构如下: + +```json +{ + "humor_level": "FunyMeeAI", // appId 明文 + "comedy_style": "", // AES(原始 path) → Base64 + "avatar_mode": "", // AES("POST" 或 "GET") → Base64 + "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 + "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 + "clip_duration": "", // AES(V2包装后的业务数据) → Base64 + "sample_rate": "<随机4-8位字母数字,AES加密→Base64>", // 噪音字段 + "watermark_id": "<随机4-8位字母数字,AES加密→Base64>", // 噪音字段 + "geo_radius": "<随机4-8位字母数字,AES加密→Base64>", // 噪音字段 + "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音字段 +} +``` + +> 即使原始接口为 GET(无请求体),走代理后也统一使用 POST,b 参数仍需传入 V2 包装后的空业务体。 + +## V2 包装结构 + +业务数据经字段映射后,按以下结构包装: + +```json +{ + "shell": 2, // 固定值 + "capsule": { + "envelope": { + "container": { /* 映射后的业务字段 */ } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} +``` + +--- + +## 认证 & 账号 +> 无需登录态 +### 设备登录(快速登录) +`POST /v1/user/fast_login` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------------| +| `satire` | `ch` | 渠道 | +| `stakeholder` | `pkg` | 应用包名(必填) | +| `revenue` | `type` | referrer类型(必填, af(AF归因)/fb(FB归因,默认)/gg(google归因)/ios_adjust/android_adjust)| +| `sticker` | `app` | 应用类型(必填,iOS: HIOS / Android: HAndroid) | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `link` | `referer` | string | 归因信息,如 | +| `mandate` | `sign` | string | 签名,MD5(deviceId)大写32位(必填) | +| `stage` | `deviceId` | string | 设备ID(必填) | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// fast_login — 设备登录(快速登录) +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "vx4tAJaFHyC0sCb6jpr+iKBq/uqi2FaadQnIqopsLYI=", // AES(/v1/user/fast_login) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "link": "", // referer (string) 归因信息,如 + "mandate": "", // sign (string) 签名,MD5(deviceId)大写32位(必填) + "stage": "" // deviceId (string) 设备ID(必填) + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "download": "", // extConfig (string) 客户端界面配置下发 + "revenue": "", // type (string) 类型 + "stylize": { // appFbConfig (object) 应用FB配置 + "glow": "", // fbClientId (string) Facebook应用ID + "blur": "" // fbClientToken (string) Facebook客户端Token + }, + "reauthenticate": "", // usign (string) 用户签名 + "publish": "", // countryCode (string) 国家代码 + "swap": "", // creditsRecordUrl (string) 积分记录URL + "chart": "", // tgId (string) Telegram ID + "export": 0, // credit (int) 积分余额 + "spend": "", // tgName (string) Telegram 用户名 + "draft": "", // email (string) 邮箱 + "profile": {}, // ext (object) 扩展信息 + "convert": false, // forcePayCenter (boolean) 是否强制跳转支付中心 + "reboot": { // t2IConfig (object) T2I配置 + "padding": {}, // credits (object) 积分配置(key为任务类型,value为积分数) + "microscopic": [ // templates (array) 提示词模板列表 + { + "circular": "", // img (string) 示例图片URL + "appointment": "" // prompt (string) 提示词内容 + } + ] + }, + "rank": { // h5UrlConfig (object) H5 URL配置 + "altitude": "", // url (string) H5页面URL + "coverage": "" // launchImgUrl (string) 启动图URL + }, + "schedule": "", // payCenterUrl (string) 支付中心URL + "tag": 0, // freeBlurTimes (int) 免费去模糊次数 + "frequency": "", // avatar (string) 头像URL + "supplement": "", // userName (string) 用户名 + "enhance": false, // firstRegister (boolean) 是否首次注册 + "symposium": "", // userId (string) 用户ID + "restore": false, // isVip (boolean) 是否VIP + "enqueue": [], // tags (array) 用户标签 + "label": 0, // freeTimes (int) 免费次数 + "disambiguate": "", // userToken (string) 用户登录token + "recognize": 0, // subScribeValidTime (int) 订阅有效时间戳 + "wallet": 0 // status (int) 用户状态 + } +} +``` + +--- + +### Google登录 +`POST /v1/user/login/google` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `sticker` | `app` | string | 应用标识(必填) | +| `link` | `referer` | string | 归因信息,如 utm_source=googleplay | +| `socket` | `inviteBy` | string | 邀请人 | +| `scene` | `code` | string | OAuth授权码 | +| `taskforce` | `verifyCode` | string | 验证码 | +| `satire` | `ch` | string | 渠道号 | +| `frequency` | `avatar` | string | 头像URL | +| `revenue` | `type` | string | 类型 | +| `supplement` | `userName` | string | 用户名 | +| `symposium` | `userId` | string | 用户ID | +| `stage` | `deviceId` | string | 设备ID | +| `sponsor` | `phone` | string | 手机号 | +| `theme` | `domain` | string | 域名 | +| `campus` | `keepUserId` | string | 保留用户ID | +| `parody` | `campaignInfo` | string | 活动信息 | +| `bitrate` | `state` | string | OAuth state | +| `complex` | `refererType` | string | 归因类型 | +| `draft` | `email` | string | 邮箱 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// google — Google登录 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "s1CzqpH5wzPJf21sqStamHzcIP0EBYSPFMW5Gcf1C3w=", // AES(/v1/user/login/google) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "sticker": "", // app (string) 应用标识(必填) + "link": "", // referer (string) 归因信息,如 utm_source=googleplay + "socket": "", // inviteBy (string) 邀请人 + "scene": "", // code (string) OAuth授权码 + "taskforce": "", // verifyCode (string) 验证码 + "satire": "", // ch (string) 渠道号 + "frequency": "", // avatar (string) 头像URL + "revenue": "", // type (string) 类型 + "supplement": "", // userName (string) 用户名 + "symposium": "", // userId (string) 用户ID + "stage": "", // deviceId (string) 设备ID + "sponsor": "", // phone (string) 手机号 + "theme": "", // domain (string) 域名 + "campus": "", // keepUserId (string) 保留用户ID + "parody": "", // campaignInfo (string) 活动信息 + "bitrate": "", // state (string) OAuth state + "complex": "", // refererType (string) 归因类型 + "draft": "" // email (string) 邮箱 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "download": "", // extConfig (string) 客户端界面配置下发 + "revenue": "", // type (string) 类型 + "stylize": { // appFbConfig (object) 应用FB配置 + "glow": "", // fbClientId (string) Facebook应用ID + "blur": "" // fbClientToken (string) Facebook客户端Token + }, + "reauthenticate": "", // usign (string) 用户签名 + "publish": "", // countryCode (string) 国家代码 + "swap": "", // creditsRecordUrl (string) 积分记录URL + "chart": "", // tgId (string) Telegram ID + "export": 0, // credit (int) 积分余额 + "spend": "", // tgName (string) Telegram 用户名 + "draft": "", // email (string) 邮箱 + "profile": {}, // ext (object) 扩展信息 + "convert": false, // forcePayCenter (boolean) 是否强制跳转支付中心 + "reboot": { // t2IConfig (object) T2I配置 + "padding": {}, // credits (object) 积分配置(key为任务类型,value为积分数) + "microscopic": [ // templates (array) 提示词模板列表 + { + "circular": "", // img (string) 示例图片URL + "appointment": "" // prompt (string) 提示词内容 + } + ] + }, + "rank": { // h5UrlConfig (object) H5 URL配置 + "altitude": "", // url (string) H5页面URL + "coverage": "" // launchImgUrl (string) 启动图URL + }, + "schedule": "", // payCenterUrl (string) 支付中心URL + "tag": 0, // freeBlurTimes (int) 免费去模糊次数 + "frequency": "", // avatar (string) 头像URL + "supplement": "", // userName (string) 用户名 + "enhance": false, // firstRegister (boolean) 是否首次注册 + "symposium": "", // userId (string) 用户ID + "restore": false, // isVip (boolean) 是否VIP + "enqueue": [], // tags (array) 用户标签 + "label": 0, // freeTimes (int) 免费次数 + "disambiguate": "", // userToken (string) 用户登录token + "recognize": 0, // subScribeValidTime (int) 订阅有效时间戳 + "wallet": 0 // status (int) 用户状态 + } +} +``` + +--- + +### Apple登录 +`POST /v1/user/login/apple` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `sticker` | `app` | string | 应用标识(必填) | +| `link` | `referer` | string | 归因信息,如 utm_source=googleplay | +| `socket` | `inviteBy` | string | 邀请人 | +| `scene` | `code` | string | OAuth授权码 | +| `taskforce` | `verifyCode` | string | 验证码 | +| `satire` | `ch` | string | 渠道号 | +| `frequency` | `avatar` | string | 头像URL | +| `revenue` | `type` | string | 类型 | +| `supplement` | `userName` | string | 用户名 | +| `symposium` | `userId` | string | 用户ID | +| `stage` | `deviceId` | string | 设备ID | +| `sponsor` | `phone` | string | 手机号 | +| `theme` | `domain` | string | 域名 | +| `campus` | `keepUserId` | string | 保留用户ID | +| `parody` | `campaignInfo` | string | 活动信息 | +| `bitrate` | `state` | string | OAuth state | +| `complex` | `refererType` | string | 归因类型 | +| `draft` | `email` | string | 邮箱 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// apple — Apple登录 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "jGhmNKJBhLIFhBiEzhPjHiink7QU+MJfG5dQyUrWCKg=", // AES(/v1/user/login/apple) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "sticker": "", // app (string) 应用标识(必填) + "link": "", // referer (string) 归因信息,如 utm_source=googleplay + "socket": "", // inviteBy (string) 邀请人 + "scene": "", // code (string) OAuth授权码 + "taskforce": "", // verifyCode (string) 验证码 + "satire": "", // ch (string) 渠道号 + "frequency": "", // avatar (string) 头像URL + "revenue": "", // type (string) 类型 + "supplement": "", // userName (string) 用户名 + "symposium": "", // userId (string) 用户ID + "stage": "", // deviceId (string) 设备ID + "sponsor": "", // phone (string) 手机号 + "theme": "", // domain (string) 域名 + "campus": "", // keepUserId (string) 保留用户ID + "parody": "", // campaignInfo (string) 活动信息 + "bitrate": "", // state (string) OAuth state + "complex": "", // refererType (string) 归因类型 + "draft": "" // email (string) 邮箱 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "download": "", // extConfig (string) 客户端界面配置下发 + "revenue": "", // type (string) 类型 + "stylize": { // appFbConfig (object) 应用FB配置 + "glow": "", // fbClientId (string) Facebook应用ID + "blur": "" // fbClientToken (string) Facebook客户端Token + }, + "reauthenticate": "", // usign (string) 用户签名 + "publish": "", // countryCode (string) 国家代码 + "swap": "", // creditsRecordUrl (string) 积分记录URL + "chart": "", // tgId (string) Telegram ID + "export": 0, // credit (int) 积分余额 + "spend": "", // tgName (string) Telegram 用户名 + "draft": "", // email (string) 邮箱 + "profile": {}, // ext (object) 扩展信息 + "convert": false, // forcePayCenter (boolean) 是否强制跳转支付中心 + "reboot": { // t2IConfig (object) T2I配置 + "padding": {}, // credits (object) 积分配置(key为任务类型,value为积分数) + "microscopic": [ // templates (array) 提示词模板列表 + { + "circular": "", // img (string) 示例图片URL + "appointment": "" // prompt (string) 提示词内容 + } + ] + }, + "rank": { // h5UrlConfig (object) H5 URL配置 + "altitude": "", // url (string) H5页面URL + "coverage": "" // launchImgUrl (string) 启动图URL + }, + "schedule": "", // payCenterUrl (string) 支付中心URL + "tag": 0, // freeBlurTimes (int) 免费去模糊次数 + "frequency": "", // avatar (string) 头像URL + "supplement": "", // userName (string) 用户名 + "enhance": false, // firstRegister (boolean) 是否首次注册 + "symposium": "", // userId (string) 用户ID + "restore": false, // isVip (boolean) 是否VIP + "enqueue": [], // tags (array) 用户标签 + "label": 0, // freeTimes (int) 免费次数 + "disambiguate": "", // userToken (string) 用户登录token + "recognize": 0, // subScribeValidTime (int) 订阅有效时间戳 + "wallet": 0 // status (int) 用户状态 + } +} +``` + +--- + +### 归因上报 +`POST /v1/user/referrer` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `revenue` | `type` | 类型(必填, af(AF归因)/fb(FB归因,默认)/gg(google归因)/ios_adjust/android_adjust) | +| `stakeholder` | `pkg` | 应用包名(必填) | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `link` | `referer` | string | 归因信息,如 utm_source=googleplay | +| `stage` | `deviceId` | string | 设备ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// referrer — 归因上报 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "Ex8V5pMk8AAx0dZ2bCk95x3hgLH8TW7xc3MeiufRNxQ=", // AES(/v1/user/referrer) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "link": "", // referer (string) 归因信息,如 utm_source=googleplay + "stage": "" // deviceId (string) 设备ID + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "vote": "", // hint (string) + "revenue": "" // type (string) + } +} +``` + +--- + +### 获取App语言配置 +`GET /v1/config/app-language` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `venture` | `lang` | 语言代码 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// app_language — 获取App语言配置 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "llvWqZObXf9L4Ni7w+J6Hi88SoHxIgt0aNCtC6OSIGk=", // AES(/v1/config/app-language) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "edit": "" // config (string) 语言配置JSON + } +} +``` + +--- + +--- + +## 用户信息 +> 需要登录态 +### 获取用户账户信息 +`GET /v1/user/account` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// account — 获取用户账户信息 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "sMpVMOBtMbKmw+ovfLYAYHpN28WVH83mwh40owgUCrU=", // AES(/v1/user/account) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "download": "", // extConfig (string) 客户端界面配置下发 + "revenue": "", // type (string) 类型 + "stylize": { // appFbConfig (object) 应用FB配置 + "glow": "", // fbClientId (string) Facebook应用ID + "blur": "" // fbClientToken (string) Facebook客户端Token + }, + "reauthenticate": "", // usign (string) 用户签名 + "publish": "", // countryCode (string) 国家代码 + "swap": "", // creditsRecordUrl (string) 积分记录URL + "chart": "", // tgId (string) Telegram ID + "export": 0, // credit (int) 积分余额 + "spend": "", // tgName (string) Telegram 用户名 + "draft": "", // email (string) 邮箱 + "profile": {}, // ext (object) 扩展信息 + "convert": false, // forcePayCenter (boolean) 是否强制跳转支付中心 + "reboot": { // t2IConfig (object) T2I配置 + "padding": {}, // credits (object) 积分配置(key为任务类型,value为积分数) + "microscopic": [ // templates (array) 提示词模板列表 + { + "circular": "", // img (string) 示例图片URL + "appointment": "" // prompt (string) 提示词内容 + } + ] + }, + "rank": { // h5UrlConfig (object) H5 URL配置 + "altitude": "", // url (string) H5页面URL + "coverage": "" // launchImgUrl (string) 启动图URL + }, + "schedule": "", // payCenterUrl (string) 支付中心URL + "tag": 0, // freeBlurTimes (int) 免费去模糊次数 + "frequency": "", // avatar (string) 头像URL + "supplement": "", // userName (string) 用户名 + "enhance": false, // firstRegister (boolean) 是否首次注册 + "symposium": "", // userId (string) 用户ID + "restore": false, // isVip (boolean) 是否VIP + "enqueue": [], // tags (array) 用户标签 + "label": 0, // freeTimes (int) 免费次数 + "disambiguate": "", // userToken (string) 用户登录token + "recognize": 0, // subScribeValidTime (int) 订阅有效时间戳 + "wallet": 0 // status (int) 用户状态 + } +} +``` + +--- + +### 获取用户通用信息 +`GET /v1/user/common_info` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `filter` | `client` | 客户端标识 | +| `symposium` | `userId` | 用户ID | +| `satire` | `ch` | 渠道号 | +| `socket` | `inviteBy` | 邀请人 | +| `stage` | `deviceId` | 设备ID | +| `template` | `clientId` | 客户端ID | +| `stakeholder` | `pkg` | 应用包名(必填) | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// common_info — 获取用户通用信息 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "9PTlQdZS4YcQpCMav68kBkwwLZRZHABr3W3WHw7bb54=", // AES(/v1/user/common_info) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "download": "", // extConfig (string) 客户端界面配置下发 + "revenue": "", // type (string) 类型 + "stylize": { // appFbConfig (object) 应用FB配置 + "glow": "", // fbClientId (string) Facebook应用ID + "blur": "" // fbClientToken (string) Facebook客户端Token + }, + "reauthenticate": "", // usign (string) 用户签名 + "publish": "", // countryCode (string) 国家代码 + "swap": "", // creditsRecordUrl (string) 积分记录URL + "chart": "", // tgId (string) Telegram ID + "export": 0, // credit (int) 积分余额 + "spend": "", // tgName (string) Telegram 用户名 + "draft": "", // email (string) 邮箱 + "profile": {}, // ext (object) 扩展信息 + "convert": false, // forcePayCenter (boolean) 是否强制跳转支付中心 + "reboot": { // t2IConfig (object) T2I配置 + "padding": {}, // credits (object) 积分配置(key为任务类型,value为积分数) + "microscopic": [ // templates (array) 提示词模板列表 + { + "circular": "", // img (string) 示例图片URL + "appointment": "" // prompt (string) 提示词内容 + } + ] + }, + "rank": { // h5UrlConfig (object) H5 URL配置 + "altitude": "", // url (string) H5页面URL + "coverage": "" // launchImgUrl (string) 启动图URL + }, + "schedule": "", // payCenterUrl (string) 支付中心URL + "tag": 0, // freeBlurTimes (int) 免费去模糊次数 + "frequency": "", // avatar (string) 头像URL + "supplement": "", // userName (string) 用户名 + "enhance": false, // firstRegister (boolean) 是否首次注册 + "symposium": "", // userId (string) 用户ID + "restore": false, // isVip (boolean) 是否VIP + "enqueue": [], // tags (array) 用户标签 + "label": 0, // freeTimes (int) 免费次数 + "disambiguate": "", // userToken (string) 用户登录token + "recognize": 0, // subScribeValidTime (int) 订阅有效时间戳 + "wallet": 0 // status (int) 用户状态 + } +} +``` + +--- + +### 获取积分页面信息 +`GET /v1/user/credits-page` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `session` | `page` | 页码 *(默认值: "1")* | +| `seminar` | `size` | 每页条数 *(默认值: "10")* | +| `revenue` | `type` | 积分类型 *(默认值: "1")* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// credits_page — 获取积分页面信息 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "549Xw0yFnJjZHKSBVllqWCG6fcbWmpoxxu/64gX4aO0=", // AES(/v1/user/credits-page) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "insert": 0, // total (int) 总条数 + "blend": 0, // current (int) 当前页 + "loop": 0, // pages (int) 总页数 + "seminar": 0, // size (int) 每页大小 + "create": [ // records (array) 积分记录列表 + { + "keepalive": "", // subBusinessType (string) 子业务类型 + "padding": 0, // credits (int) 积分数 + "typography": 0, // createTime (long) 创建时间 + "angle": "", // businessId (string) 业务ID + "revenue": 0, // type (int) 类型,1=增加,2=扣除 + "offset": "" // businessType (string) 业务类型 + } + ] + } +} +``` + +--- + +### 获取用户支付记录 +`GET /v1/user/payments` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// payments — 获取用户支付记录 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "MOxwcmOt+UPU+kiKngEkzzWKd2Q1pq8VD215J8A3r0I=", // AES(/v1/user/payments) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 支付记录列表 + { + "cartoon": 0, // amount (int) 支付金额 + "channel": 0, // payTime (int) 支付时间戳 + "layer": "", // payMethod (string) 支付方式 + "mascot": "", // currency (string) 货币类型 + "depth": "" // payId (string) 支付ID + } + ] +} +``` + +--- + +### 获取未读消息数 +`GET /v1/user/unread-message-count` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `standard` | `types` | 消息类型列表 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// unread_message_count — 获取未读消息数 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "Yyna+fms1qjL2Q38uMiT4E73X9T2Dkg+r7Nm4wt1RtU=", // AES(/v1/user/unread-message-count) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "weigh": [ // unreadCountList (array) 各类型未读数列表 + { + "bubble": 0, // count (int) 未读数 + "revenue": "" // type (string) 消息类型 + } + ], + "promote": 0, // totalUnreadCount (int) 总未读消息数 + "follow": 0 // lastUpdateTime (int) 最后更新时间戳 + } +} +``` + +--- + +### 注销账户 +`GET /v1/user/delete` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// delete — 注销账户 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "B6taFaTaR9c0isGbC2L3/g==", // AES(/v1/user/delete) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "vote": "", // hint (string) + "revenue": "" // type (string) + } +} +``` + +--- + +--- + +## 图片 & 视频任务 +> 核心 AI 功能,需要登录态 +### 创建生图任务 +`POST /v1/image/create-task` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `profile` | `ext` | string | 扩展参数 | +| `vibe` | `enable_music` | bool | 是否使用系统指定的背景声音,false是无声音。默认是true有声音 | +| `liaison` | `taskType` | string | 任务类型 | +| `seminar` | `size` | string | 输出尺寸,如 480p | +| `itinerary` | `templateName` | string | 模板名称,BananaTask任务不传templateName | +| `lease` | `srcImg2` | string | 源图片2的文件路径 | +| `consulate` | `srcImg1Url` | string | 源图片1的URL | +| `team` | `needopt` | boolean | 是否优化,通过配置控制 *(固定值: false)* | +| `crew` | `srcImg1` | string | base64图片1上传,兼容旧app,新app使用srcImg1Url | +| `glossary` | `srcImg2Url` | string | 源图片2的URL | +| `appointment` | `prompt` | string | 文本提示词 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// create_task — 创建生图任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "SDyVz00ZABKCNQYjrh887/V1kPmVJ5gvIddXMpU2j6Y=", // AES(/v1/image/create-task) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "profile": "", // ext (string) 扩展参数 + "vibe": "", // enable_music (bool) 是否使用系统指定的背景声音,false是无声音。默认是true有声音 + "liaison": "", // taskType (string) 任务类型 + "seminar": "", // size (string) 输出尺寸,如 480p + "itinerary": "", // templateName (string) 模板名称,BananaTask任务不传templateName + "lease": "", // srcImg2 (string) 源图片2的文件路径 + "consulate": "", // srcImg1Url (string) 源图片1的URL + "team": false, // 固定传参 + "crew": "", // srcImg1 (string) base64图片1上传,兼容旧app,新app使用srcImg1Url + "glossary": "", // srcImg2Url (string) 源图片2的URL + "appointment": "" // prompt (string) 文本提示词 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 查询图片生成进度 +`GET /v1/image/progress` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `exponential` | `taskId` | 任务ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// progress — 查询图片生成进度 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "ZRQZUzSKdcG3PhD400/WE/Wv9d6SINzvPKuntB5cIdQ=", // AES(/v1/image/progress) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "elastic": [ // imageInfos (array) 图片信息列表 + { + "boost": "", // imgUrl (string) 图片URL + "archive": false, // isBlur (boolean) 是否模糊 + "registration": 0, // imageId (long) 图片ID + "consortium": "", // resolution (string) 分辨率 + "compressive": 0 // imgType (int) 图片类型,1=图片,2=视频 + } + ], + "origin": 0, // progress (int) 进度 + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "revenue": 0, // type (int) 任务类型 + "acuity": 0, // waitTime (int) 等待时间 + "exponential": 0, // taskId (int) 任务ID + "endpoint": 0 // queueCnt (int) 队列数量 + } +} +``` + +--- + +### 获取我的任务列表 +`GET /v1/image/my-tasks` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `session` | `page` | 页码 | +| `seminar` | `size` | 每页数量 | +| `synopsis` | `taskTypes` | 任务类型列表 *(默认值: "1,3,4")* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// my_tasks — 获取我的任务列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "ZILAhMARxTi+4sbdBFCU+ISDUXbVyViWT+QZZk58iIQ=", // AES(/v1/image/my-tasks) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "insert": 0, // total (int) 总数 + "blend": 0, // current (int) 当前页 + "seminar": 0, // size (int) 每页大小 + "create": [ // records (array) 记录列表 + { + "liaison": 0, // taskType (int) 任务类型 + "typography": 0, // createTime (long) 创建时间 + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0, // taskId (long) 任务ID + "easing": [ // imgList (array) 图片列表 + { + "boost": "", // imgUrl (string) 图片URL + "consortium": "", // resolution (string) 分辨率 + "compressive": 0 // imgType (int) 图片类型,1=图片,2=视频 + } + ] + } + ], + "rate": false // hasNext (boolean) 是否有下一页 + } +} +``` + +--- + +### 删除任务 +`POST /v1/image/delete-task` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `exponential` | `taskId` | int | 任务ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// delete_task — 删除任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "D+BRCorCBCTJCXvZvxxfaPV1kPmVJ5gvIddXMpU2j6Y=", // AES(/v1/image/delete-task) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "exponential": 0 // taskId (int) 任务ID + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "vote": "", // hint (string) + "revenue": "" // type (string) + } +} +``` + +--- + +### 获取我的作品 +`GET /v1/image/mycreation` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `session` | `page` | 页码 | +| `seminar` | `size` | 每页数量 | +| `liaison` | `taskType` | 任务类型 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// mycreation — 获取我的作品 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "E40btz3+WcbtRdUj9vNDWF4BsfnAmInCBnR9Rsj1L0A=", // AES(/v1/image/mycreation) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "insert": 0, // total (int) 总数 + "blend": 0, // current (int) 当前页 + "seminar": 0, // size (int) 每页大小 + "reface": false, // optimizeCountSql (boolean) 是否优化count SQL + "create": [ // records (array) 记录列表 + { + "boost": "", // imgUrl (string) 图片URL + "archive": false, // isBlur (boolean) 是否模糊 + "liaison": 0, // taskType (int) 任务类型 + "registration": 0, // imageId (long) 图片ID + "render": "", // appraise (string) 评价 + "consortium": "", // resolution (string) 分辨率 + "appointment": "", // prompt (string) 提示词 + "compressive": 0 // imgType (int) 图片类型 + } + ], + "like": 0, // maxLimit (int) 最大限制 + "transmit": false, // searchCount (boolean) 是否搜索count + "voice": false, // optimizeJoinOfCountSql (boolean) 是否优化join count SQL + "sync": [], // orders (array) 排序 + "share": "" // countId (string) count ID + } +} +``` + +--- + +### 获取预签名上传URL +`POST /v1/image/upload-presigned-url` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `trending` | `fileName1` | string | 文件名1 | +| `spotlight` | `fileName2` | string | 文件名2 | +| `comic` | `contentType` | string | 文件MIME类型 | +| `pose` | `expectedSize` | int | 预期文件大小 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// upload_presigned_url — 获取预签名上传URL +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "nCZSliCSoOFfs20fuGXBXKqWFuCyb4Tu0M4E3+Eisno=", // AES(/v1/image/upload-presigned-url) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "trending": "", // fileName1 (string) 文件名1 + "spotlight": "", // fileName2 (string) 文件名2 + "comic": "", // contentType (string) 文件MIME类型 + "pose": 0 // expectedSize (int) 预期文件大小 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "harden": "", // uploadUrl1 (string) 上传URL 1 + "upload": 0, // expiresIn (int) 过期时间(秒) + "tokenize": {}, // requiredHeaders (object) 上传所需请求头 + "complete": "", // uploadUrl2 (string) 上传URL 2 + "transform": "", // filePath2 (string) 文件路径 2 + "generate": "" // filePath1 (string) 文件路径 1 + } +} +``` + +--- + +### 创建文生图任务 +`POST /v1/image/txt2img_create` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `indicator` | `imgCount` | int | 生成图片数量 *(固定值: 1)* | +| `caption` | `aspectRatio` | string | 宽高比 | +| `appointment` | `prompt` | string | 文本提示词 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// txt2img_create — 创建文生图任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "s9Av0hxfkwckWglmtkBH6kzL/GfTpCyOh8IIK1sP+kM=", // AES(/v1/image/txt2img_create) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "indicator": 1, // 固定传参 + "caption": "", // aspectRatio (string) 宽高比 + "appointment": "" // prompt (string) 文本提示词 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 获取文生图标签 +`GET /v1/image/txt2img_tags` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `stakeholder` | `pkg` | 应用包名(必填) | +| `symposium` | `userId` | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// txt2img_tags — 获取文生图标签 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "s9Av0hxfkwckWglmtkBH6sRuXg7Jsrsui60Mr5e17Ug=", // AES(/v1/image/txt2img_tags) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 标签列表 + { + "capacity": "", // theme (string) 主题 + "enqueue": [ // tags (array) 标签 + { + "remainder": "", // tag (string) 标签名 + "kurtosis": "" // desc (string) 描述 + } + ] + } + ] +} +``` + +--- + +### 获取文生图提示词模板 +`POST /v1/image/txt2img_prompts` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `costume` | `data` | array | 标签数据列表 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// txt2img_prompts — 获取文生图提示词模板 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "s9Av0hxfkwckWglmtkBH6ncw1DLwVYIfyFaY3CmgwKE=", // AES(/v1/image/txt2img_prompts) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "costume": [{"custom":"","capacity":"","enqueue":[]}] + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "appointment": "", // prompt (string) 文本提示词 + "enqueue": "" // tags (string) 标签 + } +} +``` + +--- + +### 创建换衣任务 +`POST /v1/image/clothes_swap_ex` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `itinerary` | `templateName` | 模板名称 | +| `revenue` | `type` | 类型 *(默认值: "1")* | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `dynasty` | `srcImgBase64` | string | 源图片Base64数据 | +| `logbook` | `srcImgUrl` | string | 源图片URL | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// clothes_swap_ex — 创建换衣任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "lYVJpsqrLK/C9kfDM8JOUf9dnddtGByEgfOOEiL1qds=", // AES(/v1/image/clothes_swap_ex) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "dynasty": "", // srcImgBase64 (string) 源图片Base64数据 + "logbook": "" // srcImgUrl (string) 源图片URL + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 创建自定义换衣任务 +`POST /v1/image/custom_clothes_swap` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `symposium` | `userId` | 用户ID | +| `reaction` | `appType` | 应用类型 *(默认值: "3")* | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `lease` | `srcImg2` | string | 源图片2的文件路径 | +| `crew` | `srcImg1` | string | 源图片1的文件路径 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// custom_clothes_swap — 创建自定义换衣任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "azfqGJW/Ai/FSsDaiuUXCLRNVjSKV/CQ8GaukiC2Rj8=", // AES(/v1/image/custom_clothes_swap) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "lease": "", // srcImg2 (string) 源图片2的文件路径 + "crew": "" // srcImg1 (string) 源图片1的文件路径 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 创建换脸任务 +`POST /v1/image/faceswap_task` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `circular` | `img` | string | 图片 | +| `repository` | `headPos` | string | 头像位置 | +| `delegate` | `headType` | int | 头像类型 *(固定值: 0)* | +| `terminal` | `headImg` | string | 头像图片 | +| `consortium` | `resolution` | string | 分辨率 | +| `entry` | `headFaceIndex` | int | 头像人脸索引 *(固定值: 2)* | +| `circuit` | `srcFaceIndex` | int | 源图人脸索引 *(固定值: 1)* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// faceswap_task — 创建换脸任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "BviCoJhpWNssLcLWCeCEAMhE8H95H4+jK0rI8UNbvjo=", // AES(/v1/image/faceswap_task) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "circular": "", // img (string) 图片 + "repository": "", // headPos (string) 头像位置 + "delegate": 0, // 固定传参 + "terminal": "", // headImg (string) 头像图片 + "consortium": "", // resolution (string) 分辨率 + "entry": 2, // 固定传参 + "circuit": 1 // 固定传参 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 创建增强换脸任务 +`POST /v1/image/faceswap_ex_task` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `lease` | `srcImg2` | string | 源图片2的文件路径 | +| `crew` | `srcImg1` | string | 源图片1的文件路径 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// faceswap_ex_task — 创建增强换脸任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "BviCoJhpWNssLcLWCeCEAMaW+L60OrCOzGmif07JUM4=", // AES(/v1/image/faceswap_ex_task) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "lease": "", // srcImg2 (string) 源图片2的文件路径 + "crew": "" // srcImg1 (string) 源图片1的文件路径 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 检测图片人脸 +`POST /v1/image/get_image_faces` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `dynasty` | `srcImgBase64` | string | 源图片Base64数据 | +| `logbook` | `srcImgUrl` | string | 源图片URL | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// get_image_faces — 检测图片人脸 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "PHjL2S4W3A5fFtZANKbxUWqrI+hZ+Q/3+rv14h5Rw04=", // AES(/v1/image/get_image_faces) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "dynasty": "", // srcImgBase64 (string) 源图片Base64数据 + "logbook": "" // srcImgUrl (string) 源图片URL + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "preview": 0, // duration (int) 时长 + "postprocess": "", // videoUrl (string) 视频URL + "discover": [ // faceInfos (array) 人脸信息列表 + { + "border": "", // face (string) 人脸图片 + "shadow": 0, // face_index (int) 人脸索引 + "speed": "", // gender (string) 性别 + "binormal": 0, // y1 (int) 左上角Y坐标 + "angular": 0, // x1 (int) 左上角X坐标 + "manifold": 0, // y2 (int) 右下角Y坐标 + "weight": 0, // index (int) 索引 + "enthalpy": 0, // x2 (int) 右下角X坐标 + "intensity": 0, // age (int) 年龄 + "motion": 0 // frame_index (int) 帧索引 + } + ], + "colorize": 0 // needCredits (int) 所需积分 + } +} +``` + +--- + +### 检测视频人脸 +`POST /v1/image/get_video_faces` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | +| `preview` | `duration` | 时长 | +| `commendation` | `srcVideo` | 源视频 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// get_video_faces — 检测视频人脸 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "GMq795fqAjR8vj/Z3EiSJJy1LdYw6669KnyXp4Gtz2I=", // AES(/v1/image/get_video_faces) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "preview": 0, // duration (int) 时长 + "postprocess": "", // videoUrl (string) 视频URL + "discover": [ // faceInfos (array) 人脸信息列表 + { + "border": "", // face (string) 人脸图片 + "shadow": 0, // face_index (int) 人脸索引 + "speed": "", // gender (string) 性别 + "binormal": 0, // y1 (int) 左上角Y坐标 + "angular": 0, // x1 (int) 左上角X坐标 + "manifold": 0, // y2 (int) 右下角Y坐标 + "weight": 0, // index (int) 索引 + "enthalpy": 0, // x2 (int) 右下角X坐标 + "intensity": 0, // age (int) 年龄 + "motion": 0 // frame_index (int) 帧索引 + } + ], + "colorize": 0 // needCredits (int) 所需积分 + } +} +``` + +--- + +### 创建黏土风格任务 +`POST /v1/image/clay_stylization` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `team` | `needopt` | 是否优化,通过配置控制 *(默认值: "false")* | +| `satire` | `ch` | 渠道号 | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `dynasty` | `srcImgBase64` | string | 源图片Base64数据 | +| `logbook` | `srcImgUrl` | string | 源图片URL | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// clay_stylization — 创建黏土风格任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "S+6xKs5lzzuc89oqJjfg0b41udJ6b7wIb6LES8S1Y4k=", // AES(/v1/image/clay_stylization) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "dynasty": "", // srcImgBase64 (string) 源图片Base64数据 + "logbook": "" // srcImgUrl (string) 源图片URL + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 创建视频换脸任务 +`POST /v1/image/video_facewap_task` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `periodical` | `videoFrameIndex` | int | 视频帧索引 *(固定值: 10)* | +| `repository` | `headPos` | string | 头像位置 | +| `postprocess` | `videoUrl` | string | 视频URL | +| `delegate` | `headType` | int | 头像类型 *(固定值: 2)* | +| `terminal` | `headImg` | string | 头像图片 | +| `itinerary` | `templateName` | string | 模板名称 | +| `escrow` | `videoFaceIndex` | int | 视频人脸索引 *(固定值: 1)* | +| `revenue` | `type` | int | 类型 *(固定值: 0)* | +| `entry` | `headFaceIndex` | int | 头像人脸索引 *(固定值: 3)* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// video_facewap_task — 创建视频换脸任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "sJoF2paOhB6BnHJXvc5/fgWx3/JZ4Xk9hHADB/UXTlI=", // AES(/v1/image/video_facewap_task) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "periodical": 10, // 固定传参 + "repository": "", // headPos (string) 头像位置 + "postprocess": "", // videoUrl (string) 视频URL + "delegate": 2, // 固定传参 + "terminal": "", // headImg (string) 头像图片 + "itinerary": "", // templateName (string) 模板名称 + "escrow": 1, // 固定传参 + "revenue": 0, // 固定传参 + "entry": 3 // 固定传参 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 图片动作风格化gif +`POST /v1/image/offtop_video` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `team` | `needopt` | 是否优化,通过配置控制 *(默认值: "false")* | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `genealogy` | `videoSize` | string | 视频尺寸 *(固定值: 480p)* | +| `permission` | `srcImg` | string | 源图片 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// offtop_video — 图片动作风格化gif +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "BVsQc9sTlzSoCPtj0i2k03fjIjHQYxyldloNU6YOfBw=", // AES(/v1/image/offtop_video) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "genealogy": "480p", // 固定传参 + "permission": "" // srcImg (string) 源图片 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 创建图转视频姿态任务 +`POST /v1/image/img2video_pose_task` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `itinerary` | `templateName` | 模板名称 | +| `lineage` | `fps` | 帧率 *(默认值: "25")* | +| `team` | `needopt` | 是否优化,通过配置控制 *(默认值: "false")* | +| `preview` | `duration` | 时长 *(默认值: "12")* | +| `dynasty` | `srcImgBase64` | 源图片Base64数据 | +| `commendation` | `srcVideo` | 源视频 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// img2video_pose_task — 创建图转视频姿态任务 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "hlyoby7+Q/bDo1oWHbaiQbddj5Bdjy4BY/RYogP5hUU=", // AES(/v1/image/img2video_pose_task) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "bitrate": 0, // state (int) 任务状态:1=队列中 | 2=处理中 | 3=完成 | 4=超时 | 5=错误 | 6=中止 + "exponential": 0 // taskId (int) 任务ID + } +} +``` + +--- + +### 获取图转视频任务列表 +`GET /v1/image/img2video/tasks` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `scale` | `categoryId` | 分类ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// tasks — 获取图转视频任务列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "hlyoby7+Q/bDo1oWHbaiQTDv+HSLSaD0RB91euOsZBc=", // AES(/v1/image/img2video/tasks) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 任务列表 + { + "anchor": { // previewVideo (object) 预览视频 + "durability": "", // lowUrl (string) 低分辨率视频URL + "altitude": "", // url (string) 视频URL + "precision": "" // hlsUrl (string) HLS流URL + }, + "factor": { // resolution720p (object) 720p分辨率配置 + "preview": 0, // duration (int) 时长(秒) + "padding": 0, // credits (int) 所需积分 + "delay": "" // icon (string) 图标URL + }, + "bounce": 0, // imageCount (int) 图片数量 + "profile": "", // ext (string) 扩展参数 + "liaison": "", // taskType (string) 任务类型 + "span": { // resolution480p (object) 480p分辨率配置 + "preview": 0, // duration (int) 时长(秒) + "padding": 0, // credits (int) 所需积分 + "delay": "" // icon (string) 图标URL + }, + "itinerary": "", // templateName (string) 模板名称 + "team": false, // needopt (boolean) 是否优化,通过配置控制 + "density": { // label (object) 标签 + "delay": "" // icon (string) 标签图标URL + }, + "interval": "", // title (string) 标题 + "slice": { // previewImage (object) 预览图 + "altitude": "" // url (string) 图片URL + } + } + ] +} +``` + +--- + +--- + +## 模板 & 分类 +> 素材与配置查询,部分无需登录态 +### 获取推荐提示词 +`GET /v1/image/prompt/recomends` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// recomends — 获取推荐提示词 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "fb/ODSRlLpg+pTA3+sgGriaMVnzyC6Tc1VzRUrqU9oE=", // AES(/v1/image/prompt/recomends) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 推荐提示词列表 + { + "remainder": "", // tag (string) 标签 + "appointment": "" // prompt (string) 文本提示词 + } + ] +} +``` + +--- + +### 获取分类列表 +`GET /v1/image/category-list` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `dialogue` | `templateTypes` | 模板类型列表 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// category_list — 获取分类列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "W2xHjqbkV0pcl7+9dWSBagfbvQ/VBnwaqyDkVol1Z9M=", // AES(/v1/image/category-list) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 分类列表 + { + "ringing": "", // templateType (string) 模板类型 + "rotation": "", // categoryName (string) 分类名称 + "scale": 0 // categoryId (int) 分类ID + } + ] +} +``` + +--- + +### 获取换衣模板 +`GET /v1/image/clothes_template` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | +| `scale` | `categoryId` | 分类ID *(默认值: "1")* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// clothes_template — 获取换衣模板 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "lYVJpsqrLK/C9kfDM8JOUZbh89U6hhdQa7ikBPG3MaU=", // AES(/v1/image/clothes_template) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 换衣模板列表 + { + "itinerary": "", // templateName (string) 模板名称 + "padding": 0, // credits (int) 积分 + "frequency": "", // avatar (string) 头像 + "revenue": 0, // type (int) 类型 + "resistance": "", // user (string) 用户 + "refractive": "" // templateUrl (string) 模板URL + } + ] +} +``` + +--- + +### 获取图片模板 +`GET /v1/image/image_template` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | +| `scale` | `categoryId` | 分类ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// image_template — 获取图片模板 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "Dx60zWIjtpgVTVqx0xaTScQQxW/GKc+Be40iSza0gZU=", // AES(/v1/image/image_template) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 图片模板列表 + { + "repository": "", // headPos (string) 头像位置 + "itinerary": "", // templateName (string) 模板名称 + "radius": 0, // faceIndex (int) 人脸索引 + "padding": 0, // credits (int) 积分 + "frequency": "", // avatar (string) 头像 + "resistance": "", // user (string) 用户 + "correctness": "", // resulotion (string) 分辨率 + "refractive": "" // templateUrl (string) 模板URL + } + ] +} +``` + +--- + +### 获取推荐头像 +`GET /v1/image/recommendhead` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// recommendhead — 获取推荐头像 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "M0P94sscEB5AGtUBFtHnNoAUPd+5uTKtyY4azNUs8m4=", // AES(/v1/image/recommendhead) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "load": [ // sys (array) 系统推荐列表 + { + "circular": "", // img (string) 图片 + "repository": "", // headPos (string) 头部位置 + "radius": 0, // faceIndex (int) 人脸索引 + "altitude": "" // url (string) URL + } + ], + "fabricate": [ // recent (array) 最近使用列表 + { + "circular": "", // img (string) 图片 + "repository": "", // headPos (string) 头部位置 + "radius": 0, // faceIndex (int) 人脸索引 + "altitude": "" // url (string) URL + } + ] + } +} +``` + +--- + +### 获取视频换脸模板 +`GET /v1/image/faceswap_video_template` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | +| `scale` | `categoryId` | 分类ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// faceswap_video_template — 获取视频换脸模板 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "BviCoJhpWNssLcLWCeCEAO3a3lQCf60++HfsC/vedD9V0kfX2EYyCqybFZnWFqwP", // AES(/v1/image/faceswap_video_template) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 视频换脸模板列表 + { + "pattern": 0, // frameIndex (int) 帧索引 + "hue": 0, // videoDuration (int) 视频时长 + "itinerary": "", // templateName (string) 模板名称 + "padding": 0, // credits (int) 积分 + "radius": 0, // faceIndex (int) 人脸索引 + "quantized": "", // templateFaceUrl (string) 模板人脸URL + "frequency": "", // avatar (string) 头像 + "duration": "", // animate (string) 动画 + "resistance": "", // user (string) 用户 + "refractive": "" // templateUrl (string) 模板URL + } + ] +} +``` + +--- + +### 获取图转视频姿态模板 +`GET /v1/image/img2Video_pose_template` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `satire` | `ch` | 渠道号 | +| `symposium` | `userId` | 用户ID | +| `scale` | `categoryId` | 分类ID *(默认值: "1")* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// img2Video_pose_template — 获取图转视频姿态模板 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "8/gQGltIUvJ5gX2DJkOYRK5F5tzK0SzHi0QfCxLBYvJV0kfX2EYyCqybFZnWFqwP", // AES(/v1/image/img2Video_pose_template) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 图转视频姿态模板列表 + { + "preview": 0, // duration (int) 时长 + "convergence": "", // templateTfUrl (string) 模板TF URL + "capitalization": 0, // templateTfCredits (int) 模板TF积分 + "tension": "", // templateFifUrl (string) 模板FIF URL + "itinerary": "", // templateName (string) 模板名称 + "padding": {}, // credits (object) 积分配置 + "demodulation": 0, // templateTfDuration (int) 模板TF时长 + "usability": 0, // templateFifDuration (int) 模板FIF时长 + "duration": "", // animate (string) 动画 + "compressed": 0, // templateFifCredits (int) 模板FIF积分 + "refractive": "" // templateUrl (string) 模板URL + } + ] +} +``` + +--- + +### 获取图转视频分类 +`GET /v1/image/img2video/categories` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// categories — 获取图转视频分类 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "hlyoby7+Q/bDo1oWHbaiQbslnntFuCttp9esQfOj2ak=", // AES(/v1/image/img2video/categories) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [ // data (array) 分类列表 + { + "alignment": "", // name (string) 分类名称 + "delay": "", // icon (string) 图标 + "timing": 0 // id (int) 分类ID + } + ] +} +``` + +--- + +--- + +## 支付 +> 需要登录态 +### 创建支付订单 +`POST /v1/payment/createPayment` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `sticker` | `app` | string | 应用标识(必填) | +| `council` | `lastName` | string | 姓 | +| `overlay` | `country` | string | 国家代码 | +| `outfit` | `expireMonth` | string | 过期月 | +| `avatar` | `accountName` | string | 账户名 | +| `carnival` | `userInfoType` | string | 用户信息类型 | +| `punchline` | `automaticRenewal` | boolean | 是否自动续费 | +| `skit` | `channel` | string | 渠道 | +| `persona` | `cvcCode` | string | CVC安全码 | +| `reel` | `channelType` | string | 渠道类型 | +| `symposium` | `userId` | string | 用户ID | +| `character` | `activityId` | string | 活动模板ID | +| `appendix` | `firstName` | string | 名 | +| `bundle` | `subPaymentMethod` | string | 子支付方式 | +| `sponsor` | `phone` | string | 电话 | +| `microservice` | `tgOrderId` | string | Telegram订单ID | +| `chart` | `tgId` | string | Telegram ID | +| `alignment` | `name` | string | 姓名 | +| `ledger` | `paymentMethod` | string | 支付方式,如 GOOGLEPAY/APPLEPAY | +| `trait` | `expireYear` | string | 过期年 | +| `spoof` | `card` | string | 卡号 | +| `wallet` | `status` | string | 状态 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// createPayment — 创建支付订单 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "XcNR8qG7sfb38dR3IEhYLYmALeBOULRvjJQiuVgqSxE=", // AES(/v1/payment/createPayment) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "sticker": "", // app (string) 应用标识(必填) + "council": "", // lastName (string) 姓 + "overlay": "", // country (string) 国家代码 + "outfit": "", // expireMonth (string) 过期月 + "avatar": "", // accountName (string) 账户名 + "carnival": "", // userInfoType (string) 用户信息类型 + "punchline": false, // automaticRenewal (boolean) 是否自动续费 + "skit": "", // channel (string) 渠道 + "persona": "", // cvcCode (string) CVC安全码 + "reel": "", // channelType (string) 渠道类型 + "symposium": "", // userId (string) 用户ID + "character": "", // activityId (string) 活动模板ID + "appendix": "", // firstName (string) 名 + "bundle": "", // subPaymentMethod (string) 子支付方式 + "sponsor": "", // phone (string) 电话 + "microservice": "", // tgOrderId (string) Telegram订单ID + "chart": "", // tgId (string) Telegram ID + "alignment": "", // name (string) 姓名 + "ledger": "", // paymentMethod (string) 支付方式,如 GOOGLEPAY/APPLEPAY + "trait": "", // expireYear (string) 过期年 + "spoof": "", // card (string) 卡号 + "wallet": "" // status (string) 状态 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "explore": {}, // features (object) 功能特性 + "introspect": [ // payTypeList (array) 支付类型列表 + { + "constant": "", // showName (string) 展示名称 + "alignment": "", // name (string) 支付方式 + "delay": "", // icon (string) 展示图标 + "segment": "", // paylink (string) 支付链接 + "timing": 0, // id (long) ID + "overtone": 0 // sort (int) 排序 + } + ], + "duplicate": "", // issuerUrl (string) 发卡方URL + "merge": "", // cryptoInvoiceUrl (string) 加密发票URL + "objectify": "", // payUrl (string) 支付URL + "timing": "", // id (string) 支付ID/订单ID + "submit": "", // payStatus (string) 支付状态枚举名:INIT | SUCCESS | PROCESSING | FAILED | CANCELED + "morph": 0 // openType (int) URL打开方式,0=内部/1=外部浏览器 + } +} +``` + +--- + +### 获取Google商品列表 +`GET /v1/payment/getGooglePayActivities` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `filter` | `client` | 客户端 | +| `overlay` | `country` | 国家代码 | +| `stakeholder` | `pkg` | 应用包名(必填) | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// getGooglePayActivities — 获取Google商品列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "RuncHT0xkF47+AU0wnXKWH+aw8808UOS9iEomNrpe2LF41+d749qAu2t016y1xBJ", // AES(/v1/payment/getGooglePayActivities) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "cap": [ // subscriptionActivitys (array) 订阅商品列表 + { + "spacing": "", // note (string) 备注 + "scene": "", // code (string) 产品代码 + "contrast": 0, // bonus (int) 赠送积分 + "sketch": "", // actualAmount (string) 实际金额 + "margin": "", // discountOff (string) 折扣 + "interval": "", // title (string) 标题 + "brochure": "", // originAmount (string) 原价 + "character": "", // activityId (string) 活动ID + "unicast": "", // subscriptionPeriod (string) 订阅周期 + "padding": 0, // credits (int) 积分数 + "filter": "", // client (string) 客户端 + "backdrop": 0, // days (int) 天数 + "mascot": "", // currency (string) 货币 + "pivot": 0 // productType (int) 产品类型 + } + ], + "animate": [ // activitys (array) 商品列表 + { + "spacing": "", // note (string) 备注 + "scene": "", // code (string) 产品代码 + "contrast": 0, // bonus (int) 赠送积分 + "sketch": "", // actualAmount (string) 实际金额 + "margin": "", // discountOff (string) 折扣 + "interval": "", // title (string) 标题 + "brochure": "", // originAmount (string) 原价 + "character": "", // activityId (string) 活动ID + "unicast": "", // subscriptionPeriod (string) 订阅周期 + "padding": 0, // credits (int) 积分数 + "filter": "", // client (string) 客户端 + "backdrop": 0, // days (int) 天数 + "mascot": "", // currency (string) 货币 + "pivot": 0 // productType (int) 产品类型 + } + ] + } +} +``` + +--- + +### 获取Apple商品列表 +`GET /v1/payment/getApplePayActivities` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `filter` | `client` | 客户端 | +| `overlay` | `country` | 国家代码 | +| `stakeholder` | `pkg` | 应用包名(必填) | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// getApplePayActivities — 获取Apple商品列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "U77eVRQKlTGeMSK9VhvSxf6S5/FjnRkN65JWx/dbkP41indkNaavFQ9teSfAN69C", // AES(/v1/payment/getApplePayActivities) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "cap": [ // subscriptionActivitys (array) 订阅商品列表 + { + "spacing": "", // note (string) 备注 + "scene": "", // code (string) 产品代码 + "contrast": 0, // bonus (int) 赠送积分 + "sketch": "", // actualAmount (string) 实际金额 + "margin": "", // discountOff (string) 折扣 + "interval": "", // title (string) 标题 + "brochure": "", // originAmount (string) 原价 + "character": "", // activityId (string) 活动ID + "unicast": "", // subscriptionPeriod (string) 订阅周期 + "padding": 0, // credits (int) 积分数 + "filter": "", // client (string) 客户端 + "backdrop": 0, // days (int) 天数 + "mascot": "", // currency (string) 货币 + "pivot": 0 // productType (int) 产品类型 + } + ], + "animate": [ // activitys (array) 商品列表 + { + "spacing": "", // note (string) 备注 + "scene": "", // code (string) 产品代码 + "contrast": 0, // bonus (int) 赠送积分 + "sketch": "", // actualAmount (string) 实际金额 + "margin": "", // discountOff (string) 折扣 + "interval": "", // title (string) 标题 + "brochure": "", // originAmount (string) 原价 + "character": "", // activityId (string) 活动ID + "unicast": "", // subscriptionPeriod (string) 订阅周期 + "padding": 0, // credits (int) 积分数 + "filter": "", // client (string) 客户端 + "backdrop": 0, // days (int) 天数 + "mascot": "", // currency (string) 货币 + "pivot": 0 // productType (int) 产品类型 + } + ] + } +} +``` + +--- + +### Google支付结果回调 +`POST /v1/payment/googlepay` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `selection` | `signature` | string | 签名 | +| `gauge` | `purchaseData` | string | Google支付凭据JSON | +| `timing` | `id` | string | 支付ID/订单ID | +| `symposium` | `userId` | string | 用户ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// googlepay — Google支付结果回调 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "5kbSUwSgEttk3PI1TF7hHO3sz7F7T7MtRIC3ycT/lGs=", // AES(/v1/payment/googlepay) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "selection": "", // signature (string) 签名 + "gauge": "", // purchaseData (string) Google支付凭据JSON + "timing": "", // id (string) 支付ID/订单ID + "symposium": "" // userId (string) 用户ID + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "character": "", // activityId (string) 活动模板ID + "reformat": "", // redirectUrl (string) 重定向URL + "remix": false, // addCredits (boolean) 是否添加积分 + "bubble": "", // count (string) 数量 + "mascot": "", // currency (string) 货币 + "timing": "", // id (string) 支付ID/订单ID + "wallet": "" // status (string) 支付状态枚举名:INIT | SUCCESS | PROCESSING | FAILED | CANCELED + } +} +``` + +--- + +### Apple支付结果回调 +`POST /v1/payment/applepay` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `stakeholder` | `pkg` | 应用包名(必填) | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `funnel` | `receipt` | string | Apple支付凭据 | +| `timing` | `id` | string | 支付ID/订单ID | +| `symposium` | `userId` | string | 用户ID | +| `installation` | `transactionId` | string | 交易ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// applepay — Apple支付结果回调 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "bFdphJDLl0MeY5lKNDqAg2HZ6ktg9Ki9gw1JEAa3rYE=", // AES(/v1/payment/applepay) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "funnel": "", // receipt (string) Apple支付凭据 + "timing": "", // id (string) 支付ID/订单ID + "symposium": "", // userId (string) 用户ID + "installation": "" // transactionId (string) 交易ID + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "character": "", // activityId (string) 活动模板ID + "reformat": "", // redirectUrl (string) 重定向URL + "remix": false, // addCredits (boolean) 是否添加积分 + "bubble": "", // count (string) 数量 + "mascot": "", // currency (string) 货币 + "timing": "", // id (string) 支付ID/订单ID + "wallet": "" // status (string) 支付状态枚举名:INIT | SUCCESS | PROCESSING | FAILED | CANCELED + } +} +``` + +--- + +### 获取支付订单列表 +`GET /v1/payment/getPaymentDetailList` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `symposium` | `userId` | 用户ID | +| `ledger` | `paymentMethod` | 支付方式,如 GOOGLEPAY/APPLEPAY | +| `quest` | `filterStatus` | 筛选状态 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// getPaymentDetailList — 获取支付订单列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "6LEB6Zt4O2YlVv23bm7AysudNQ56fkFcCRdVesK8LW96TdvFlR/N5sIeNKMIFAq1", // AES(/v1/payment/getPaymentDetailList) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": [] // data (array) 订单列表,每项含id/status/currency/count/activityId/addCredits/redirectUrl +} +``` + +--- + +### 获取支付方式列表 +`POST /v1/payment/get-payment-methods` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `character` | `activityId` | int | 活动模板ID | +| `overlay` | `country` | string | 国家代码 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// get_payment_methods — 获取支付方式列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "WLtHvajEN6qo5St5SLE7CCAO+YnNjHqWcWZcw9ypwDA=", // AES(/v1/payment/get-payment-methods) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "character": 0, // activityId (int) 活动模板ID + "overlay": "" // country (string) 国家代码 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "invoke": [ // paymentMethods (array) 支付方式列表 + { + "bundle": "", // subPaymentMethod (string) 子支付方式 + "saturation": 0, // bonusCredits (int) 赠送积分 + "alignment": "", // name (string) 名称 + "delay": "", // icon (string) 图标 + "breakpoint": false, // recentlyUsed (boolean) 是否最近使用 + "ledger": "", // paymentMethod (string) 支付方式 + "threshold": false, // recommend (boolean) 是否推荐 + "sharpness": 0.0, // bonusRatio (double) 赠送比例 + "adaptive": false // selected (boolean) 是否默认选中 + } + ] + } +} +``` + +--- + +### 获取订单详情 +`GET /v1/payment/getOrderDetail` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `symposium` | `userId` | 用户ID | +| `timing` | `id` | 支付ID/订单ID | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// getOrderDetail — 获取订单详情 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "xPOjtP0Xwypi/obXvw7mUPa0L/aqdNbZewMS2kn486c=", // AES(/v1/payment/getOrderDetail) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "character": "", // activityId (string) 活动模板ID + "reformat": "", // redirectUrl (string) 重定向URL + "remix": false, // addCredits (boolean) 是否添加积分 + "bubble": "", // count (string) 数量 + "mascot": "", // currency (string) 货币 + "timing": "", // id (string) 支付ID/订单ID + "wallet": "" // status (string) 支付状态枚举名:INIT | SUCCESS | PROCESSING | FAILED | CANCELED + } +} +``` + +--- + +--- + +## 反馈 +> 需要登录态 +### 获取反馈上传URL +`POST /v1/feedback/upload-presigned-url` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `feed` | `fileName` | string | 文件名 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// upload_presigned_url — 获取反馈上传URL +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "KtXIzIaOY6tKydUTTMoj9jww+otaA8rrRLFeOjwhyCAfF4F99kkeMOQm1Fv4IMCn", // AES(/v1/feedback/upload-presigned-url) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "feed": "" // fileName (string) 文件名 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "update": "", // uploadUrl (string) 上传URL + "search": "" // filePath (string) 文件路径 + } +} +``` + +--- + +### 提交反馈 +`POST /v1/feedback/submit` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `texture` | `fileUrls` | array | 文件URL列表 | +| `comic` | `contentType` | string | 内容类型 | +| `gradient` | `content` | string | 内容 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// submit — 提交反馈 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "5PsAKnZCdt3ZPhtFOyCMLE7h+3SY4w/D38GTwhYs3s4=", // AES(/v1/feedback/submit) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "texture": [], + "comic": "", // contentType (string) 内容类型 + "gradient": "" // content (string) 内容 + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "vote": "", // hint (string) + "revenue": "" // type (string) + } +} +``` + +--- + +### 获取反馈列表 +`GET /v1/feedback/list` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `session` | `page` | 页码 *(默认值: "1")* | +| `seminar` | `size` | 每页条数 *(默认值: "10")* | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `空 b 参数` 字段) + +``` +// list — 获取反馈列表 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "WlI3MgBAyQnMNF3RPhldni1iZGw7c0NGgNIK6+WGKJA=", // AES(/v1/feedback/list) +// "avatar_mode": "7J8V5jVfCHKnEigVbbS08w==", // AES(GET) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// 注意: 原始接口为 GET,走代理后统一 POST,仍需传 V2 请求体(业务字段为空) +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "insert": 0, // total (int) 总条数 + "blend": 0, // current (int) 当前页 + "seminar": 0, // size (int) 每页大小 + "create": [ // records (array) 反馈记录列表 + { + "midpoint": false, // read (boolean) 是否已读 + "grain": 0, // feedbackId (long) 反馈ID + "texture": [], // fileUrls (array) 附件URL列表 + "calendar": 0, // replyStatus (int) 回复状态 + "amplitude": { // reply (object) 回复内容body + "gradient": "" // content (string) 回复内容 + }, + "layout": "", // createTimeText (string) 创建时间 + "gradient": "" // content (string) 反馈内容 + } + ], + "rate": false // hasNext (boolean) 是否有下一页 + } +} +``` + +--- + +### 标记反馈已读 +`POST /v1/feedback/read` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**请求体字段** + +| 字段(V2名) | 原始字段 | 类型 | 说明 | +|------------|---------|------|------| +| `showcase` | `feedbackIds` | array | 反馈ID列表 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// read — 标记反馈已读 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "+hlYqg+TZabG2vOulWO6wFoogH66IgEKKds90tKS+G8=", // AES(/v1/feedback/read) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + "showcase": [] + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "vote": "", // hint (string) + "revenue": "" // type (string) + } +} +``` + +--- + +--- + +## 日志 +> 埋点上报 +### App事件打点上报 +`POST /v1/log/appevent` | 鉴权:需要 + +**请求头** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `stakeholder` | `pkg` | 应用包名(必填) | +| `comedy` | `User_token` | 用户登录token | + +**查询参数** + +| 字段(V2名) | 原始字段 | 说明 | +|------------|---------|------| +| `sticker` | `app` | 应用标识(必填,iOS: HIOS / Android: HAndroid) | +| `gesture` | `event` | 事件名称(必填) | +| `symposium` | `userId` | 用户ID | +| `satire` | `ch` | 渠道 | + +**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段) + +``` +// appevent — App事件打点上报 +// POST {baseUrl}/workshop/lounge/hub/playground +// +// 代理请求: +// { +// "humor_level": "FunyMeeAI", // appId 明文 +// "comedy_style": "UiSfI3LsYc0fmUf/x7V4oHpN28WVH83mwh40owgUCrU=", // AES(/v1/log/appevent) +// "avatar_mode": "Mhb3yNV4SnrfCK8EJAq9VQ==", // AES(POST) +// "filter_type": "", // AES(映射后的Header字段名构造JSON) → Base64 +// "scene_id": "", // AES(映射后的URL参数字段名构造JSON) → Base64 +// "clip_duration": "", // AES(V2包装后的业务数据) → Base64 +// "sample_rate": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "watermark_id": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "geo_radius": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// "accuracy_m": "<随机4-8位字母数字,AES加密→Base64>" // 噪音 +// } +// +// V2 请求体 — 填入业务值后 AES 加密,填入 clip_duration +{ + "shell": 2, + "capsule": { + "envelope": { + "container": { + } + } + }, + "shimmer": "<随机4-8位字母数字,AES加密→Base64>", + "glimmer": "<随机4-8位字母数字,AES加密→Base64>", + "flicker": "<随机4-8位字母数字,AES加密→Base64>", + "sparkle": "<随机4-8位字母数字,AES加密→Base64>", + "rustle": "<随机4-8位字母数字,AES加密→Base64>", + "murmur": "<随机4-8位字母数字,AES加密→Base64>", + "whisper": "<随机4-8位字母数字,AES加密→Base64>", + "echo": "<随机4-8位字母数字,AES加密→Base64>" +} + +``` + +**响应体**(解密后) + +```json +{ + "sprint": "", // msg (string) 消息 + "scene": 0, // code (int) 状态码,0=成功 + "costume": { // data + "vote": "", // hint (string) + "revenue": "" // type (string) + } +} +``` + +--- + + + +--- + +## 字段映射全表 + +| 原始字段 | V2字段 | +|----------|--------| +| User_token | comedy | +| accountId | meme | +| accountName | avatar | +| activityId | character | +| activitys | animate | +| actualAmount | sketch | +| addCredits | remix | +| adsTokenId | humor | +| age | intensity | +| amount | cartoon | +| animate | duration | +| app | sticker | +| appFbConfig | stylize | +| appType | reaction | +| appraise | render | +| approveState | clip | +| aspectRatio | caption | +| automaticRenewal | punchline | +| avatar | frequency | +| baseCredits | opacity | +| baseUrl | joke | +| begTime | gag | +| bonus | contrast | +| bonusCredits | saturation | +| bonusRatio | sharpness | +| businessId | angle | +| businessType | offset | +| campaignInfo | parody | +| card | spoof | +| categoryId | scale | +| categoryName | rotation | +| ch | satire | +| channel | skit | +| channelType | reel | +| client | filter | +| clientId | template | +| code | scene | +| coder | panel | +| config | edit | +| content | gradient | +| contentType | comic | +| count | bubble | +| countId | share | +| country | overlay | +| countryCode | publish | +| creatTime | palette | +| createTime | typography | +| createTimeText | layout | +| credit | export | +| creditPromotion | apply | +| credits | padding | +| creditsRecordUrl | swap | +| cryptoInvoiceUrl | merge | +| currency | mascot | +| current | blend | +| cvcCode | persona | +| data | costume | +| days | backdrop | +| department | resize | +| desc | kurtosis | +| description | crop | +| devId | frame | +| deviceId | stage | +| discountOff | margin | +| domain | theme | +| domains | adjust | +| dt | mood | +| duration | preview | +| email | draft | +| enable_music | vibe | +| enabled | customize | +| endTime | expression | +| event | gesture | +| expectedSize | pose | +| expireMonth | outfit | +| expireYear | trait | +| expiresIn | upload | +| ext | profile | +| extConfig | download | +| extJson | gallery | +| face | border | +| faceIndex | radius | +| faceInfos | discover | +| face_index | shadow | +| fbClientId | glow | +| fbClientToken | blur | +| feature | browse | +| features | explore | +| feedbackId | grain | +| feedbackIds | showcase | +| fileName | feed | +| fileName1 | trending | +| fileName2 | spotlight | +| filePath | search | +| filePath1 | generate | +| filePath2 | transform | +| fileUrls | texture | +| filterCountry | collection | +| filterDomain | badge | +| filterOwnerId | reward | +| filterStatus | quest | +| filterTaskType | caucus | +| filterVip | allowance | +| firstName | appendix | +| firstRegister | enhance | +| forcePayCenter | convert | +| fps | lineage | +| frameIndex | pattern | +| frame_index | motion | +| freeBlurTimes | tag | +| freeTimes | label | +| gender | speed | +| googleClientId | roster | +| h5UrlConfig | rank | +| hasNext | rate | +| hash | medallion | +| hashIsZero | member | +| headFaceIndex | entry | +| headImg | terminal | +| headPos | repository | +| headType | delegate | +| hint | vote | +| hlsUrl | precision | +| host | nominee | +| icon | delay | +| id | timing | +| imageCount | bounce | +| imageFaceIndex | digest | +| imageId | registration | +| imageInfos | elastic | +| img | circular | +| imgCount | indicator | +| imgId | histogram | +| imgList | easing | +| imgType | compressive | +| imgUrl | boost | +| index | weight | +| inviteBy | socket | +| invitedCnt | pin | +| isBlur | archive | +| isVip | restore | +| issuerUrl | duplicate | +| keepUserId | campus | +| label | density | +| lang | venture | +| lastName | council | +| lastUpdateTime | follow | +| launchImgUrl | coverage | +| link | capital | +| list | ordinance | +| lowUrl | durability | +| maxLimit | like | +| method | listing | +| methodActivitys | comment | +| methodChannels | collect | +| model | exhibit | +| msg | sprint | +| name | alignment | +| needCredits | colorize | +| needImage | edge | +| needUndress | authorization | +| needopt | team | +| negativePrompt | delegation | +| note | spacing | +| openType | morph | +| optimizeCountSql | reface | +| optimizeJoinOfCountSql | voice | +| orderId | franchise | +| orders | sync | +| originAmount | brochure | +| owner | heritage | +| p12KeyPath | tally | +| packageName | accolade | +| page | session | +| pages | loop | +| password | scope | +| payCenterUrl | schedule | +| payId | depth | +| payMethod | layer | +| payMethods | cluster | +| payStatus | submit | +| payTime | channel | +| payTypeList | introspect | +| payUrl | objectify | +| paylink | segment | +| paymentMethod | ledger | +| paymentMethods | invoke | +| permissions | terminate | +| phone | sponsor | +| pkg | stakeholder | +| platform | abstract | +| previewImage | slice | +| previewVideo | anchor | +| productType | pivot | +| progress | origin | +| prompt | appointment | +| publicKey | thread | +| purchaseData | gauge | +| queueCnt | endpoint | +| read | midpoint | +| receipt | funnel | +| recent | fabricate | +| recentlyUsed | breakpoint | +| recommend | threshold | +| records | create | +| redirectUrl | reformat | +| referer | link | +| refererType | complex | +| reply | amplitude | +| replyStatus | calendar | +| requiredHeaders | tokenize | +| resolution | consortium | +| resolution480p | span | +| resolution720p | factor | +| resulotion | correctness | +| rewardCredits | sigma | +| rewardRatio | gutter | +| role | transport | +| searchCount | transmit | +| selected | adaptive | +| serviceAccountEmail | balance | +| sharedSecret | stake | +| showName | constant | +| sign | mandate | +| signature | selection | +| size | seminar | +| sort | overtone | +| srcFaceImgBase64 | tournament | +| srcFaceIndex | circuit | +| srcImg | permission | +| srcImg1 | crew | +| srcImg1Url | consulate | +| srcImg2 | lease | +| srcImg2Url | glossary | +| srcImgBase64 | dynasty | +| srcImgUrl | logbook | +| srcVideo | commendation | +| state | bitrate | +| status | wallet | +| style | module | +| subBusinessType | keepalive | +| subPaymentMethod | bundle | +| subScribeValidTime | recognize | +| subscriptionActivitys | cap | +| subscriptionPeriod | unicast | +| sumCredits | assert | +| sys | load | +| t2IConfig | reboot | +| tag | remainder | +| tags | enqueue | +| targetId | manifest | +| targetInvitedCnt | unpack | +| taskId | exponential | +| taskIds | vendor | +| taskType | liaison | +| taskTypes | synopsis | +| templateFaceUrl | quantized | +| templateFifCredits | compressed | +| templateFifDuration | usability | +| templateFifUrl | tension | +| templateName | itinerary | +| templateTfCredits | capitalization | +| templateTfDuration | demodulation | +| templateTfUrl | convergence | +| templateType | ringing | +| templateTypes | dialogue | +| templateUrl | refractive | +| templates | microscopic | +| tgId | chart | +| tgName | spend | +| tgOrderId | microservice | +| theme | capacity | +| title | interval | +| token | attachment | +| total | insert | +| totalUnreadCount | promote | +| transactionId | installation | +| truePrompt | coalition | +| ts | debit | +| type | revenue | +| types | standard | +| unreadCountList | weigh | +| updateTime | overflow | +| uploadUrl | update | +| uploadUrl1 | harden | +| uploadUrl2 | complete | +| url | altitude | +| user | resistance | +| userApplePayList | variety | +| userId | symposium | +| userInfoType | carnival | +| userName | supplement | +| userToken | disambiguate | +| userType | resample | +| username | ring | +| usign | reauthenticate | +| val | compliance | +| value | platoon | +| verifyCode | taskforce | +| videoDuration | hue | +| videoFaceIndex | escrow | +| videoFrameIndex | periodical | +| videoSize | genealogy | +| videoUrl | postprocess | +| waitTime | acuity | +| x1 | angular | +| x2 | enthalpy | +| y1 | binormal | +| y2 | manifold | + +--- + +## 错误码 + +| code | 说明 | +|------|------| +| 0 | 成功 | +| -1 | 失败 | +| -2 | 系统错误 | +| -3 | 鉴权失败 | +| -5 | 参数错误 | +| 1001 | 积分不足 | +| 1002 | 免费次数已用完 | +| 1003 | 免费次数和积分均已用完 | + +--- + +*本文档由 ProtocolEncTool 自动生成,API 变更后请重新执行 `v2 guide --app FunyMeeAI`。* diff --git a/docs/new_app_config_template.md b/docs/new_app_config_template.md new file mode 100644 index 0000000..cb38e89 --- /dev/null +++ b/docs/new_app_config_template.md @@ -0,0 +1,499 @@ +# 新应用配置模板 + +创建新应用时,请填写以下配置信息。 + +*** + +## 一、应用基本信息 + +| 配置项 | 值 | 说明 | +| ------------- | ------------------- | ------------------- | +| 应用名称 | `FunyMee AI` | 如:FunyMee AI | +| Android 包名 | `com.funymeeai.app` | 如:com.funymeeai.app | +| iOS Bundle ID | `com.funymeeai.app` | 如:com.funymeeai.app | +| 应用 ID(appId) | `com.funymeeai.app` | 后台接口参数用 | + +*** + +## 二、服务器配置 + +| 配置项 | 值 | 说明 | +| --------- | --------------------------------- | ------------------------------- | +| 预发布环境 URL | `pre-ai.funymee.space` | 如: | +| 生产环境 URL | `ai.funymee.space` | 如: | +| 代理接口路径 | `/workshop/lounge/hub/playground` | 如:/v1/proxy | + +*** + +## 三、代理请求体字段配置 + +| 配置项 | 值 | 说明 | +| ------------------- | ---------------------------------------------------------- | ----------------------------------------------------- | +| appId 明文 | `humor_level` | 如:hero\_class | +| 原始path | `comedy_style` | 如:pet\_species | +| "POST"或"GET" | `avatar_mode` | 如:power\_level | +| 映射后的Header字段名构造JSON | `filter_type` | 如:quest\_rank | +| 映射后的URL参数字段名构造JSON | `scene_id` | 如:battle\_score | +| V2包装后的业务数据 | `clip_duration` | 如:loyalty\_index | +| 噪音字段名列表 | `['sample_rate','watermark_id','geo_radius','accuracy_m']` | 如:\['billing\_addr', 'utm\_term', 'cluster\_id', ...] | + +*** + +## 四、V2 包装配置 + +| 配置项 | 值 | 说明 | +| ------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------- | +| V2 层级 | `shell` | 如:arsenal | +| V2 层级值 | `2` | 如:4 | +| V2 层级路径 | `['capsule','envelope','container']` | 如:\['vault', 'tome', 'codex', 'grimoire', 'sanctum'] | +| 噪音字段名列表 | `['shimmer','glimmer','flicker','sparkle','rustle','murmur','whisper','echo']` | 如:\['roar', 'clash', 'thunder', 'rumble', 'howl', 'growl'] | + +*** + +## 五、安全配置 + +| 配置项 | 值 | 说明 | +| ------ | ------------------ | --------------- | +| AES 密钥 | `gLYeTRc2uNTcNH8e` | 用于请求加密,必须 16 字符 | + +*** + +## 六、Adjust SDK 配置 + +| 配置项 | 值 | 说明 | +| ----------- | ------------------------ | -------------------------- | +| App Token | `chflzzr4x5hc` | Adjust Dashboard 获取 | +| Environment | `sandbox` / `production` | 测试用 sandbox,正式用 production | + +### Adjust 事件 Token(如有自定义) + +| 事件名称 | 事件 Token | +| --------- | -------- | +| 首充 | `qlw4fp` | +| 购买 | `b2ms4n` | +| 注册 | `2k7vm5` | +| $5.99 档位 | `mtzzqk` | +| $9.99 档位 | `m9ivl1` | +| $19.99 档位 | `kp7a52` | +| $49.99 档位 | `ojlx1r` | +| $99.99 档位 | `hue6dt` | + +*** + +## 七、Facebook SDK 配置 + +| 配置项 | 值 | 说明 | +| ------------ | -------------------- | ----------------------------- | +| App ID | `填写 Facebook App ID` | Facebook Developer Console 获取 | +| Client Token | `填写 Client Token` | Facebook Developer Console 获取 | + +> MethodChannel 名称:框架自动使用 `{packageName}/facebook_sdk`,无需配置 + +*** + +## 八、字段映射配置(可选) + +如有特殊字段映射需求请填写,默认使用框架默认映射。 + +| 原始字段 | V2字段 | +|----------|--------| +| User_token | comedy | +| accountId | meme | +| accountName | avatar | +| activityId | character | +| activitys | animate | +| actualAmount | sketch | +| addCredits | remix | +| adsTokenId | humor | +| age | intensity | +| amount | cartoon | +| animate | duration | +| app | sticker | +| appFbConfig | stylize | +| appType | reaction | +| appraise | render | +| approveState | clip | +| aspectRatio | caption | +| automaticRenewal | punchline | +| avatar | frequency | +| baseCredits | opacity | +| baseUrl | joke | +| begTime | gag | +| bonus | contrast | +| bonusCredits | saturation | +| bonusRatio | sharpness | +| businessId | angle | +| businessType | offset | +| campaignInfo | parody | +| card | spoof | +| categoryId | scale | +| categoryName | rotation | +| ch | satire | +| channel | skit | +| channelType | reel | +| client | filter | +| clientId | template | +| code | scene | +| coder | panel | +| config | edit | +| content | gradient | +| contentType | comic | +| count | bubble | +| countId | share | +| country | overlay | +| countryCode | publish | +| creatTime | palette | +| createTime | typography | +| createTimeText | layout | +| credit | export | +| creditPromotion | apply | +| credits | padding | +| creditsRecordUrl | swap | +| cryptoInvoiceUrl | merge | +| currency | mascot | +| current | blend | +| cvcCode | persona | +| data | costume | +| days | backdrop | +| department | resize | +| desc | kurtosis | +| description | crop | +| devId | frame | +| deviceId | stage | +| discountOff | margin | +| domain | theme | +| domains | adjust | +| dt | mood | +| duration | preview | +| email | draft | +| enable_music | vibe | +| enabled | customize | +| endTime | expression | +| event | gesture | +| expectedSize | pose | +| expireMonth | outfit | +| expireYear | trait | +| expiresIn | upload | +| ext | profile | +| extConfig | download | +| extJson | gallery | +| face | border | +| faceIndex | radius | +| faceInfos | discover | +| face_index | shadow | +| fbClientId | glow | +| fbClientToken | blur | +| feature | browse | +| features | explore | +| feedbackId | grain | +| feedbackIds | showcase | +| fileName | feed | +| fileName1 | trending | +| fileName2 | spotlight | +| filePath | search | +| filePath1 | generate | +| filePath2 | transform | +| fileUrls | texture | +| filterCountry | collection | +| filterDomain | badge | +| filterOwnerId | reward | +| filterStatus | quest | +| filterTaskType | caucus | +| filterVip | allowance | +| firstName | appendix | +| firstRegister | enhance | +| forcePayCenter | convert | +| fps | lineage | +| frameIndex | pattern | +| frame_index | motion | +| freeBlurTimes | tag | +| freeTimes | label | +| gender | speed | +| googleClientId | roster | +| h5UrlConfig | rank | +| hasNext | rate | +| hash | medallion | +| hashIsZero | member | +| headFaceIndex | entry | +| headImg | terminal | +| headPos | repository | +| headType | delegate | +| hint | vote | +| hlsUrl | precision | +| host | nominee | +| icon | delay | +| id | timing | +| imageCount | bounce | +| imageFaceIndex | digest | +| imageId | registration | +| imageInfos | elastic | +| img | circular | +| imgCount | indicator | +| imgId | histogram | +| imgList | easing | +| imgType | compressive | +| imgUrl | boost | +| index | weight | +| inviteBy | socket | +| invitedCnt | pin | +| isBlur | archive | +| isVip | restore | +| issuerUrl | duplicate | +| keepUserId | campus | +| label | density | +| lang | venture | +| lastName | council | +| lastUpdateTime | follow | +| launchImgUrl | coverage | +| link | capital | +| list | ordinance | +| lowUrl | durability | +| maxLimit | like | +| method | listing | +| methodActivitys | comment | +| methodChannels | collect | +| model | exhibit | +| msg | sprint | +| name | alignment | +| needCredits | colorize | +| needImage | edge | +| needUndress | authorization | +| needopt | team | +| negativePrompt | delegation | +| note | spacing | +| openType | morph | +| optimizeCountSql | reface | +| optimizeJoinOfCountSql | voice | +| orderId | franchise | +| orders | sync | +| originAmount | brochure | +| owner | heritage | +| p12KeyPath | tally | +| packageName | accolade | +| page | session | +| pages | loop | +| password | scope | +| payCenterUrl | schedule | +| payId | depth | +| payMethod | layer | +| payMethods | cluster | +| payStatus | submit | +| payTime | channel | +| payTypeList | introspect | +| payUrl | objectify | +| paylink | segment | +| paymentMethod | ledger | +| paymentMethods | invoke | +| permissions | terminate | +| phone | sponsor | +| pkg | stakeholder | +| platform | abstract | +| previewImage | slice | +| previewVideo | anchor | +| productType | pivot | +| progress | origin | +| prompt | appointment | +| publicKey | thread | +| purchaseData | gauge | +| queueCnt | endpoint | +| read | midpoint | +| receipt | funnel | +| recent | fabricate | +| recentlyUsed | breakpoint | +| recommend | threshold | +| records | create | +| redirectUrl | reformat | +| referer | link | +| refererType | complex | +| reply | amplitude | +| replyStatus | calendar | +| requiredHeaders | tokenize | +| resolution | consortium | +| resolution480p | span | +| resolution720p | factor | +| resulotion | correctness | +| rewardCredits | sigma | +| rewardRatio | gutter | +| role | transport | +| searchCount | transmit | +| selected | adaptive | +| serviceAccountEmail | balance | +| sharedSecret | stake | +| showName | constant | +| sign | mandate | +| signature | selection | +| size | seminar | +| sort | overtone | +| srcFaceImgBase64 | tournament | +| srcFaceIndex | circuit | +| srcImg | permission | +| srcImg1 | crew | +| srcImg1Url | consulate | +| srcImg2 | lease | +| srcImg2Url | glossary | +| srcImgBase64 | dynasty | +| srcImgUrl | logbook | +| srcVideo | commendation | +| state | bitrate | +| status | wallet | +| style | module | +| subBusinessType | keepalive | +| subPaymentMethod | bundle | +| subScribeValidTime | recognize | +| subscriptionActivitys | cap | +| subscriptionPeriod | unicast | +| sumCredits | assert | +| sys | load | +| t2IConfig | reboot | +| tag | remainder | +| tags | enqueue | +| targetId | manifest | +| targetInvitedCnt | unpack | +| taskId | exponential | +| taskIds | vendor | +| taskType | liaison | +| taskTypes | synopsis | +| templateFaceUrl | quantized | +| templateFifCredits | compressed | +| templateFifDuration | usability | +| templateFifUrl | tension | +| templateName | itinerary | +| templateTfCredits | capitalization | +| templateTfDuration | demodulation | +| templateTfUrl | convergence | +| templateType | ringing | +| templateTypes | dialogue | +| templateUrl | refractive | +| templates | microscopic | +| tgId | chart | +| tgName | spend | +| tgOrderId | microservice | +| theme | capacity | +| title | interval | +| token | attachment | +| total | insert | +| totalUnreadCount | promote | +| transactionId | installation | +| truePrompt | coalition | +| ts | debit | +| type | revenue | +| types | standard | +| unreadCountList | weigh | +| updateTime | overflow | +| uploadUrl | update | +| uploadUrl1 | harden | +| uploadUrl2 | complete | +| url | altitude | +| user | resistance | +| userApplePayList | variety | +| userId | symposium | +| userInfoType | carnival | +| userName | supplement | +| userToken | disambiguate | +| userType | resample | +| username | ring | +| usign | reauthenticate | +| val | compliance | +| value | platoon | +| verifyCode | taskforce | +| videoDuration | hue | +| videoFaceIndex | escrow | +| videoFrameIndex | periodical | +| videoSize | genealogy | +| videoUrl | postprocess | +| waitTime | acuity | +| x1 | angular | +| x2 | enthalpy | +| y1 | binormal | +| y2 | manifold | + +*** + +## 九、其他配置(如有) + +| 配置项 | 值 | 说明 | +| ----------- | ----------- | ---------- | +| 调试基础 URL 覆盖 | `填写调试用 URL` | 仅调试时使用,可留空 | +|
|
|
| + +*** + +## 十、填写完成后的配置示例 + +```dart +// app_config.dart +class NewAppConfig extends AppConfig { + @override + String get appId => 'your_app_id'; + + @override + String get packageName => 'com.example.app'; + + @override + String get aesKey => 'your_32_characters_key_here'; + + @override + String get preBaseUrl => 'https://pre-api.example.com'; + + @override + String get prodBaseUrl => 'https://api.example.com'; + + @override + String get proxyPath => '/v1/proxy'; + + @override + ProxyKeysConfig get proxyKeys => const ProxyKeysConfig( + appIdField: 'hero_class', + pathField: 'pet_species', + methodField: 'power_level', + headerField: 'quest_rank', + paramsField: 'battle_score', + bodyField: 'loyalty_index', + noiseKeys: ['billing_addr', 'utm_term', 'cluster_id', 'lsn_value', 'accuracy_val', 'dir_path'], + ); + + @override + String get v2LevelField => 'arsenal'; + + @override + int get v2LevelFixedValue => 4; + + @override + List get v2SanctumPath => + const ['vault', 'tome', 'codex', 'grimoire', 'sanctum']; + + @override + List get v2NoiseKeys => + const ['roar', 'clash', 'thunder', 'rumble', 'howl', 'growl']; + + @override + FieldMapping get fieldMapping => _appFieldMapping; + + /// 从上方「字段映射配置」表格中获取完整映射 + /// ⚠️ 请务必将表格中的所有映射键值对复制到此处 + static final _appFieldMapping = FieldMapping({ + // 请将「八、字段映射配置」表格中的所有字段复制到此处 + // 格式: '原始字段': 'V2字段', + // 例如: 'User_token': 'comedy', + }); +} + +// main.dart +await AnalyticsService.init( + AnalyticsConfig( + packageName: 'com.example.app', + adjustConfig: AdjustConfig( + appToken: 'your_adjust_app_token', + environment: AdjustEnv.sandbox, + ), + facebookConfig: FacebookConfig( + appId: 'your_facebook_app_id', + clientToken: 'your_facebook_client_token', + ), + ), +); +``` + +*** + +**填写完成后发送给我,我将根据此配置创建完整的应用代码。** diff --git a/docs/skin_app_development_guide.md b/docs/skin_app_development_guide.md new file mode 100644 index 0000000..5c5fc15 --- /dev/null +++ b/docs/skin_app_development_guide.md @@ -0,0 +1,869 @@ +# 换皮应用开发完整流程指南 + +本文档说明如何使用 `client_proxy_framework` 从零创建并完成一个换皮应用。 + +*** + +> **重要说明**:本指南**仅完成数据框架的对接**,包括: +> +> - API 请求封装与字段映射 +> - 第三方 SDK(Adjust、Facebook、Google Play)集成 +> - 用户认证与归因追踪 +> +> **UI 组件需要另行对接**,包括: +> +> - 首页、生成页、个人中心等业务页面 +> - 主题配色、字体、图标等 UI 样式 +> - 业务组件和交互逻辑 +> +> 详见本文档最后一章 [后续开发指引](#后续开发指引)。 + +*** + +## 目录 + +1. [准备阶段:创建项目目录](#1-准备阶段创建项目目录) +2. [填写配置模板](#2-填写配置模板) +3. [创建 Flutter 项目](#3-创建-flutter-项目) +4. [集成框架](#4-集成框架) +5. [配置应用信息](#5-配置应用信息) +6. [配置第三方-sdk](#6-配置第三方-sdk) +7. [实现业务代码](#7-实现业务代码) +8. [调试与测试](#8-调试与测试) +9. [上线准备](#9-上线准备) +10. [后续开发指引](#10-后续开发指引) + +*** + +## 1. 准备阶段:创建项目目录 + +### 1.1 创建项目目录 + +在合适的位置创建项目目录: + +```bash +# 请将 your_app_name 替换为实际的应用名称 +mkdir your_app_name +cd your_app_name +``` + +### 1.2 复制配置模板 + +从框架目录复制配置模板到项目的 `docs` 目录下: + +```bash +mkdir docs +cp ../client_proxy_framework/docs/new_app_config_template.md docs/ +cp ../client_proxy_framework/docs/sdk_integration_guide.md docs/ +``` + +复制后的目录结构: + +``` +your_app_name/ +├── docs/ +│ ├── new_app_config_template.md # 应用配置模板 +│ └── sdk_integration_guide.md # SDK 集成指南 +└── ... +``` + +### 1.3 打开配置模板 + +使用编辑器打开配置模板文件: + +```bash +# 使用 VSCode +code docs/new_app_config_template.md + +# 或使用其他编辑器 +open docs/new_app_config_template.md +``` + +### 1.4 下一步 + +> **请先完成配置模板的填写**,再继续执行后续步骤。 +> +> 配置模板包含以下信息: +> - 应用基本信息(appId、packageName、AES 密钥等) +> - Adjust 配置(App Token、Event Tokens) +> - Facebook 配置(App ID、Client Token) +> - Google Play 配置(商品 ID) + +填写完成后,继续执行第 3 步。 + +*** + +## 2. 填写配置模板 + +请参考 `docs/new_app_config_template.md` 文件,填写以下配置信息: + +### 2.1 应用基本信息 + +| 配置项 | 占位符 | 填写值 | +|-------|-------|-------| +| 应用名称 | `填写应用名称` | | +| Android 包名 | `填写 Android 包名` | | +| iOS Bundle ID | `填写 iOS Bundle ID` | | +| 应用 ID(appId) | `填写 appId` | | + +### 2.2 服务器配置 + +| 配置项 | 占位符 | 填写值 | +|-------|-------|-------| +| 预发布环境 URL | `填写预发布环境 URL` | | +| 生产环境 URL | `填写生产环境 URL` | | +| 代理接口路径 | `填写代理接口路径` | | + +### 2.3 Adjust SDK 配置 + +| 配置项 | 占位符 | 填写值 | +|-------|-------|-------| +| App Token | `填写 Adjust App Token` | | +| Environment | `sandbox` / `production` | | + +### 2.4 Facebook SDK 配置 + +| 配置项 | 占位符 | 填写值 | +|-------|-------|-------| +| App ID | `填写 Facebook App ID` | | +| Client Token | `填写 Client Token` | | + +### 2.5 AES 密钥 + +| 配置项 | 占位符 | 填写值 | +|-------|-------|-------| +| AES 密钥 | `填写 16 字符 AES-128 密钥` | | + +> 框架使用 AES-128-ECB 模式,密钥固定为 16 字符。 + +### 2.6 下一步 + +> **配置填写完成后,继续执行第 3 步。** +> +> 如果配置复杂或有任何疑问,请将填写好的配置发送给我进行确认。 + +*** + +## 3. 创建 Flutter 项目 + +### 3.1 在项目目录下执行 + +确保你在之前创建的项目目录下执行: + +```bash +# 如果不在项目目录下,先进入 +cd your_app_name +``` + +### 3.2 创建 Flutter 项目 + +```bash +# 请将 com.yourcompany 替换为你的组织包名 +flutter create --org com.yourcompany your_app_name +cd your_app_name +``` + +### 3.3 复制配置模板到项目 + +```bash +mkdir docs +cp ../client_proxy_framework/docs/new_app_config_template.md docs/ +cp ../client_proxy_framework/docs/sdk_integration_guide.md docs/ +``` + +### 3.4 下一步 + +> 继续执行 [第 4 步:集成框架](#4-集成框架) + +*** + +## 4. 集成框架 + +### 4.1 添加依赖 + +编辑 `pubspec.yaml`: + +```yaml +dependencies: + flutter: + sdk: flutter + + # 框架依赖 + client_proxy_framework: + path: ../client_proxy_framework # 或使用 pub 发布的版本 + + # 框架需要的额外依赖 + http: ^1.2.2 + encrypt: ^5.0.3 + crypto: ^3.0.3 + logger: ^2.0.2 + shared_preferences: ^2.2.2 + device_info_plus: ^11.1.0 +``` + +### 4.2 目录结构 + +建议按以下结构组织代码: + +``` +lib/ +├── main.dart # 入口文件 +├── app.dart # MaterialApp +├── core/ +│ ├── config/ +│ │ └── app_config.dart # 应用配置类 +│ ├── auth/ +│ │ └── auth_service.dart # 认证服务实现 +│ ├── user/ +│ │ └── user_state.dart # 用户状态管理 +│ └── theme/ +│ ├── app_colors.dart # 主题配色 +│ ├── app_typography.dart # 字体样式 +│ └── app_spacing.dart # 间距常量 +├── features/ +│ ├── home/ # 首页模块 +│ ├── create/ # 生成页模块 +│ ├── profile/ # 个人中心模块 +│ └── recharge/ # 充值页模块 +└── shared/ + ├── tab_selector_scope.dart # Tab 导航作用域 + └── widgets/ # 共享组件 +``` + +*** + +## 5. 配置应用信息 + +### 5.1 创建应用配置类 + +创建 `lib/core/config/app_config.dart`: + +```dart +import 'package:client_proxy_framework/client_proxy_framework.dart'; + +class YourAppConfig implements AppConfig { + @override + String get appId => 'your_app_id'; + + @override + String get packageName => 'com.yourcompany.yourapp'; + + @override + String get aesKey => 'your_16_char_key'; // AES-128 需要 16 字符 + + @override + String get preBaseUrl => 'https://pre-api.example.com'; + + @override + String get prodBaseUrl => 'https://api.example.com'; + + @override + String get proxyPath => '/v1/proxy'; + + @override + FieldMapping? get fieldMapping => DefaultFieldMapping.instance; +} +``` + +### 5.2 创建用户状态管理 + +创建 `lib/core/user/user_state.dart`: + +```dart +import 'package:flutter/foundation.dart'; + +class UserState { + static String? _userId; + static int _credits = 0; + static String? _avatar; + static String? _userName; + static String? _countryCode; + + static String? get userId => _userId; + static int get credits => _credits; + static String? get avatar => _avatar; + static String? get userName => _userName; + static String? get countryCode => _countryCode; + + static void setUserId(String id) => _userId = id; + static void setCredits(int credits) => _credits = credits; + static void setAvatar(String avatar) => _avatar = avatar; + static void setUserName(String name) => _userName = name; + static void setCountryCode(String code) => _countryCode = code; +} +``` + +*** + +## 6. 配置第三方 SDK + +### 6.1 填写配置信息 + +参考 [SDK 集成配置指南](sdk_integration_guide.md),获取并填写以下信息: + +| SDK | 必需信息 | +| ----------- | ---------------------- | +| Adjust | App Token, Environment | +| Facebook | App ID, Client Token | +| Google Play | 无(商品 ID 从后端获取) | + +### 6.2 Android 配置 + +#### 6.2.1 创建 strings.xml + +创建 `android/app/src/main/res/values/strings.xml`: + +```xml + + your_facebook_app_id + your_facebook_client_token + +``` + +#### 6.2.2 更新 AndroidManifest.xml + +在 `` 标签之前添加: + +```xml + + + + + + + +``` + +#### 6.2.3 创建 Application 类 + +创建 `android/app/src/main/kotlin/com/yourcompany/yourapp/App.kt`: + +```kotlin +package com.yourcompany.yourapp + +import android.app.Application +import android.os.Handler +import android.os.Looper +import com.facebook.FacebookSdk +import com.facebook.LoggingBehavior +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.embedding.engine.FlutterEngineCache +import io.flutter.plugin.common.MethodChannel + +class App : Application() { + companion object { + const val CHANNEL = "com.yourcompany.yourapp/facebook_sdk" + const val ENGINE_ID = "main" + } + + override fun onCreate() { + super.onCreate() + + FacebookSdk.sdkInitialize(this) + FacebookSdk.setIsDebugEnabled(true) + FacebookSdk.addLoggingBehavior(LoggingBehavior.APP_EVENTS) + + Handler(Looper.getMainLooper()).postDelayed({ + val engine = FlutterEngineCache.getInstance().get(ENGINE_ID) + if (engine != null) { + MethodChannel(engine.dartExecutor.binaryMessenger, CHANNEL) + .invokeMethod("onFacebookSdkInitialized", null) + } + }, 100) + } +} +``` + +#### 6.2.4 创建 MainActivity + +创建 `android/app/src/main/kotlin/com/yourcompany/yourapp/MainActivity.kt`: + +```kotlin +package com.yourcompany.yourapp + +import android.os.Handler +import android.os.Looper +import com.facebook.appevents.AppEventsLogger +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.embedding.engine.FlutterEngineCache +import io.flutter.plugin.common.MethodChannel + +class MainActivity : FlutterActivity() { + companion object { + const val CHANNEL = "com.yourcompany.yourapp/facebook_sdk" + const val ENGINE_ID = "main" + } + + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + + AppEventsLogger.activateApp(application) + + MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) + .setMethodCallHandler { call, result -> + when (call.method) { + "waitForFacebookSdkInit" -> { + AppEventsLogger.activateApp(application) + result.success(true) // 必须调用 result.success() 否则 Dart 端会卡住 + } + "onFacebookSdkInitialized" -> { + result.success(true) + } + else -> { + result.notImplemented() + } + } + } + + Handler(Looper.getMainLooper()).postDelayed({ + FlutterEngineCache.getInstance().put(ENGINE_ID, flutterEngine) + }, 100) + } +} +``` + +> **注意**:`result.success()` 必须被调用,否则 Dart 端的 `await` 会一直等待响应,导致应用卡住。 + +#### 6.2.5 更新 AndroidManifest.xml 使用 Application + +```xml + +``` + +### 6.3 iOS 配置 + +#### 6.3.1 更新 Info.plist + +在 `ios/Runner/Info.plist` 中添加: + +```xml +AdjustAppToken +your_adjust_app_token +AdjustEnvironment +sandbox + +FacebookAppID +your_facebook_app_id +FacebookClientToken +your_facebook_client_token +FacebookDisplayName +Your App Name +``` + +*** + +## 7. 实现业务代码 + +### 7.1 创建认证服务实现 + +创建 `lib/core/auth/auth_service.dart`: + +```dart +import 'dart:convert'; +import 'package:client_proxy_framework/client_proxy_framework.dart'; +import 'package:crypto/crypto.dart'; +import 'package:device_info_plus/device_info_plus.dart'; +import 'package:flutter/foundation.dart'; + +import '../user/user_state.dart'; + +/// 归因回调实现 +class AppAttributionCallbacks implements AttributionCallbacks { + @override + Future getReferrer() async { + final attribution = AnalyticsService.getAttribution(); + if (attribution != null) { + return _attributionToJson(attribution); + } + return ''; + } + + String _attributionToJson(AttributionData data) { + final map = { + 'trackerToken': data.trackerToken, + 'trackerName': data.trackerName, + 'network': data.network, + 'campaign': data.campaign, + 'adgroup': data.adgroup, + 'creative': data.creative, + 'clickLabel': data.clickLabel, + 'costType': data.costType, + 'costAmount': _jsonEncodableCostAmount(data.costAmount), + 'costCurrency': data.costCurrency, + 'jsonResponse': data.jsonResponse, + 'fbInstallReferrer': data.fbInstallReferrer, + }; + return base64Encode(utf8.encode(jsonEncode(map))); + } + + Object? _jsonEncodableCostAmount(double? v) { + if (v == null) return null; + if (v.isNaN || !v.isFinite) return v.toString(); + return v; + } + + @override + Future getAdjustReferrer() async => getReferrer(); + + @override + Future getPlatformReferrer() async => null; +} + +/// 认证回调实现 +class AppAuthCallbacks implements AuthServiceCallbacks { + @override + Future getDeviceId() async { + final deviceInfo = DeviceInfoPlugin(); + switch (defaultTargetPlatform) { + case TargetPlatform.android: + final android = await deviceInfo.androidInfo; + return android.id; + case TargetPlatform.iOS: + final ios = await deviceInfo.iosInfo; + return ios.identifierForVendor ?? 'ios-unknown'; + default: + return 'device-${DateTime.now().millisecondsSinceEpoch}'; + } + } + + @override + String computeSign(String deviceId) { + return md5.convert(utf8.encode(deviceId)).toString().toUpperCase(); + } + + @override + void onLoginSuccess(FastLoginResponse data) { + if (data.userId != null) UserState.setUserId(data.userId!); + if (data.credits != null) UserState.setCredits(data.credits!); + if (data.avatar != null) UserState.setAvatar(data.avatar!); + if (data.userName != null) UserState.setUserName(data.userName!); + } + + @override + void onCommonInfoLoaded(CommonInfoResponse data) { + if (data.credits != null) UserState.setCredits(data.credits!); + if (data.avatar != null) UserState.setAvatar(data.avatar!); + if (data.userName != null) UserState.setUserName(data.userName!); + } + + @override + void onLoginFailed(String msg) { + debugPrint('[AuthService] Login failed: $msg'); + } +} + +/// 认证服务 +class AuthService { + static final _authCallbacks = AppAuthCallbacks(); + static final _attributionCallbacks = AppAttributionCallbacks(); + + static Future init() async { + AttributionService.init(_attributionCallbacks); + FrameworkAuthService.init(_authCallbacks); + await FrameworkAuthService.start(); + } + + static Future get loginComplete => FrameworkAuthService.loginComplete; +} +``` + +### 7.2 创建 main.dart + +创建 `lib/main.dart`: + +```dart +import 'package:flutter/material.dart'; +import 'package:client_proxy_framework/client_proxy_framework.dart'; + +import 'app.dart'; +import 'core/auth/auth_service.dart'; +import 'core/config/app_config.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + + // 1. 初始化 API 客户端 + ApiClient.init(YourAppConfig()); + + // 2. 初始化分析服务 + await AnalyticsService.init( + AnalyticsConfig( + packageName: 'com.yourcompany.yourapp', // 包名,MethodChannel 使用 + adjustConfig: AdjustConfig( + appToken: 'your_adjust_app_token', + environment: AdjustEnv.sandbox, // 上线改为 production + ), + facebookConfig: FacebookConfig( + appId: 'your_facebook_app_id', + clientToken: 'your_facebook_client_token', + ), + ), + ); + + // 3. 提前获取归因 + await AnalyticsService.initAttribution(); + + // 4. 启动应用 + runApp(const App()); + + // 5. 初始化认证 + AuthService.init(); +} +``` + +### 7.3 创建 App 组件 + +创建 `lib/app.dart`: + +```dart +import 'package:flutter/material.dart'; + +import 'home_screen.dart'; + +class App extends StatelessWidget { + const App({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Your App Name', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), + useMaterial3: true, + ), + home: const HomeScreen(), + ); + } +} +``` + +*** + +## 8. 调试与测试 + +### 8.1 运行调试版本 + +```bash +flutter run +``` + +### 8.2 检查日志 + +运行时应看到以下日志: + +``` +D/Adjust (xxxxx): Adjust SDK started +I/flutter (xxxxx): [AuthService] start: deviceId=xxx +I/flutter (xxxxx): Facebook App Events initialized (from native callback) +``` + +### 8.3 常见问题排查 + +| 问题 | 解决方案 | +| --------------------------------- | ---------------------------------------- | +| Adjust 日志显示 "SANDBOX" | 正常,测试环境会显示 | +| Facebook 报错 "must be initialized" | 检查 AndroidManifest.xml 和 Application 类配置 | +| 归因未上报 | 检查 initAttribution() 是否在 main() 中调用 | + +*** + +## 9. 上线准备 + +### 9.1 修改环境配置 + +#### main.dart + +```dart +// Adjust 改为 production +adjustConfig: AdjustConfig( + appToken: 'your_production_app_token', + environment: AdjustEnv.production, // 修改这里 +), + +// Facebook 关闭调试日志 +facebookConfig: FacebookConfig( + appId: 'your_facebook_app_id', + clientToken: 'your_facebook_client_token', + debugLogs: false, // 关闭调试日志 +), +``` + +#### Android + +```xml + + +``` + +#### iOS + +```xml + +AdjustEnvironment +production +``` + +### 9.2 构建发布版本 + +```bash +# Android +flutter build apk --release +flutter build appbundle --release + +# iOS +flutter build ios --release +``` + +### 9.3 检查清单 + +- [ ] Adjust App Token 已替换为生产环境 +- [ ] Adjust Environment 已改为 production +- [ ] Facebook 调试日志已关闭 +- [ ] Facebook Client Token 已更新(生产环境) +- [ ] 应用名称和包名正确 +- [ ] 所有第三方 SDK 配置完成 + +*** + +## 附录:框架 API 快速参考 + +### 分析服务 + +```dart +// 初始化 +await AnalyticsService.init(config); + +// 埋点 +AnalyticsService.trackEvent('event_token'); +AnalyticsService.trackPurchase(amount: 9.99, currency: 'USD'); +AnalyticsService.trackRegister(); +AnalyticsService.trackSubscribe('monthly_vip'); + +// 获取归因 +final attribution = AnalyticsService.getAttribution(); +``` + +### 认证服务 + +```dart +// 获取登录完成状态 +await AuthService.loginComplete; + +// 发起登录 +await AuthService.init(); +``` + +### API 请求 + +```dart +// 获取代理客户端 +final proxy = ApiClient.instance.proxy; + +// GET 请求 +final res = await proxy.request( + path: '/v1/endpoint', + method: 'GET', +); + +// POST 请求 +final res = await proxy.request( + path: '/v1/endpoint', + method: 'POST', + body: {'key': 'value'}, +); + +// 请求带字段映射的实体 +final res = await proxy.requestEntity( + path: '/v1/entity', + method: 'GET', + entityFactory: YourEntity.fromJson, +); +``` + +*** + +## 10. 后续开发指引 + +完成本指南后,数据框架已就绪。接下来需要开发 **UI 业务层**: + +### 10.1 框架提供的 API 服务 + +| 服务类 | 用途 | +| ------------- | ------------- | +| `ImageApi` | 图片/视频生成相关 API | +| `PaymentApi` | 支付相关 API | +| `FeedbackApi` | 举报/反馈相关 API | +| `UserApi` | 用户账户相关 API | + +### 10.2 框架提供的实体类 + +参考 `client_proxy_framework/lib/src/entities/` 目录: + +| 实体类 | 用途 | +| ------------------ | ------------ | +| `UserEntities` | 用户、登录、通用信息响应 | +| `ImageEntities` | 分类、任务、生成结果 | +| `PaymentEntities` | 商品、订单、支付结果 | +| `FeedbackEntities` | 举报反馈相关 | + +### 10.3 典型的 UI 开发流程 + +```dart +// 1. 在业务页面中使用框架 API +class HomeScreen extends StatefulWidget { + @override + void initState() { + super.initState(); + _loadData(); + } + + Future _loadData() async { + // 等待登录完成(如果需要) + await AuthService.loginComplete; + + // 调用框架 API 获取数据 + final res = await ImageApi.getCategoryList(); + if (res.isSuccess) { + // 处理数据... + } + } +} + +// 2. 使用 UserState 管理状态 +UserState.setCredits(credits); +UserState.setUserId(userId); + +// 3. 调用分析服务埋点 +AnalyticsService.trackPurchase(amount: 9.99, currency: 'USD'); +AnalyticsService.trackEvent('your_event_token'); +``` + +### 10.4 建议的 UI 开发顺序 + +1. **首页(HomeScreen)** - 展示分类和任务卡片 +2. **生成页(CreateScreen)** - 创建生成任务 +3. **个人中心(ProfileScreen)** - 用户信息和设置 +4. **充值页(RechargeScreen)** - 内购支付流程 + +### 10.5 参考实现 + +参考 `app_client_1` 项目中的 UI 实现: + +- `lib/features/home/home_screen.dart` - 首页实现 +- `lib/shared/widgets/` - 共享组件(按钮、卡片等) +- `lib/core/theme/` - 主题配置 + diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..391a902 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..620e46e --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..bc021ce --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,620 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..e3773d4 --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..c30b367 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,16 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..3e0763f --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,80 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Funymee Ai + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + funymee_ai + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + AdjustAppToken + chflzzr4x5hc + AdjustEnvironment + sandbox + FacebookAppID + TODO: Add Facebook App ID + FacebookClientToken + TODO: Add Facebook Client Token + FacebookDisplayName + FunyMee AI + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/Runner/SceneDelegate.swift b/ios/Runner/SceneDelegate.swift new file mode 100644 index 0000000..b9ce8ea --- /dev/null +++ b/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/app.dart b/lib/app.dart new file mode 100644 index 0000000..501e92c --- /dev/null +++ b/lib/app.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +import 'core/theme/app_colors.dart'; + +class App extends StatelessWidget { + const App({super.key, required this.title}); + + final String title; + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: title, + debugShowCheckedModeBanner: false, + theme: ThemeData( + colorScheme: ColorScheme.fromSeed( + seedColor: AppColors.primary, + brightness: Brightness.dark, + ), + useMaterial3: true, + scaffoldBackgroundColor: AppColors.background, + ), + home: Scaffold(body: Center(child: Text(title))), + ); + } +} diff --git a/lib/core/auth/auth_service.dart b/lib/core/auth/auth_service.dart new file mode 100644 index 0000000..875a86f --- /dev/null +++ b/lib/core/auth/auth_service.dart @@ -0,0 +1,62 @@ +import 'dart:convert'; + +import 'package:client_proxy_framework/client_proxy_framework.dart'; +import 'package:crypto/crypto.dart' show md5; +import 'package:device_info_plus/device_info_plus.dart'; +import 'package:flutter/foundation.dart'; + +import '../user/user_state.dart'; + +class AppAuthCallbacks implements AuthServiceCallbacks { + @override + Future getDeviceId() async { + final deviceInfo = DeviceInfoPlugin(); + switch (defaultTargetPlatform) { + case TargetPlatform.android: + final android = await deviceInfo.androidInfo; + return android.id; + case TargetPlatform.iOS: + final ios = await deviceInfo.iosInfo; + return ios.identifierForVendor ?? 'ios-unknown'; + default: + return 'device-${DateTime.now().millisecondsSinceEpoch}'; + } + } + + @override + String computeSign(String deviceId) { + return md5.convert(utf8.encode(deviceId)).toString().toUpperCase(); + } + + @override + void onLoginSuccess(FastLoginResponse data) { + if (data.userId != null) UserState.setUserId(data.userId!); + if (data.credits != null) UserState.setCredits(data.credits!); + if (data.avatar != null) UserState.setAvatar(data.avatar!); + if (data.userName != null) UserState.setUserName(data.userName!); + } + + @override + void onCommonInfoLoaded(CommonInfoResponse data) { + if (data.credits != null) UserState.setCredits(data.credits!); + if (data.avatar != null) UserState.setAvatar(data.avatar!); + if (data.userName != null) UserState.setUserName(data.userName!); + } + + @override + void onLoginFailed(String msg) { + debugPrint('[AuthService] Login failed: $msg'); + } +} + +/// 应用侧登录封装;Adjust 归因桥已由框架 [FrameworkAuthService.init] 默认注册。 +class AuthService { + static final _authCallbacks = AppAuthCallbacks(); + + static Future init() async { + FrameworkAuthService.init(_authCallbacks); + await FrameworkAuthService.start(); + } + + static Future get loginComplete => FrameworkAuthService.loginComplete; +} diff --git a/lib/core/theme/app_colors.dart b/lib/core/theme/app_colors.dart new file mode 100644 index 0000000..51dc632 --- /dev/null +++ b/lib/core/theme/app_colors.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class AppColors { + static const Color primary = Color(0xFF6366F1); + static const Color secondary = Color(0xFF8B5CF6); + static const Color background = Color(0xFF0F0F23); + static const Color surface = Color(0xFF1A1A2E); + static const Color error = Color(0xFFEF4444); + static const Color onPrimary = Colors.white; + static const Color onBackground = Colors.white; + static const Color onSurface = Colors.white; +} diff --git a/lib/core/user/user_state.dart b/lib/core/user/user_state.dart new file mode 100644 index 0000000..4573210 --- /dev/null +++ b/lib/core/user/user_state.dart @@ -0,0 +1,19 @@ +class UserState { + static String? _userId; + static int _credits = 0; + static String? _avatar; + static String? _userName; + static String? _countryCode; + + static String? get userId => _userId; + static int get credits => _credits; + static String? get avatar => _avatar; + static String? get userName => _userName; + static String? get countryCode => _countryCode; + + static void setUserId(String id) => _userId = id; + static void setCredits(int credits) => _credits = credits; + static void setAvatar(String avatar) => _avatar = avatar; + static void setUserName(String name) => _userName = name; + static void setCountryCode(String code) => _countryCode = code; +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..9d9d3fb --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:client_proxy_framework/client_proxy_framework.dart'; + +import 'app.dart'; +import 'core/auth/auth_service.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + + await ClientBootstrap.initFromAsset('assets/skin_config.json'); + await ClientBootstrap.initAnalytics(); + await AnalyticsService.initAttribution(); + + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + statusBarIconBrightness: Brightness.light, + ), + ); + + runApp(App(title: ClientBootstrap.skin.appName)); + AuthService.init(); +} diff --git a/linux/.gitignore b/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt new file mode 100644 index 0000000..e81a33f --- /dev/null +++ b/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "funymee_ai") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.funymeeai.funymee_ai") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/linux/flutter/CMakeLists.txt b/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..d5bd016 --- /dev/null +++ b/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..e71a16d --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..2e1de87 --- /dev/null +++ b/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/linux/runner/CMakeLists.txt b/linux/runner/CMakeLists.txt new file mode 100644 index 0000000..e97dabc --- /dev/null +++ b/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/linux/runner/main.cc b/linux/runner/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/linux/runner/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc new file mode 100644 index 0000000..6ad27ae --- /dev/null +++ b/linux/runner/my_application.cc @@ -0,0 +1,148 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "funymee_ai"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "funymee_ai"); + } + + gtk_window_set_default_size(window, 1280, 720); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); +} diff --git a/linux/runner/my_application.h b/linux/runner/my_application.h new file mode 100644 index 0000000..db16367 --- /dev/null +++ b/linux/runner/my_application.h @@ -0,0 +1,21 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..26ca44d --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,16 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import device_info_plus +import in_app_purchase_storekit +import shared_preferences_foundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) + InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) +} diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..ff5ddb3 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3bf6f86 --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* funymee_ai.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "funymee_ai.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* funymee_ai.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* funymee_ai.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/funymee_ai.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/funymee_ai"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/funymee_ai.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/funymee_ai"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/funymee_ai.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/funymee_ai"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..13d141a --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..b3c1761 --- /dev/null +++ b/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..3862283 --- /dev/null +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = funymee_ai + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.funymeeai.funymeeAi + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2026 com.funymeeai. All rights reserved. diff --git a/macos/Runner/Configs/Debug.xcconfig b/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Release.xcconfig b/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Warnings.xcconfig b/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..dddb8a3 --- /dev/null +++ b/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..ffdbd80 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,537 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + adjust_sdk: + dependency: transitive + description: + name: adjust_sdk + sha256: "62408962d8b01e0631f4d83ca7300fa43ea7d3b95ad9784fe7a8477e016987e1" + url: "https://pub.dev" + source: hosted + version: "5.5.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" + url: "https://pub.dev" + source: hosted + version: "1.6.5" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + url: "https://pub.dev" + source: hosted + version: "1.4.1" + client_proxy_framework: + dependency: "direct main" + description: + path: "../client_proxy_framework" + relative: true + source: path + version: "1.0.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: "direct main" + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" + url: "https://pub.dev" + source: hosted + version: "1.0.9" + device_info_plus: + dependency: "direct main" + description: + name: device_info_plus + sha256: "98f28b42168cc509abc92f88518882fd58061ea372d7999aecc424345c7bff6a" + url: "https://pub.dev" + source: hosted + version: "11.5.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f + url: "https://pub.dev" + source: hosted + version: "7.0.3" + encrypt: + dependency: "direct main" + description: + name: encrypt + sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + facebook_app_events: + dependency: transitive + description: + name: facebook_app_events + sha256: "0e183947c222e153ab70b9d93c08da18800c73019b9455f86bf2a0bfff30d51e" + url: "https://pub.dev" + source: hosted + version: "0.26.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: "direct main" + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + in_app_purchase: + dependency: transitive + description: + name: in_app_purchase + sha256: "5cddd7f463f3bddb1d37a72b95066e840d5822d66291331d7f8f05ce32c24b6c" + url: "https://pub.dev" + source: hosted + version: "3.2.3" + in_app_purchase_android: + dependency: transitive + description: + name: in_app_purchase_android + sha256: "4890db70fbbc53ed3967409e9a496da68e7decdc2092794272595f6ae9bd0fb7" + url: "https://pub.dev" + source: hosted + version: "0.4.0+9" + in_app_purchase_platform_interface: + dependency: transitive + description: + name: in_app_purchase_platform_interface + sha256: "1d353d38251da5b9fea6635c0ebfc6bb17a2d28d0e86ea5e083bf64244f1fb4c" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + in_app_purchase_storekit: + dependency: transitive + description: + name: in_app_purchase_storekit + sha256: "1d512809edd9f12ff88fce4596a13a18134e2499013f4d6a8894b04699363c93" + url: "https://pub.dev" + source: hosted + version: "0.4.8+1" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: cb09e7dac6210041fad964ed7fbee004f14258b4eca4040f72d1234062ace4c8 + url: "https://pub.dev" + source: hosted + version: "4.11.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + logger: + dependency: "direct main" + description: + name: logger + sha256: "25aee487596a6257655a1e091ec2ae66bc30e7af663592cc3a27e6591e05035c" + url: "https://pub.dev" + source: hosted + version: "2.7.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + url: "https://pub.dev" + source: hosted + version: "0.12.19" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" + url: "https://pub.dev" + source: hosted + version: "0.13.0" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + play_install_referrer: + dependency: transitive + description: + name: play_install_referrer + sha256: "7dd808236d35d15199d5e7a5b55488e4343c1b67c4694902d6b95196b22b19cd" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.dev" + source: hosted + version: "3.9.1" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "8c04d0a35c2f61414655fbb2b85bb2e1839e2639978d16fac093feaee8ca8bab" + url: "https://pub.dev" + source: hosted + version: "2.4.22" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.dev" + source: hosted + version: "1.10.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + url: "https://pub.dev" + source: hosted + version: "0.7.10" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + win32: + dependency: transitive + description: + name: win32 + sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e + url: "https://pub.dev" + source: hosted + version: "5.15.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" +sdks: + dart: ">=3.11.1 <4.0.0" + flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..46f967b --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,31 @@ +name: funymee_ai +description: "FunyMee AI Application." +publish_to: 'none' + +version: 1.0.0+1 + +environment: + sdk: ^3.11.1 + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.8 + client_proxy_framework: + path: ../client_proxy_framework + http: ^1.2.2 + encrypt: ^5.0.3 + crypto: ^3.0.3 + logger: ^2.0.2 + shared_preferences: ^2.2.2 + device_info_plus: ^11.1.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true + assets: + - assets/skin_config.json diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..f268213 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,14 @@ +import 'package:client_proxy_framework/client_proxy_framework.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:funymee_ai/app.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('App smoke test', (WidgetTester tester) async { + await ClientBootstrap.initFromAsset('assets/skin_config.json'); + await tester.pumpWidget(const App(title: 'FunyMee AI')); + expect(find.text('FunyMee AI'), findsOneWidget); + }); +} diff --git a/web/favicon.png b/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/web/icons/Icon-maskable-512.png differ diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..e502869 --- /dev/null +++ b/web/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + funymee_ai + + + + + + + diff --git a/web/manifest.json b/web/manifest.json new file mode 100644 index 0000000..051c9de --- /dev/null +++ b/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "funymee_ai", + "short_name": "funymee_ai", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/windows/.gitignore b/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt new file mode 100644 index 0000000..3dc1961 --- /dev/null +++ b/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(funymee_ai LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "funymee_ai") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..903f489 --- /dev/null +++ b/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..8b6d468 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void RegisterPlugins(flutter::PluginRegistry* registry) { +} diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..b93c4c3 --- /dev/null +++ b/windows/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..394917c --- /dev/null +++ b/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc new file mode 100644 index 0000000..af9223b --- /dev/null +++ b/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.funymeeai" "\0" + VALUE "FileDescription", "funymee_ai" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "funymee_ai" "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.funymeeai. All rights reserved." "\0" + VALUE "OriginalFilename", "funymee_ai.exe" "\0" + VALUE "ProductName", "funymee_ai" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..955ee30 --- /dev/null +++ b/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/windows/runner/flutter_window.h b/windows/runner/flutter_window.h new file mode 100644 index 0000000..6da0652 --- /dev/null +++ b/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp new file mode 100644 index 0000000..e393ce2 --- /dev/null +++ b/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"funymee_ai", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/windows/runner/resource.h b/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/windows/runner/resources/app_icon.ico differ diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..153653e --- /dev/null +++ b/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp new file mode 100644 index 0000000..3a0b465 --- /dev/null +++ b/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/windows/runner/utils.h b/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp new file mode 100644 index 0000000..60608d0 --- /dev/null +++ b/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/windows/runner/win32_window.h b/windows/runner/win32_window.h new file mode 100644 index 0000000..e901dde --- /dev/null +++ b/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_