Skip to content

Commit

Permalink
Merge pull request #5 from NotAProton/refactor
Browse files Browse the repository at this point in the history
Version and Refactor
  • Loading branch information
NotAProton authored Sep 9, 2021
2 parents fc841ad + c0446e2 commit f81ce82
Show file tree
Hide file tree
Showing 122 changed files with 189 additions and 105 deletions.
19 changes: 0 additions & 19 deletions .bump.php

This file was deleted.

1 change: 0 additions & 1 deletion html/popup.html

This file was deleted.

122 changes: 61 additions & 61 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"manifest_version": 2,
"icons": {
"48": "icon/48.png",
"128": "icon/128.png",
"150": "icon/150.png",
"176": "icon/176.png",
"512": "icon/512.png"
},
"default_locale": "en",
"name": "Universal Bypass",
"description": "__MSG_appDesc__",
"homepage_url": "https://universal-bypass.org/",
"version": "13.15.2",
"author": "Sainan",
"permissions": [
"alarms",
"storage",
"webRequest",
"webRequestBlocking",
"<all_urls>"
],
"options_ui": {
"page": "html/options.html",
"open_in_tab": true
},
"browser_action": {
"default_icon": {
"48": "icon/48.png",
"128": "icon/128.png",
"150": "icon/150.png",
"176": "icon/176.png",
"512": "icon/512.png"
},
"default_popup": "html/popup.html"
},
"background": {
"scripts": [
"background.js"
]
},
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"content_script.js"
],
"run_at": "document_start"
}
],
"web_accessible_resources": [
"html/before-navigate.html",
"html/blocked.html",
"html/crowd-bypassed.html",
"html/firstrun.html",
"html/firstrun-noscript.html",
"html/options.html",
"icon/48.png"
]
}
"manifest_version": 2,
"icons": {
"48": "icon/48.png",
"128": "icon/128.png",
"150": "icon/150.png",
"176": "icon/176.png",
"512": "icon/512.png"
},
"default_locale": "en",
"name": "Universal Bypass",
"description": "__MSG_appDesc__",
"homepage_url": "https://universal-bypass.org/",
"version": "13.5.2",
"author": "Sainan",
"permissions": [
"alarms",
"storage",
"webRequest",
"webRequestBlocking",
"<all_urls>"
],
"options_ui": {
"page": "html/options.html",
"open_in_tab": true
},
"browser_action": {
"default_icon": {
"48": "icon/48.png",
"128": "icon/128.png",
"150": "icon/150.png",
"176": "icon/176.png",
"512": "icon/512.png"
},
"default_popup": "html/popup.html"
},
"background": {
"scripts": [
"background.js"
]
},
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"content_script.js"
],
"run_at": "document_start"
}
],
"web_accessible_resources": [
"html/before-navigate.html",
"html/blocked.html",
"html/crowd-bypassed.html",
"html/firstrun.html",
"html/firstrun-noscript.html",
"html/options.html",
"icon/48.png"
]
}
62 changes: 62 additions & 0 deletions platform_spec/chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"manifest_version": 2,
"icons": {
"48": "icon/48.png",
"128": "icon/128.png",
"150": "icon/150.png",
"176": "icon/176.png",
"512": "icon/512.png"
},
"default_locale": "en",
"name": "Universal Bypass",
"description": "__MSG_appDesc__",
"homepage_url": "https://universal-bypass.org/",
"version": "13.15.2",
"author": "Sainan",
"permissions": [
"alarms",
"storage",
"webRequest",
"webRequestBlocking",
"<all_urls>"
],
"options_ui": {
"page": "html/options.html",
"open_in_tab": true
},
"browser_action": {
"default_icon": {
"48": "icon/48.png",
"128": "icon/128.png",
"150": "icon/150.png",
"176": "icon/176.png",
"512": "icon/512.png"
},
"default_popup": "html/popup.html"
},
"background": {
"scripts": [
"background.js"
]
},
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"content_script.js"
],
"run_at": "document_start"
}
],
"web_accessible_resources": [
"html/before-navigate.html",
"html/blocked.html",
"html/crowd-bypassed.html",
"html/firstrun.html",
"html/firstrun-noscript.html",
"html/options.html",
"icon/48.png"
]
}
31 changes: 15 additions & 16 deletions scripts/chromium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,42 @@
# Usage: chromium.sh [argument]
# Arguments: {none} : dev package
# nover : Creates a package without version number
# ver : Creates a package with version number
# ver : Creates a package with version number as specified in version.txt

