mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-08 06:45:13 +08:00
修复use_frameworks时无法获取编译时间戳的问题
This commit is contained in:
@@ -71,11 +71,14 @@ export async function getApkInfo(fn) {
|
||||
export async function getIpaInfo(fn) {
|
||||
const appInfoParser = new AppInfoParser(fn);
|
||||
const { CFBundleShortVersionString: versionName } = await appInfoParser.parse();
|
||||
try {
|
||||
const buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/pushy_build_time.txt/);
|
||||
const buildTime = buildTimeTxtBuffer.toString().replace('\n', '');
|
||||
return { versionName, buildTime };
|
||||
} catch (e) {
|
||||
let buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/pushy_build_time.txt/);
|
||||
if (!buildTimeTxtBuffer) {
|
||||
// Not in root bundle when use `use_frameworks`
|
||||
buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/frameworks\/react_native_update.framework\/pushy_build_time.txt/);
|
||||
}
|
||||
if (!buildTimeTxtBuffer) {
|
||||
throw new Error('Can not get build time for this app.');
|
||||
}
|
||||
const buildTime = buildTimeTxtBuffer.toString().replace('\n', '');
|
||||
return { versionName, buildTime };
|
||||
}
|
||||
|
Reference in New Issue
Block a user