Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ class Applesign {
}
}

async adjustAllInfoPlists() {
const infoPlistPath = path.join(this.config.appdir, "Info.plist");
adjustInfoPlist(infoPlistPath, this.config, this.emit.bind(this));
const ls = new AppDirectory();
const res = await ls.loadFromDirectory(this.config.appdir);
for (let appex of ls.appexs) {
const lidx = appex.lastIndexOf("/");
if (lidx !== -1) {
const plistPath = path.join(appex.substring(0, lidx), "Info.plist");
adjustInfoPlist(plistPath, this.config, this.emit.bind(this));
}
}
}

async signAppDirectoryInternal(ipadir: string, skipNested: boolean) {
fchk(arguments, ["string", "boolean"]);
await this._pullMobileProvision();
Expand Down Expand Up @@ -174,8 +188,7 @@ class Applesign {
if (this.config.insertLibrary !== undefined) {
await injectLibrary(this.config);
}
const infoPlistPath = path.join(this.config.appdir, "Info.plist");
adjustInfoPlist(infoPlistPath, this.config, this.emit.bind(this));
await this.adjustAllInfoPlists();
if (!this.config.pseudoSign) {
if (!this.config.mobileprovision) {
throw new Error("warning: No mobile provisioning file provided");
Expand Down
10 changes: 7 additions & 3 deletions lib/info-plist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ function createEmptyArraysObject(keys: string[]): Record<string, any[]> {
return Object.fromEntries(keys.map((key) => [key, []]));
}

export default function fix(
export default function adjustInfoPlist(
file: string,
options: ConfigOptions,
emit: any,
): void {
if (!options.appdir) {
throw new Error("Invalid parameters for fixPlist");
let { bundleid, forceFamily, allowHttp } = options;
if (!file) {
throw new Error("Invalid parameters for adjustInfoPlist");
}
if (file.indexOf(".appex/") != -1) {
bundleid += ".share";
}
let changed = false;
const data = plist.readFileSync(file);
Expand Down