set -e

echo "*** Universal-bypass.Chromium: Creating package..."
DES=build/universal-bypass.chromium
DIST=build/dist
rm -rf $DES
mkdir -p $DES
rm -rf $DIST
mkdir -p $DIST
rm -rf ./$DES
mkdir -p ./$DES
rm -rf ./$DIST
mkdir -p ./$DIST

echo "*** Universal-bypass.Chromium: Copying files"
cp -R html/ $DES
cp -R _locales/ $DES
cp -R icon/ $DES
cp -R icon_disabled/ $DES
cp -RT js/ $DES
cp manifest.json $DES
cp rules.json $DES
cp PRIVACY.md $DES
bash ./scripts/copy_common.sh $DES
cp platform_spec/chromium/manifest.json $DES

cd $DES

if [[ $# -eq 0 ]]; then
echo "*** Universal-bypass.Chromium: Creating dev package... (Tip: Use nover to create a normal package)"
bash ../../scripts/version.sh manifest.json .0
zip -qr ../$(basename $DIST)/UniversalBypass_chromium_dev.zip .

elif [[ "$1" == "nover" ]] ; then
elif [ "$1" == "nover" ] ; then
echo "*** Universal-bypass.Chromium: Creating non-versioned package... "
rm injection_script.js
rm rules.json
bash ../../scripts/version.sh manifest.json no
zip -qr ../$(basename $DIST)/UniversalBypass_chromium_0.zip .

elif [[ "$1" == "ver" ]]; then
elif [ "$1" == "ver" ]; then
echo "*** Universal-bypass.Chromium: Creating versioned package... "
rm injection_script.js
zip -qr ../$(basename $DIST)/UniversalBypass_"$2"_chromium.zip .
rm rules.json
bash ../../scripts/version.sh manifest.json
zip -qr ../$(basename $DIST)/UniversalBypass_$(cat ../../src/version.txt)_chromium.zip .

fi

Expand Down
16 changes: 16 additions & 0 deletions scripts/copy_common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# This script assumes a linux environment

set -e

DES=$1

#bash ./tools/make-assets.sh $DES

cp -R src/html/ $DES
cp -R src/_locales/ $DES
cp -R src/icon/ $DES
cp -R src/icon_disabled/ $DES
cp -RT src/js/ $DES
cp PRIVACY.md $DES
25 changes: 25 additions & 0 deletions scripts/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
# This script assumes a linux environment

set -e

manifest_loc=$1


if [[ $# -lt 2 ]]; then
version=$(cat ../../src/version.txt)
sed -i '/"version":/c\ "version": "'$version'",' $1
echo vesrioned $(basename $1) to $version

elif [ "$2" = "no" ]; then
version="0.$(git shortlog | grep -E '^[ ]+\w+' | wc -l)"
sed -i '/"version":/c\ "version": "'$version'",' $1
echo vesrioned $(basename $1) to $version

else
version="0.$(git shortlog | grep -E '^[ ]+\w+' | wc -l).$2"
sed -i '/"version":/c\ "version": "'$version'",' $1
echo vesrioned $(basename $1) to $version
fi

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion html/ace/ace.js → src/html/ace/ace.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/html/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="base.js"></script><script src="popup.js"></script>
2 changes: 1 addition & 1 deletion html/popup.js → src/html/popup.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
brws.runtime.sendMessage({type: "open-tab", url: brws.runtime.getURL("/html/options.html")})
window.close()
window.close()
2 changes: 1 addition & 1 deletion html/uikit/uikit-ltr.css → src/html/uikit/uikit-ltr.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion html/uikit/uikit-rtl.css → src/html/uikit/uikit-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion html/uikit/uikit.js → src/html/uikit/uikit.js

Large diffs are not rendered by default.

Binary file renamed icon/128.png → src/icon/128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon/150.png → src/icon/150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon/176.png → src/icon/176.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon/48.png → src/icon/48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon/512.png → src/icon/512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon_disabled/128.png → src/icon_disabled/128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon_disabled/150.png → src/icon_disabled/150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon_disabled/176.png → src/icon_disabled/176.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon_disabled/48.png → src/icon_disabled/48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed icon_disabled/512.png → src/icon_disabled/512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion js/.jshintrc → src/js/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"asi": true,
"esversion": 6,
"evil": true
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.0

0 comments on commit f81ce82

Please sign in to comment.