Update Firefox build process
This commit is contained in:
parent
ca2635ba09
commit
7e232bfe68
@ -1,41 +1,8 @@
|
||||
<?php
|
||||
function recursivelyDelete($path)
|
||||
{
|
||||
if(substr($path, -1) == "/")
|
||||
{
|
||||
$path = substr($path, 0, -1);
|
||||
}
|
||||
if(!file_exists($path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(is_dir($path))
|
||||
{
|
||||
foreach(scandir($path) as $file)
|
||||
{
|
||||
if(!in_array($file, [
|
||||
".",
|
||||
".."
|
||||
]))
|
||||
{
|
||||
recursivelyDelete($path."/".$file);
|
||||
}
|
||||
}
|
||||
rmdir($path);
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($path);
|
||||
}
|
||||
}
|
||||
if(file_exists("Universal Bypass for Netscape Navigator.zip"))
|
||||
{
|
||||
unlink("Universal Bypass for Netscape Navigator.zip");
|
||||
}
|
||||
if(is_dir(".firefox"))
|
||||
{
|
||||
recursivelyDelete(".firefox");
|
||||
}
|
||||
|
||||
echo "Indexing...\n";
|
||||
$index = [];
|
||||
@ -49,7 +16,6 @@ function recursivelyIndex($dir)
|
||||
$fn = $dir."/".$f;
|
||||
if(is_dir($fn))
|
||||
{
|
||||
mkdir(".firefox/".$fn);
|
||||
recursivelyIndex($fn);
|
||||
}
|
||||
else
|
||||
@ -59,7 +25,6 @@ function recursivelyIndex($dir)
|
||||
}
|
||||
}
|
||||
}
|
||||
mkdir(".firefox");
|
||||
recursivelyIndex(".");
|
||||
|
||||
echo "Building...\n";
|
||||
@ -83,11 +48,9 @@ foreach($index as $fn)
|
||||
if($fn == "manifest.json")
|
||||
{
|
||||
$json = json_decode(file_get_contents($fn), true);
|
||||
unset($json["browser_specific_settings"]);
|
||||
$json["version"] .= ".".$build_id;
|
||||
$content = str_replace(" ", "\t", json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
$build->addFromString($fn, $content);
|
||||
file_put_contents(".firefox/".$fn, $content);
|
||||
}
|
||||
else if($fn == "background.js")
|
||||
{
|
||||
@ -102,18 +65,11 @@ foreach($index as $fn)
|
||||
"if(false)"
|
||||
], file_get_contents($fn));
|
||||
$build->addFromString($fn, $content);
|
||||
file_put_contents(".firefox/".$fn, $content);
|
||||
}
|
||||
else
|
||||
{
|
||||
$build->addFile($fn, $fn);
|
||||
copy($fn, ".firefox/".$fn);
|
||||
}
|
||||
}
|
||||
$build->close();
|
||||
file_put_contents(".next_build_id.txt", $build_id + 1);
|
||||
if(is_file(".sign_firefox_build.bat"))
|
||||
{
|
||||
passthru(".sign_firefox_build.bat");
|
||||
}
|
||||
recursivelyDelete(".firefox");
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
||||
.next_build_id.txt
|
||||
.sign_firefox_build.bat
|
||||
|
@ -50,11 +50,6 @@
|
||||
"run_at": "document_start"
|
||||
}
|
||||
],
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"update_url": "https://universal-bypass.org/firefox/updates.json"
|
||||
}
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
"html/before-navigate.html",
|
||||
"html/blocked.html",
|
||||
|
Loading…
x
Reference in New Issue
Block a user