How the file protection works.
The file protection runs a shell.resolve onto the filepath, then checks the result. If shell.resolve(filePath) == "startup" it does not allow it, or if the first 7 letters are systemO.
Does anyone have an idea why it would do that?
Spoiler
oldShellResolve is a backup of shell.resolve
function fs.open(filePath, changeType)
local allowed = 1
if oldShellResolve(filePath) == "startup" then
allowed = 0
elseif string.sub(oldShellResolve(filePath), 1, 7) == "systemO" then
allowed = 0
end
if changeType == "r" then
allowed = 1
end
for i=1,#whitelistedFiles do
if oldShellResolve(filePath) == whitelistedFiles[i] then
allowed = 1
end
end
if allowed == 1 then
return oldfsopen(filePath, changeType)
else
error("Access Denied - To modify system files enable dev mode")
end
end
function fs.delete(filePath)
local allowed = 1
if oldShellResolve(filePath) == "startup" then
allowed = 0
elseif string.sub(oldShellResolve(filePath), 1, 7) == "systemO" then
allowed = 0
end
for i=1,#whitelistedFiles do
if oldShellResolve(filePath) == whitelistedFiles[i] then
allowed = 1
end
end
if allowed == 1 then
olddelete(filePath)
end
end
function fs.move(filePath, filePath2)
local allowed = 1
if oldShellResolve(filePath) == "startup" then
allowed = 0
elseif oldShellResolve(filePath2) == "startup" then
allowed = 0
end
if string.sub(oldShellResolve(filePath), 1, 7) == "systemO" then
allowed = 0
elseif string.sub(oldShellResolve(filePath2), 1, 7) == "systemO" then
allowed = 0
end
if allowed == 1 then
oldfsmove(filePath, filePath2)
end
end
function fs.copy(filePath, filePath2)
local allowed = 1
if oldShellResolve(filePath2) == "startup" then
allowed = 0
elseif string.sub(oldShellResolve(filePath2), 1, 7) == "systemO" then
allowed = 0
end
if allowed == 1 then
oldfscopy(filePath, filePath2)
end
end
function fs.isReadOnly(filePath)
local allowed = 1
if oldShellResolve(filePath) == "startup" then
allowed = 0
elseif string.sub(oldShellResolve(filePath), 1, 7) == "systemO" then
allowed = 0
elseif string.sub(oldShellResolve(filePath), 1, 3) == "rom" then
allowed = 0
end
if allowed == 1 then
return false
else
return true
end
end
You can get to O2.2 by running
pastebin run VSNTU31v
Then after run the "stream" program, use your arrow keys to select alpha, following that run the "update" program.