SkinsRestorer / SkinSystem

The Minecraft SkinSystem for SkinsRestorer
MIT License
131 stars 47 forks source link

The 1.7.2 Skin System can't be install successfully! #108

Closed wangzhizhou closed 3 years ago

wangzhizhou commented 3 years ago

in index.php, this code snippets may have problem:

    <?php foreach ([
      'https://code.jquery.com/jquery-3.3.1.min.js' => 'f8da8f95b6ed33542a88af19028e18ae3d9ce25350a06bfc3fbf433ed2b38fefa5e639cddfdac703fc6caa7f3313d974b92a3168276b3a016ceb28f27db0714a',
      'https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js' => 'f43dfd388488b509a66879608c35d7c1155f93dcec33ca875082f59f35552740d65e9a344a044d7ec534f0278a6bb6f0ed81047f73dcf615f7dcd76e0a482009',
      'https://cdnjs.cloudflare.com/ajax/libs/three.js/94/three.min.js' => '64681777a4c1e6a8edbd353a439a3f2c9338a702cdcbc53c5d7261faf2590d7a76c02f004ab97858e7a2bdaab67e961cdd39d308bcf20ef56363c621bcd61a5e',
      'https://raw.githubusercontent.com/InventivetalentDev/MineRender/v1.1.0/dist/skin.min.js' => '5acd05d47d28928779a88a13126a396fc1a57cda55fb82180db9e69dba009ad466156e1ca75562026c2ebcdf195adcfc178c78602468eafe3303b726706447b0',
      'https://cdn.jsdelivr.net/npm/sweetalert2@8.8.5' => '2d90ae300e9e37ef219afa3c50f2261e220f83424a83d30286d53492becce0ea6f1dc1749b0cd47eec37c6a008f877b79e40ab48638efd1462f4aeff2a288c96'
    ] as $url => $sha512){
      $expl = explode('/', $url);
      echo '<script src="'.cacheGrab($url, end($expl), './', false, ['sha512', $sha512]).'"></script>';
    } ?>

The js file's sha512 hash value is not equal the hard code sha512 value.

php version is 7.4

wangzhizhou commented 3 years ago

when I selected the skinrestorer config.yml, the page become display error as follow:

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>鐨偆绯荤粺</title>
    <!-- Libraries -->
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
    <link id="stylesheetSelector" rel="stylesheet" name="_light" href="resources/themes/_light.css">    <script type="text/javascript">
      function setCookie(cname, cvalue) {
        var d = new Date(); d.setTime(d.getTime() + (365*24*60*60*1000)); // cookies will last a year
        document.cookie = cname + "=" + cvalue + ";expires="+ d.toUTCString() + ";path=/";
      } 
      var theme = document.getElementById("stylesheetSelector").getAttribute("name");
      setCookie("theme", theme); // swap that stale cookie for a new one!
      function rotateTheme() { // move a metaphorical carousel by one item
        $.getJSON("resources/themes/",{}, function(lst){ 
          setCookie("theme", lst[((lst.indexOf(theme+".css")+1)%lst.length)].slice(0, -4));
          location.reload();
        });
      }
      var l = {};
      l.uplty1_lbl = "閫夋嫨鐨偆...";
    </script>
    {
    "type": "error",
    "title": "URL閿欒: ",
    "heightAuto": false,
    "showConfirmButton": false,
    "showCloseButton": true,
    "footer": "<div class=\"container\">\n<div class=\"col\"><a href=\"https://help.mojang.com\"><i class=\"fas fa-exclamation-circle\" style=\"padding-right: 5px;\"></i>sessionserver.mojang.com鍑虹幇闂</a></div></div>",
    "success": true
}
wangzhizhou commented 3 years ago

I have find resolution, replace php code snippet with:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/94/three.min.js" integrity="sha256-NGC9JEuTWN4GhTj091wctgjzftr+8WNDmw0H8J5YPYE=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/InventivetalentDev/MineRender@1.4.6/dist/skin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.15.5/dist/sweetalert2.all.min.js"></script>