mirror of
https://github.com/daydreamer-json/ak-endfield-api-archive.git
synced 2026-04-01 05:02:26 +02:00
feat: implement resource index decryption
- Add `cipher` utility for resource index decryption/encryption - Automatically decrypt `index_initial.json` and `index_main.json` during archiving - pages: Update `ResourcesTab` to display links to decrypted versions of index files - Update README to reflect that some raw data is now decrypted
This commit is contained in:
@@ -140,7 +140,7 @@ function processRawData(rawData: StoredData<IApiEndfield.LauncherLatestGameResou
|
||||
});
|
||||
}
|
||||
|
||||
const ResourceLink = ({ basePath, file }: { basePath: string; file: string }) => {
|
||||
const ResourceLink = ({ basePath, file, isDecExist }: { basePath: string; file: string; isDecExist: boolean }) => {
|
||||
const fullPath = `${basePath}/${file}`;
|
||||
return (
|
||||
<>
|
||||
@@ -151,6 +151,17 @@ const ResourceLink = ({ basePath, file }: { basePath: string; file: string }) =>
|
||||
<a href={getMirrorUrl(fullPath)} target='_blank' rel='noreferrer'>
|
||||
Mirror
|
||||
</a>
|
||||
{isDecExist ? (
|
||||
<>
|
||||
{' '}
|
||||
/{' '}
|
||||
<a href={getMirrorUrl(fullPath).replace(/\.json$/, '_dec.json')} target='_blank' rel='noreferrer'>
|
||||
Dec
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -186,13 +197,13 @@ const ResourceTable = ({ groups }: { groups: ResourceGroup[] }) => (
|
||||
<td>{group.versions.join(', ')}</td>
|
||||
<td className='text-center'>{group.isKick ? '✅' : ''}</td>
|
||||
<td>
|
||||
<ResourceLink basePath={group.initialRes.path} file='index_initial.json' />
|
||||
<ResourceLink basePath={group.initialRes.path} file='index_initial.json' isDecExist={true} />
|
||||
</td>
|
||||
<td>
|
||||
<ResourceLink basePath={group.mainRes.path} file='index_main.json' />
|
||||
<ResourceLink basePath={group.mainRes.path} file='index_main.json' isDecExist={true} />
|
||||
</td>
|
||||
<td>
|
||||
<ResourceLink basePath={group.mainRes.path} file='patch.json' />
|
||||
<ResourceLink basePath={group.mainRes.path} file='patch.json' isDecExist={false} />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user