add shuffle and root check

This commit is contained in:
dajoho 2024-01-02 14:05:31 +01:00
parent 8d65dc8314
commit bc53ceed38

View file

@ -38,7 +38,15 @@ char *libpandory_rot13(const char *src) {
return result;
}
int isReadonly(char const *path)
void libpandory_shufflemusic()
{
system("umount /tmp/pandory/share/retroarch/assets/sounds/bgm.mp3");
system("cd /mnt/Pandory/.user/bgm && ls | sed -n \"$((RANDOM%$(ls | wc -l)+1))p\" > /tmp/pandory_track");
system("busybox mount -o bind /mnt/Pandory/.user/bgm/$(cat /tmp/pandory_track) /tmp/pandory/share/retroarch/assets/sounds/bgm.mp3");
}
int libpandory_isreadonly(char const *path)
{
struct statvfs info;
statvfs(path, &info);
@ -48,11 +56,14 @@ int isReadonly(char const *path)
void libpandory_lefcheck(void) {
printf("TeamPandory - Pandory500 - by emuchicken and dajoho\n");
if (!isReadonly("/")) {
if (!libpandory_isreadonly("/")) {
printf("[WARNING]: Your system currently has a writeable NAND storage. This may have been caused by another modification. This is dangerous. Pandory will now exit.\n");
exit(1);
}
// do the red dwarf shuffle
libpandory_shufflemusic();
char fname[80];
strcpy(fname, libpandory_rot13("/zag/Cnaqbel/.sf/cnaqbel.fdkm"));
int chk = 0;