feat: add minid search

This commit is contained in:
relikd
2024-03-09 20:13:58 +01:00
parent 92f08ebce0
commit 7b1deb43ab
2 changed files with 4 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
<h1>IPA Archive</h1> <h1>IPA Archive</h1>
<form onsubmit="event.preventDefault(); searchIPA(); return false;" autocomplete="off"> <form onsubmit="event.preventDefault(); searchIPA(); return false;" autocomplete="off">
<input id="page" hidden> <input id="page" hidden>
<input id="minid" hidden>
<label for="search">Search: <input id="search" placeholder="Search"></label> <label for="search">Search: <input id="search" placeholder="Search"></label>
<label for="bundleid">BundleId: <input id="bundleid" placeholder="com.gameloft."></label> <label for="bundleid">BundleId: <input id="bundleid" placeholder="com.gameloft."></label>
<label for="unique">Unique: <input id="unique" type="checkbox" checked></label> <label for="unique">Unique: <input id="unique" type="checkbox" checked></label>

View File

@@ -96,10 +96,12 @@ function applySearch() {
const minos = document.getElementById('minos').value; const minos = document.getElementById('minos').value;
const maxos = document.getElementById('maxos').value; const maxos = document.getElementById('maxos').value;
const platform = document.getElementById('device').value; const platform = document.getElementById('device').value;
const minid = document.getElementById('minid').value;
const minV = minos ? strToVersion(minos) : 0; const minV = minos ? strToVersion(minos) : 0;
const maxV = maxos ? strToVersion(maxos) : 9999999; const maxV = maxos ? strToVersion(maxos) : 9999999;
const device = platform ? 1 << platform : 255; // all flags const device = platform ? 1 << platform : 255; // all flags
const minPK = minid ? parseInt(minid) : 0;
// [7, 2,20200,"180","com.headcasegames.180","1.0",1,"180.ipa", 189930], // [7, 2,20200,"180","com.headcasegames.180","1.0",1,"180.ipa", 189930],
// [pk, platform, minOS, title, bundleId, version, baseUrl, pathName, size] // [pk, platform, minOS, title, bundleId, version, baseUrl, pathName, size]
@@ -107,7 +109,7 @@ function applySearch() {
isInitial = false; isInitial = false;
const uniqueBundleIds = {}; const uniqueBundleIds = {};
DB.forEach(function (ipa, i) { DB.forEach(function (ipa, i) {
if (ipa[2] < minV || ipa[2] > maxV || !(ipa[1] & device)) { if (ipa[2] < minV || ipa[2] > maxV || !(ipa[1] & device) || ipa[0] < minPK) {
return; return;
} }
if (bundle && ipa[4].toLowerCase().indexOf(bundle) === -1) { if (bundle && ipa[4].toLowerCase().indexOf(bundle) === -1) {