mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-30 09:32:50 +01:00
refactor: migrate app.config and Expo config plugins to TypeScript (#1718)
This commit is contained in:
33
plugins/withChangeNativeAndroidTextToWhite.ts
Normal file
33
plugins/withChangeNativeAndroidTextToWhite.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { type ConfigPlugin, withDangerousMod } from "expo/config-plugins";
|
||||
|
||||
const withChangeNativeAndroidTextToWhite: ConfigPlugin = (expoConfig) =>
|
||||
withDangerousMod(expoConfig, [
|
||||
"android",
|
||||
(modConfig) => {
|
||||
if (modConfig.modRequest.platform === "android") {
|
||||
const stylesXmlPath = join(
|
||||
modConfig.modRequest.platformProjectRoot,
|
||||
"app",
|
||||
"src",
|
||||
"main",
|
||||
"res",
|
||||
"values",
|
||||
"styles.xml",
|
||||
);
|
||||
|
||||
let stylesXml = readFileSync(stylesXmlPath, "utf8");
|
||||
|
||||
stylesXml = stylesXml.replace(
|
||||
/@android:color\/black/g,
|
||||
"@android:color/white",
|
||||
);
|
||||
|
||||
writeFileSync(stylesXmlPath, stylesXml, { encoding: "utf8" });
|
||||
}
|
||||
return modConfig;
|
||||
},
|
||||
]);
|
||||
|
||||
export default withChangeNativeAndroidTextToWhite;
|
||||
Reference in New Issue
Block a user