Integrate corrected char expressions into Liam code36
This commit is contained in:
+15
-5
@@ -40,7 +40,7 @@ def avatarPlaybackDiagnostic = providers.gradleProperty('avatarPlaybackDiagnosti
|
||||
def avatarRuntimeFix = providers.gradleProperty('avatarRuntimeFix').orNull == 'true'
|
||||
def avatarFullActionCandidate = providers.gradleProperty('avatarFullActionCandidate').orNull == 'true'
|
||||
def actionVersionCode = (providers.gradleProperty('actionVersionCode').orNull ?: '16').toInteger()
|
||||
if (characterProfileId != 'main' && (!avatarUserAssetCandidate || !avatarUserNetworkActions || actionVersionCode < characterProfile.minimumVersionCode)) throw new GradleException('Persona test requires existing exact black media/network flags and its minimum version code')
|
||||
if (characterProfileId != 'main' && (!avatarUserAssetCandidate || actionVersionCode < characterProfile.minimumVersionCode)) throw new GradleException('Persona test requires authorized exact media and its minimum version code')
|
||||
if (avatarActionCandidate && (!avatarMouthCandidate || actionVersionCode < 16)) {
|
||||
throw new GradleException('Action stage requires the existing mouth runtime and a fresh code >=16')
|
||||
}
|
||||
@@ -52,7 +52,11 @@ if (avatarUiCandidate && !avatarNatural) {
|
||||
}
|
||||
def naturalManifestSha = providers.gradleProperty('naturalManifestSha').orNull ?: ''
|
||||
def emotionManifestSha = providers.gradleProperty('emotionManifestSha').orNull ?: ''
|
||||
def characterMedia = characterCatalog.mediaBundles[avatarUserAssetCandidate ? 'black-correct03' : 'white-full04']
|
||||
def characterMediaId = providers.gradleProperty('characterMediaBundle').orNull ?: (avatarUserAssetCandidate ? 'black-correct03' : 'white-full04')
|
||||
def characterMedia = characterCatalog.mediaBundles[characterMediaId]
|
||||
def allowedMedia = characterProfile.mediaSelection == 'existing-build-flags' ? ['black-correct03','white-full04'] : [characterProfile.mediaSelection] + (characterProfile.additionalMediaSelections ?: [])
|
||||
if (!characterMedia || !(characterMediaId in allowedMedia)) throw new GradleException('Profile/media selection is not authorized')
|
||||
if (avatarUserNetworkActions && characterMedia.networkActionsAllowed != true) throw new GradleException('Network dance requires separate reviewed media registration')
|
||||
if (emotionManifestSha && !(emotionManifestSha ==~ /[0-9a-f]{64}/)) throw new GradleException('Emotion graph requires exact external manifest SHA')
|
||||
if (emotionManifestSha && (!avatarActionCandidate || !avatarMouthCandidate || !avatarNatural || actionVersionCode < 17)) throw new GradleException('Emotion candidate requires own-mouth runtime and a fresh code >=17')
|
||||
if (avatarFullActionCandidate && (!emotionManifestSha || !avatarActionCandidate || actionVersionCode < 18)) throw new GradleException('Full candidate requires pinned emotion/action graph and fresh code >=18')
|
||||
@@ -64,7 +68,7 @@ if (faceDiagnosticsFix && (!presenceCandidate || actionVersionCode < 24)) throw
|
||||
if (presenceCandidate && (!avatarStartupFix || actionVersionCode < 23)) throw new GradleException('Presence candidate requires startup fix and fresh code >=23')
|
||||
if (avatarStartupFix && (!avatarPlaybackClockFix || actionVersionCode < 22)) throw new GradleException('Startup fix requires repaired playback and fresh code >=22')
|
||||
if (avatarUserNetworkActions && (!avatarUserAssetCandidate || actionVersionCode < 32)) throw new GradleException('User network dance requires authorized exact asset mode and fresh code >=32')
|
||||
if (avatarUserAssetCandidate && (!avatarStartupFix || !cameraProbeDiagnostic || actionVersionCode < 30 || emotionManifestSha != '208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93')) throw new GradleException('User asset debug candidate requires exact authorized correct03, startup and current diagnostics, fresh code >=30')
|
||||
if (avatarUserAssetCandidate && (!avatarStartupFix || !cameraProbeDiagnostic || actionVersionCode < (characterMedia.minimumVersionCode ?: 30) || characterMedia.userAuthorizedDebug != true || emotionManifestSha != characterMedia.indexSha256)) throw new GradleException('User asset debug candidate requires exact authorized media, startup and current diagnostics, fresh code')
|
||||
if (!avatarUserAssetCandidate && avatarPlaybackClockFix && (!avatarFullActionCandidate || actionVersionCode < 21 || emotionManifestSha != '987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887')) throw new GradleException('Playback clock fix requires frozen full graph and fresh code >=21')
|
||||
if (avatarPlaybackDiagnostic && (!avatarFullActionCandidate || actionVersionCode < 20 || emotionManifestSha != '987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887')) throw new GradleException('Playback diagnostic requires frozen full graph and fresh code >=20')
|
||||
if (avatarRuntimeFix && (!avatarFullActionCandidate || actionVersionCode < 19)) throw new GradleException('Runtime fix requires full pinned graph and fresh code >=19')
|
||||
@@ -104,10 +108,12 @@ def stagePackagedAssets = tasks.register('stagePackagedAssets', Exec) {
|
||||
inputs.files(characterCatalogFile, rootProject.file('manifests/retained-avatar-files.json'), rootProject.file('scripts/select-character-assets.py'))
|
||||
inputs.dir(file('src/main/assets'))
|
||||
inputs.dir(file('src/main/res/drawable-nodpi'))
|
||||
inputs.property('selection', [characterProfileId, emotionManifestSha, avatarUserAssetCandidate, avatarMouthCandidate, avatarStartupFix].toString())
|
||||
if (characterMedia.resourceDirectory) inputs.dir(rootProject.file(characterMedia.resourceDirectory))
|
||||
inputs.property('selection', [characterProfileId, characterMediaId, emotionManifestSha, avatarUserAssetCandidate, avatarMouthCandidate, avatarStartupFix].toString())
|
||||
outputs.dir(packagedAssets)
|
||||
outputs.file(layout.buildDirectory.file('generated/character-selection.json'))
|
||||
commandLine 'python3', rootProject.file('scripts/select-character-assets.py'), '--profile', characterProfileId,
|
||||
'--media-bundle', emotionManifestSha ? characterMediaId : '',
|
||||
'--assets', file('src/main/assets'), '--emotion-sha', emotionManifestSha,
|
||||
'--user-assets', avatarUserAssetCandidate.toString(), '--mouth', avatarMouthCandidate.toString(),
|
||||
'--startup', avatarStartupFix.toString(), '--output', packagedAssets.get().asFile,
|
||||
@@ -123,7 +129,7 @@ android {
|
||||
resValue 'string', 'character_app_name', characterProfile.appName
|
||||
buildConfigField 'String', 'CHARACTER_PROFILE', groovy.json.JsonOutput.toJson(characterProfileId)
|
||||
buildConfigField 'String', 'DIALOGUE_PERSONA', groovy.json.JsonOutput.toJson(characterProfile.persona)
|
||||
buildConfigField 'String', 'CHARACTER_NOTE', groovy.json.JsonOutput.toJson(characterProfile.settingsNote)
|
||||
buildConfigField 'String', 'CHARACTER_NOTE', groovy.json.JsonOutput.toJson(characterMedia.settingsNote ?: characterProfile.settingsNote)
|
||||
buildConfigField 'boolean', 'PERMISSION_CONNECTION_RETENTION', characterProfile.permissionConnectionRetention.toString()
|
||||
minSdk 26
|
||||
targetSdk 34
|
||||
@@ -131,6 +137,7 @@ android {
|
||||
versionCode avatarActionCandidate ? actionVersionCode : (avatarMouthCandidate ? 15 : (avatarUiCandidate ? 14 : (avatarNatural ? 13 : 12)))
|
||||
versionName = avatarUserNetworkActions ? '0.7.14' : avatarUserAssetCandidate ? '0.7.12' : cameraProbeDiagnostic ? '0.7.11' : cameraPreviewStream ? '0.7.9' : cameraDirectYuv ? '0.7.8' : cameraCompatibilityFix ? '0.7.7' : faceDiagnosticsFix ? '0.7.6' : presenceCandidate ? '0.7.5' : avatarStartupFix ? '0.7.4' : avatarPlaybackClockFix ? '0.7.3' : avatarPlaybackDiagnostic ? '0.7.2' : avatarRuntimeFix ? '0.7.1' : (avatarActionCandidate ? '0.7.0' : ((avatarUiCandidate || avatarMouthCandidate) ? '0.6.2' : '0.6.1'))
|
||||
ndk { abiFilters 'arm64-v8a' }
|
||||
if (characterProfile.versionBase) versionName = characterProfile.versionBase
|
||||
versionName += characterProfile.versionSuffix
|
||||
}
|
||||
compileOptions { sourceCompatibility JavaVersion.VERSION_17; targetCompatibility JavaVersion.VERSION_17 }
|
||||
@@ -150,6 +157,7 @@ android {
|
||||
buildConfigField 'String', 'EMOTION_ASSET_ROOT', groovy.json.JsonOutput.toJson(characterMedia.assetRoot)
|
||||
buildConfigField 'String', 'STARTUP_ASSET_ROOT', groovy.json.JsonOutput.toJson(characterMedia.bootstrapRoot)
|
||||
buildConfigField 'String', 'STARTUP_MANIFEST_SHA', groovy.json.JsonOutput.toJson(characterMedia.bootstrapSha256)
|
||||
buildConfigField 'int', 'STARTUP_POSTER_RES_ID', 'com.gorios.lanvoice.R.drawable.' + characterMedia.posterResource
|
||||
buildConfigField 'boolean', 'CAMERA_PROBE_DIAGNOSTIC', cameraProbeDiagnostic ? 'true' : 'false'
|
||||
buildConfigField 'boolean', 'AVATAR_STARTUP_FIX', avatarStartupFix ? 'true' : 'false'
|
||||
buildConfigField 'boolean', 'AVATAR_ENGINEERING', (avatarEngineering || avatarNatural) ? 'true' : 'false'
|
||||
@@ -164,6 +172,7 @@ android {
|
||||
buildConfigField 'String', 'EMOTION_ASSET_ROOT', '"avatar/a01-expression-action-v1/"'
|
||||
buildConfigField 'String', 'STARTUP_ASSET_ROOT', '"avatar/startup-white-01/"'
|
||||
buildConfigField 'String', 'STARTUP_MANIFEST_SHA', '"461f5cfc10036de5f10ca3ce765fb8d9998697d3fd035aa9b1862d2ccfc3eaa2"'
|
||||
buildConfigField 'int', 'STARTUP_POSTER_RES_ID', 'com.gorios.lanvoice.R.drawable.startup_poster'
|
||||
buildConfigField 'boolean', 'CAMERA_PROBE_DIAGNOSTIC', 'false'
|
||||
buildConfigField 'boolean', 'AVATAR_STARTUP_FIX', 'false'
|
||||
buildConfigField 'boolean', 'AVATAR_ENGINEERING', 'false'
|
||||
@@ -175,6 +184,7 @@ android {
|
||||
}
|
||||
androidResources { noCompress += ['task', 'mp4'] }
|
||||
sourceSets.main.res.srcDir(networkSecurityResources)
|
||||
if (characterMedia.resourceDirectory) sourceSets.main.res.srcDir(rootProject.file(characterMedia.resourceDirectory))
|
||||
// Retain private archived imports on disk, but never put old seated/arms-down
|
||||
// animation packs into the new graph APK.
|
||||
sourceSets.main.assets.setSrcDirs([packagedAssets])
|
||||
|
||||
@@ -41,7 +41,10 @@ object StartupAvatarRepository {
|
||||
val json=JSONObject(String(raw,Charsets.UTF_8))
|
||||
check(json.getString("sourceIndexSha256")==BuildConfig.EMOTION_MANIFEST_SHA)
|
||||
val b=json.getJSONObject("body")
|
||||
val path=b.getString("path");check(path==BuildConfig.EMOTION_ASSET_ROOT+"runtime/neutral/body/idle.mp4")
|
||||
// BASIC_SHA pins this exact body reference; bundles may use different layouts.
|
||||
val path=b.getString("path")
|
||||
check(path.startsWith(BuildConfig.EMOTION_ASSET_ROOT) && path.matches(Regex("[A-Za-z0-9_./-]+")) &&
|
||||
path.split('/').none { it in setOf("", ".", "..") })
|
||||
val bytes=readBounded(app.assets.open(path),64_000_000);check(bytes.size<=64_000_000 && sha(bytes)==b.getString("sha256"))
|
||||
val poster=readBounded(app.assets.open(ROOT+"poster.png"),100_000);check(poster.size<=100_000 && sha(poster)==json.getString("posterSha256"))
|
||||
val pts=b.getJSONArray("ptsUs");val timeline=List(pts.length()) { pts.getLong(it) }
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.view.Surface
|
||||
import android.view.TextureView
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import com.gorios.lanvoice.R
|
||||
import com.gorios.lanvoice.diag.StartupTrace
|
||||
|
||||
/** One stable host. Only real matching neutral sourceframe0 can hand off the base loop.
|
||||
@@ -15,7 +14,7 @@ class StartupAvatarView(context: Context,private val binding: AvatarMediaBinding
|
||||
private val report: (VideoPresentation)->Unit,private val fullVisible: ()->Unit,private val failed: ()->Unit={}): FrameLayout(context) {
|
||||
private val poster=ImageView(context).apply {
|
||||
scaleType=ImageView.ScaleType.FIT_CENTER
|
||||
setImageResource(if(com.gorios.lanvoice.BuildConfig.AVATAR_USER_ASSET_CANDIDATE) R.drawable.startup_black_tulle_poster else R.drawable.startup_poster)
|
||||
setImageResource(com.gorios.lanvoice.BuildConfig.STARTUP_POSTER_RES_ID)
|
||||
}
|
||||
private val surface=TextureView(context).apply { isOpaque=false;alpha=0f }
|
||||
private var basic: ContinuousAvatarPack?=null
|
||||
|
||||
@@ -14,7 +14,9 @@ data class StartupAssetKey(val versionCode: Long,val installedAt: Long,val pin:
|
||||
init { require(versionCode>0 && installedAt>0 && pin.matches(Regex("[0-9a-f]{64}")) &&
|
||||
(root=="avatar/a01-expression-action-v1/" ||
|
||||
root=="avatar/a01-black-tulle-roomy720-correct03/" &&
|
||||
pin=="208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93" && validator>=3) && validator>0) }
|
||||
pin=="208f703ed92bf795bfeb78a1cef89b67bed2e45da80038a56157fd1ecd4cfa93" && validator>=3 ||
|
||||
root=="avatar/char-expressions-r02/" &&
|
||||
pin=="f8a69041da51e1a551c6991bfad6d7f034f0f320f726f58568afd43d81cb9604" && validator>=3) && validator>0) }
|
||||
val fingerprint: String get() = digest("$versionCode/$installedAt/$pin/$root/$validator")
|
||||
}
|
||||
private fun digest(value: String): String = MessageDigest.getInstance("SHA-256").digest(value.toByteArray())
|
||||
|
||||
Reference in New Issue
Block a user