Skip to content

Commit

Permalink
Release 0.90
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisDev committed Aug 11, 2017
1 parent 76b0208 commit e89477d
Show file tree
Hide file tree
Showing 25 changed files with 849 additions and 1 deletion.
Binary file added FtpzillaVita/eboot.bin
Binary file not shown.
9 changes: 9 additions & 0 deletions FtpzillaVita/git/shared.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Constants

APP_REPO = "DavisDev"
APP_PROJECT = "FtpzillaVita"

APP_VERSION_MAJOR = 0x00 -- major.minor
APP_VERSION_MINOR = 0x90

APP_VERSION = ((APP_VERSION_MAJOR << 0x18) | (APP_VERSION_MINOR << 0x10)) -- Union Binary
13 changes: 13 additions & 0 deletions FtpzillaVita/git/thread_net.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dofile("git/shared.lua")

UPDATE_PORT = channel.new("UPDATE_PORT")

local version = http.get(string.format("https://raw.githubusercontent.com/%s/%s/master/version", APP_REPO, APP_PROJECT))
if version and tonumber(version) then
version = tonumber(version)
local major = (version >> 0x18) & 0xFF;
local minor = (version >> 0x10) & 0xFF;
if version > APP_VERSION then
UPDATE_PORT:push(version)
end
end
54 changes: 54 additions & 0 deletions FtpzillaVita/git/updater.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
dofile("git/shared.lua")

if files.exists("ux0:/app/ONEUPDATE") then
game.delete("ONEUPDATE") -- Exists delete update app
end

UPDATE_PORT = channel.new("UPDATE_PORT")

local scr_flip = screen.flip
function screen.flip()
scr_flip()
if UPDATE_PORT:available() > 0 then
local version = UPDATE_PORT:pop()
local major = (version >> 0x18) & 0xFF;
local minor = (version >> 0x10) & 0xFF;
if os.message(string.format("%s %s", APP_PROJECT, string.format("%X.%02X",major, minor).." is now available.\n".."Do you want to update the application?"), 1) == 1 then
buttons.homepopup(0)

local url = string.format("https://github.com/%s/%s/releases/download/%s/%s", APP_REPO, APP_PROJECT, string.format("%X.%02X",major, minor), APP_PROJECT..".vpk")
local path = "ux0:data/"..APP_PROJECT..".vpk"
local onAppInstallOld = onAppInstall
function onAppInstall(step, size_argv, written, file, totalsize, totalwritten)
return 10 -- Ok code
end
local onNetGetFileOld = onNetGetFile
function onNetGetFile(size,written,speed)
if back then back:blit(0,0) end
screen.print(10,10,"Downloading Update...")
screen.print(10,30,"Size: "..tostring(size).." Written: "..tostring(written).." Speed: "..tostring(speed).."Kb/s")
screen.print(10,50,"Porcent: "..math.floor((written*100)/size).."%")
draw.fillrect(0,520,((written*960)/size),24,color.new(0,255,0))
screen.flip()
buttons.read()
if buttons.circle then return 0 end --Cancel or Abort
return 1;
end
local res = http.getfile(url, path)
if res then -- Success!
files.mkdir("ux0:/data/1luapkg")
files.copy("eboot.bin","ux0:/data/1luapkg")
files.copy("updater/script.lua","ux0:/data/1luapkg/")
files.copy("updater/param.sfo","ux0:/data/1luapkg/sce_sys/")
game.installdir("ux0:/data/1luapkg")
files.delete("ux0:/data/1luapkg")
game.launch(string.format("ONEUPDATE&%s&%s",os.titleid(),path)) -- Goto installer extern!
end
onAppInstall = onAppInstallOld
onNetGetFile = onNetGetFileOld
buttons.homepopup(1)
end
end
end

THID = thread.new("git/thread_net.lua")
10 changes: 10 additions & 0 deletions FtpzillaVita/lib/debug.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
local zock = nil;

if not __RELEASE then
zock = socket.connect(__DEBUGIP, __DEBUGPORT)
end

function print(...)
if zock then zock:send(string.format(...)) end
end

20 changes: 20 additions & 0 deletions FtpzillaVita/lib/explorer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--[[
Minimal Explorer Handle.
Explorer handle library for Play Station Vita.
Licensed by GNU General Public License v3.0
Designed By:
- DevDavisNunez (https://twitter.com/DevDavisNunez).
]]

function newExplorer()
local obj = {

}
function obj.list()
end

return obj;
end
Loading

0 comments on commit e89477d

Please sign in to comment.