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:
daydreamer-json
2026-03-30 17:21:08 +09:00
parent 75899425a1
commit 80dbeeb545
5 changed files with 75 additions and 5 deletions

View File

@@ -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>
))}