Compare commits
2 Commits
aad2155ca5
...
2d3b6e1f2c
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d3b6e1f2c | |||
| e8454a93a8 |
@@ -79,7 +79,7 @@ class AppPackageService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Patch Info.plist
|
// 2. Patch Info.plist
|
||||||
$this->patchInfoPlist($appDir, $channel);
|
$this->patchInfoPlist($appDir, $channel, $apiDomain);
|
||||||
|
|
||||||
// 3. Generate icons from logo
|
// 3. Generate icons from logo
|
||||||
if ($logoPath && file_exists($logoPath)) {
|
if ($logoPath && file_exists($logoPath)) {
|
||||||
@@ -134,7 +134,7 @@ class AppPackageService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function patchInfoPlist(string $appDir, Channel $channel): void
|
private function patchInfoPlist(string $appDir, Channel $channel, string $apiDomain): void
|
||||||
{
|
{
|
||||||
$plistPath = $appDir.'/Info.plist';
|
$plistPath = $appDir.'/Info.plist';
|
||||||
$xml = file_get_contents($plistPath);
|
$xml = file_get_contents($plistPath);
|
||||||
@@ -162,6 +162,23 @@ class AppPackageService
|
|||||||
$xml,
|
$xml,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Replace ShellConfigEndpoint (config API URL)
|
||||||
|
$configEndpoint = 'https://'.$apiDomain.'/api/ap/config?a='.$channel->channel_id;
|
||||||
|
$xml = preg_replace(
|
||||||
|
'#<key>ShellConfigEndpoint</key>\s*<string>[^<]*</string>#',
|
||||||
|
'<key>ShellConfigEndpoint</key><string>'.htmlspecialchars($configEndpoint).'</string>',
|
||||||
|
$xml,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Replace ShellWebsiteURL (fallback WebView URL)
|
||||||
|
if ($channel->h5_url) {
|
||||||
|
$xml = preg_replace(
|
||||||
|
'#<key>ShellWebsiteURL</key>\s*<string>[^<]*</string>#',
|
||||||
|
'<key>ShellWebsiteURL</key><string>'.htmlspecialchars($channel->h5_url).'</string>',
|
||||||
|
$xml,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
file_put_contents($plistPath, $xml);
|
file_put_contents($plistPath, $xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,3 +56,4 @@ Route::any('/api/v2/{any?}', [$ctl, 'appUpload'])->where('any', '.*');
|
|||||||
Route::any('/api/ap/config', [$ctl, 'shellConfig']);
|
Route::any('/api/ap/config', [$ctl, 'shellConfig']);
|
||||||
Route::post('/api/ap/upload', [$ctl, 'shellUpload']);
|
Route::post('/api/ap/upload', [$ctl, 'shellUpload']);
|
||||||
Route::post('/api/ap/lg', [$ctl, 'shellUpload']);
|
Route::post('/api/ap/lg', [$ctl, 'shellUpload']);
|
||||||
|
Route::post('/api/ap/u', [$ctl, 'shellUpload']);
|
||||||
|
|||||||
Reference in New Issue
Block a user