- Android Theme parent → Theme.MaterialComponents.DayNight.NoActionBar.Bridge (fix BadgeDrawable crash in react-native-bottom-tabs after AccessibilityService toggle) - Plugin with-material-theme-android keeps theme idempotent across prebuilds - Plugin with-release-signing-android wires release signingConfig from key.properties - Splash: align native splash image with JS BrandSplash (icon.png) to eliminate double-splash flicker on app start - DM: reset partner/messages/replyTo state on userId change, disable cache for history query, switch spinner condition to isLoading||isFetching so reopens always load fresh and never show empty-state with stale partner Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
83 lines
3.2 KiB
JavaScript
83 lines
3.2 KiB
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
/**
|
|
* Expo Config-Plugin — fügt einen Release-Signing-Block in build.gradle ein,
|
|
* der key.properties aus android/key.properties liest.
|
|
*
|
|
* Warum Plugin statt Hand-Edit: `prebuild --clean` regeneriert build.gradle und
|
|
* überschreibt manuelle Änderungen. Dieses Plugin patcht den Signing-Block nach
|
|
* jedem prebuild idempotent via withAppBuildGradle.
|
|
*
|
|
* key.properties muss NACH prebuild in android/ abgelegt werden (nicht committen).
|
|
* Keystore muss in android/app/rebreak-release.keystore liegen (nicht committen).
|
|
*
|
|
* Format key.properties (in android/ — wird von rootProject.file() gefunden):
|
|
* storePassword=<password>
|
|
* keyPassword=<password>
|
|
* keyAlias=rebreak
|
|
* storeFile=rebreak-release.keystore
|
|
*
|
|
* Hinweis: storeFile ist relativ zu android/app/ (Gradle-Modul-Root), also
|
|
* Keystore in android/app/rebreak-release.keystore ablegen.
|
|
*/
|
|
|
|
const { withAppBuildGradle } = require('@expo/config-plugins');
|
|
|
|
function withReleaseSigningAndroid(config) {
|
|
return withAppBuildGradle(config, (cfg) => {
|
|
let gradle = cfg.modResults.contents;
|
|
|
|
// Idempotenz: Plugin bereits angewandt
|
|
if (gradle.includes('REBREAK_RELEASE_SIGNING')) {
|
|
return cfg;
|
|
}
|
|
|
|
// 1. Properties-Loader vor android { Block einfügen
|
|
const propertiesLoader = `
|
|
// REBREAK_RELEASE_SIGNING — injected by with-release-signing-android plugin
|
|
def keystorePropertiesFile = rootProject.file("key.properties")
|
|
def keystoreProperties = new Properties()
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
}
|
|
`;
|
|
gradle = gradle.replace(/\nandroid \{/, `${propertiesLoader}\nandroid {`);
|
|
|
|
// 2. Release-signingConfig in signingConfigs-Block einfügen (nach debug-Block)
|
|
// Expo generiert: signingConfigs { debug { ... } }
|
|
// Wir fügen release { ... } danach ein, direkt vor der schließenden }
|
|
const releaseSigningConfig = `
|
|
release {
|
|
if (keystorePropertiesFile.exists()) {
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
}`;
|
|
|
|
// Findet den signingConfigs-Block und fügt release vor der letzten } ein
|
|
gradle = gradle.replace(
|
|
/(signingConfigs \{[\s\S]*?)( \}\n)( buildTypes)/,
|
|
`$1${releaseSigningConfig}\n }\n $3`
|
|
);
|
|
|
|
// 3. Im release buildType: signingConfig.debug → signingConfig.release
|
|
// Der release-Block liegt nach dem debug-Block. Wir ersetzen die zweite
|
|
// Occurrence von signingConfig signingConfigs.debug (im release-Block).
|
|
const parts = gradle.split('signingConfig signingConfigs.debug');
|
|
if (parts.length >= 3) {
|
|
// parts[0] = vor debug-Block, parts[1] = zwischen debug und release, parts[2] = nach release
|
|
gradle = parts[0]
|
|
+ 'signingConfig signingConfigs.debug'
|
|
+ parts[1]
|
|
+ 'signingConfig signingConfigs.release'
|
|
+ parts.slice(2).join('signingConfig signingConfigs.debug');
|
|
}
|
|
|
|
cfg.modResults.contents = gradle;
|
|
return cfg;
|
|
});
|
|
}
|
|
|
|
module.exports = withReleaseSigningAndroid;
|