Skip to content
This repository has been archived by the owner on Mar 7, 2020. It is now read-only.

Commit

Permalink
v2.00
Browse files Browse the repository at this point in the history
  • Loading branch information
theheroGAC authored Jun 22, 2018
1 parent 4aefd3d commit 3220cb8
Show file tree
Hide file tree
Showing 31 changed files with 753 additions and 123 deletions.
Binary file modified eboot.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions git/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
APP_REPO = "theheroGAC"
APP_PROJECT = "Autoplugin"

APP_VERSION_MAJOR = 0x01 -- major.minor
APP_VERSION_MINOR = 0x10
APP_VERSION_MAJOR = 0x02 -- major.minor
APP_VERSION_MINOR = 0x00
APP_VERSION = ((APP_VERSION_MAJOR << 0x18) | (APP_VERSION_MINOR << 0x10)) -- Union Binary
16 changes: 14 additions & 2 deletions git/updater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ function screen.flip()
local version = UPDATE_PORT:pop()
local major = (version >> 0x18) & 0xFF;
local minor = (version >> 0x10) & 0xFF;
update = image.load("git/updater/update.png")

if update then update:blit(0,0)
elseif back then back:blit(0,0) end
screen.flip()

if os.message(string.format("%s v %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)
if back then back:blit(0,0) end

if update then update:blit(0,0)
elseif back then back:blit(0,0) end

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
Expand All @@ -26,7 +34,10 @@ function screen.flip()
end
local onNetGetFileOld = onNetGetFile
function onNetGetFile(size,written,speed)
if back then back:blit(0,0) end

if update then update:blit(0,0)
elseif 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,"Percent: "..math.floor((written*100)/size).."%")
Expand All @@ -41,6 +52,7 @@ function screen.flip()
files.mkdir("ux0:/data/1luapkg")
files.copy("eboot.bin","ux0:/data/1luapkg")
files.copy("git/updater/script.lua","ux0:/data/1luapkg/")
files.copy("git/updater/update.png","ux0:/data/1luapkg/")
files.copy("git/updater/param.sfo","ux0:/data/1luapkg/sce_sys/")
game.installdir("ux0:/data/1luapkg")
files.delete("ux0:/data/1luapkg")
Expand Down
25 changes: 14 additions & 11 deletions git/updater/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
]]

buttons.homepopup(0)

color.loadpalette()
update = image.load("update.png")

args = os.arg()
if args:len() == 0 then
Expand All @@ -24,22 +24,25 @@ end
function onAppInstall(step, size_argv, written, file, totalsize, totalwritten)

if step == 1 then -- Only msg of state
draw.fillrect(0,0,960,30, color.green:a(100))
screen.print(10,10,"Search in vpk, Unsafe or Dangerous files!")
if update then update:blit(0,0) end
draw.fillrect(0,0,960,30, color.green:a(100))
screen.print(10,10,"Search in vpk, Unsafe or Dangerous files!")
screen.flip()
elseif step == 2 then -- Warning Vpk confirmation!
return 10 -- Ok
elseif step == 3 then -- Unpack
draw.fillrect(0,0,960,30, color.green:a(100))
screen.print(10,10,"Unpack vpk...")
screen.print(925,10,"Percent Total: "..math.floor((totalwritten*100)/totalsize).." %",1.0,color.white, color.black, __ARIGHT)
screen.print(10,35,"File: "..tostring(file))
screen.print(10,55,"Percent: "..math.floor((written*100)/size_argv).." %")
draw.fillrect(0,544-30,(totalwritten*960)/totalsize,30, color.new(0,255,0))
if update then update:blit(0,0) end
draw.fillrect(0,0,960,30, color.green:a(100))
screen.print(10,10,"Unpack vpk...")
screen.print(925,10,"Percent Total: "..math.floor((totalwritten*100)/totalsize).." %",1.0,color.white, color.black, __ARIGHT)
screen.print(10,35,"File: "..tostring(file))
screen.print(10,55,"Percent: "..math.floor((written*100)/size_argv).." %")
draw.fillrect(0,544-30,(totalwritten*960)/totalsize,30, color.new(0,255,0))
screen.flip()
elseif step == 4 then -- Promote or install
draw.fillrect(0,0,960,30, color.green:a(100))
screen.print(10,10,"Installing...")
if update then update:blit(0,0) end
draw.fillrect(0,0,960,30, color.green:a(100))
screen.print(10,10,"Installing...")
screen.flip()
end
end
Expand Down
Binary file added git/updater/update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
281 changes: 209 additions & 72 deletions resources/autoplugin.lua
Original file line number Diff line number Diff line change
@@ -1,92 +1,229 @@
------Autoinstall plugin
-------------------Resource-----------
dofile("git/shared.lua")
if __UPDATE == 1 then
local wstrength = wlan.strength()
if wstrength then
if wstrength > 55 then dofile("git/updater.lua") end
-------------------Resources-----------
--Init load configs
__UX0, __UR0 = 1,2
tai.load()

if not files.exists("ux0:tai/config.txt") and not files.exists("ur0:tai/config.txt") then
if tostring(os.swversion()) == "3.60" then files.copy("resources/config_360/config.txt", "ur0:tai/")
elseif tostring(os.swversion()) == "3.65" then files.copy("resources/config_365/config.txt", "ur0:tai/") end
tai.load()
end

--Backups
tai.sync(__UX0, "ux0:tai/config_backup.txt")
tai.sync(__UR0, "ur0:tai/config_backup.txt")

if back then back:blit(0,0) end
message_wait("Creating Config_backups.txt")
os.delay(1500)

local change, multi, path_plugins = false,false, "resources/plugins/"
local locations = { "ux0:", "ur0:", }

local loc, toinstall = 1,0
if tai[__UR0].exist then loc = 2 end

plugins = {

{ name = "Gamesd by xyzz (Only in ur0:tai/config.txt)", path = "gamesd.skprx", section = "KERNEL" },
{ name = "NoNpDrm by TheFl0w", path = "nonpdrm.skprx", section = "KERNEL" },

{ name = "NoPsmDrm by frangarcj", path = "nopsmdrm.skprx", section = "KERNEL" },
{ name = "Vitabright by devnoname120(only for 3.60)", path = "vitabright.skprx", section = "KERNEL", configuration = "vitabright_lut.txt" },
{ name = "NoAVLS by SilicaAndPina", path = "noavls.skprx", section = "KERNEL" },
{ name = "Repatch by dots", path = "repatch.skprx", section = "KERNEL" },
{ name = "ds3vita by xerpi", path = "ds3vita.skprx", section = "KERNEL" },
{ name = "ds4vita by xerpi", path = "ds4vita.skprx", section = "KERNEL" },
{ name = "Kuio by Rinnegatamante", path = "kuio.skprx", section = "KERNEL" },
{ name = "Adrenaline by TheFl0w(fix double touch)", path = "ux0:app/PSPEMUCFW/sce_module/adrenaline_kernel.skprx", section = "KERNEL" },

{ name = "DownloadEnabler by TheFl0w", path = "download_enabler.suprx", section = "main" },
{ name = "Shellbat by nowrep", path = "shellbat.suprx", section = "main" },
{ name = "pngshot by xyzz", path = "pngshot.suprx", section = "main" },
{ name = "Vflux by Applelo", path = "vFlux.suprx", section = "main" },

{ name = "PSV-VSH MENU by joel16", path = "vsh.suprx", section = "ALL" },-- Need kuio.skprx

}

function install_plugins(nplugin, partition)

local path_config = locations[partition].."tai/config.txt"
local path_tai = locations[partition].."tai/"

--Copy Extra-plugins or configurations
if nplugin == 4 then
files.copy(path_plugins..plugins[nplugin].configuration, path_tai)
elseif nplugin == 15 then
files.copy(path_plugins..plugins[9].path, path_tai)
end

--Install plugin to TAI folder
if nplugin == 12 then
files.copy(path_plugins..plugins[nplugin].path, "ux0:tai/") --Shellbat.suprx work in ux0
else
files.copy(path_plugins..plugins[nplugin].path, path_tai)
end

--Insert plugin to Config
if nplugin == 1 then
tai.put(partition, plugins[nplugin].section, path_tai..plugins[nplugin].path, 1) --Gamesd.skprx first
elseif nplugin == 10 then --Adrenaline ux0:app
tai.put(partition, plugins[nplugin].section, plugins[nplugin].path )
elseif nplugin == 12 then
tai.put(partition, plugins[nplugin].section, "ux0:tai/"..plugins[nplugin].path )
elseif nplugin == 15 then --VSH menu need kuio.skprx
tai.put(partition, plugins[nplugin].section, path_tai..plugins[nplugin].path)
tai.put(partition, plugins[9].section, path_tai..plugins[9].path)
else
tai.put(partition, plugins[nplugin].section, path_tai..plugins[nplugin].path)
end

tai.sync(partition)
change = true
buttons.homepopup(0)
if not multi then os.message(plugins[nplugin].name.."\n\nhave been installed") end

end

function Reload_ur0_config()
loc = __UR0

if not tai[__UR0].exist then
if tai[__UX0].exist then files.copy(tai[__UX0].path, "ur0:tai/")
else
if tostring(os.swversion()) == "3.60" then files.copy("resources/config_360/config.txt", "ur0:tai/")
elseif tostring(os.swversion()) == "3.65" then files.copy("resources/config_365/config.txt", "ur0:tai/") end
end
end

--Update configs
tai.load()

if tai[__UX0].exist then files.delete(tai[__UX0].path) end

end

function plugins_installation(sel)
if sel == 1 then --gamesd only in ur0:tai/config.txt and not ux0:tai/config.txt
Reload_ur0_config()
end

if sel == 4 and tostring(os.swversion()) != "3.60" then os.message("Vitabright only for 3.60")
else
if files.exists(tai[loc].path) then
install_plugins(sel, loc)
else
os.message("Missing config")
end
end
end

color.loadpalette() -- Load Defaults colors
back = image.load("resources/back.png")
local limit = 14
local scroll = newScroll(plugins,limit)

buttons.interval(10,10)
while true do
buttons.read()
if back then back:blit(0,0) end

screen.print(10,20,"Autoplugin Install the plugins with a click",1,color.red)
screen.print(10,50,"List of plugins ready to install:",1,color.white)
screen.print(25,80,"-> DownloadEnabler by TheFl0w\n-> NoNpDrm by TheFl0w\n-> NoPsmDrm by frangarcj\n-> gamesd by xyzz\n-> PSVita-StorageMgr by Celesteblue\n-> Shellbat by nowrep\n-> Vitabright by devnoname120(only for 3.60)\n-> pngshot by xyzz\n-> Kuio by Rinnegatamante\n-> PSV-VSH MENU by joel16\n-> Vflux by Applelo\n-> Repatch by dots-tb\n-> NoAVLS by SilicaAndPina\n-> ds3vita and ds4vita by xerpi",1,color.green)

screen.print(25,380,"Press CROSS to install Plugins on ux0:tai",1,color.white,color.blue)
screen.print(25,400,"Press CIRCLE to install Plugins on ur0:tai",1,color.white,color.black)
screen.print(25,420,"Press UP to install Plugins on ur0:tai(for SD2VITA users with gamesd plugin)",1,color.white,color.black)
screen.print(25,440,"Press SELECT to install Plugins on ur0:tai(for SD2VITA/PSVSD users with PSVita-StorageMgr)",1,color.white,color.black)
screen.print(25,460,"Press TRIANGLE to install Plugins on PSTV ONLY(ux0:tai).",1,color.white,color.green)
screen.print(25,480,"Press SQUARE to enter the extra tool.",1,color.white,color.blue)
screen.print(15,500,"Press START to exit.",1,color.white,color.red)

screen.flip() -- Show Buff

if buttons.cross then
if files.exists("ux0:tai") then files.rename("ux0:tai", "_backup") end
files.extract("resources/autoplugin.zip","ux0:/tai")
files.extract("resources/config.zip","ux0:/tai")
os.message("Your PSVita will restart...\nThe plugins have been installed\n\nThe old folder tai has been saved on ux0: as tai_backup",0)
os.delay(2500)
buttons.homepopup(1)
power.restart()
end
screen.print(480,20,"Autoplugin Install the plugins with a click",1,color.red, 0x0, __ACENTER)
screen.print(10,50,"List of plugins ready to install:",1,color.white)

if buttons.circle then
if files.exists("ur0:tai/config.txt") then files.rename("ur0:tai/config.txt", "config_backup.txt") end
files.copy("ur0:tai","ur0:tai/backup/")
files.extract("resources/autoplugin.zip","ur0:/tai")
files.extract("resources/config2.zip","ur0:/tai")
os.message("Your PSVita will restart...\nThe plugins have been installed\n\nThe old file has been saved on ur0:tai/config_backup.txt",0)
os.delay(2500)
buttons.homepopup(1)
power.restart()
end
screen.print(10,440,"Press X to Install the plugin(s)",1,color.white,color.black)
screen.print(10,460,"Press Square to select the plugin (s) to install",1,color.white,color.black)
screen.print(10,480,"Press Triangle to Install ALL the plugins",1,color.white,color.black)
screen.print(10,500,"Press Select to clean selected plugins",1,color.white,color.black)
screen.print(10,522,"Press START to exit",1,color.white,color.red)

if buttons.up then
if files.exists("ur0:tai/config.txt") then files.rename("ur0:tai/config.txt", "config_backup.txt") end
files.extract("resources/autoplugin4.zip","ur0:/tai")
files.extract("resources/config4.zip","ur0:/tai")
os.message("Your PSVita will restart...\nThe plugins have been installed\n\nThe file config has been saved on ur0:tai/config_backup.txt",0)
os.delay(2500)
buttons.homepopup(1)
power.restart()
end
--Partitions
local xRoot = 750
local w = (955-xRoot)/#locations
for i=1, #locations do
if loc == i then
draw.fillrect(xRoot,36,w,36, color.green:a(90))
end
screen.print(xRoot+(w/2), 45, locations[i], 1, color.white, color.blue, __ACENTER)
xRoot += w
end

--List of Plugins
local y = 80
for i=scroll.ini,scroll.lim do

if buttons.select then
if files.exists("ur0:tai/config.txt") then files.rename("ur0:tai/config.txt", "config_backup.txt") end
files.extract("resources/autoplugin3.zip","ur0:/tai")
files.extract("resources/config3.zip","ur0:/tai")
os.message("Your PSVita will restart...\nThe plugins have been installed\n\nThe file config has been saved on ur0:tai/config_backup.txt",0)
os.delay(2500)
buttons.homepopup(1)
power.restart()
end
if i == scroll.sel then draw.fillrect(0,y-2,945,23,color.green:a(90)) end

screen.print(30,y, plugins[i].name,1.0,color.white,color.blue,__ALEFT)

if plugins[i].inst then
screen.print(5,y,"->",1,color.white,color.green)
end

if buttons.triangle then
if files.exists("ux0:tai") then files.rename("ux0:tai", "_backup") end
files.extract("resources/autoplugin2.zip","ux0:/tai")
files.extract("resources/config.zip","ux0:/tai")
os.message("Your VITATV will restart...\nThe plugins have been installed\n\nThe old folder tai has been saved on ux0: as tai_backup",0)
os.delay(2500)
buttons.homepopup(1)
power.restart()
end
y+=26
end

---- Draw Scroll Bar
local ybar,hbar = 80, (limit*26)-2
draw.fillrect(950,ybar-2,8,hbar,color.shine)
if scroll.maxim >= limit then -- Draw Scroll Bar
local pos_height = math.max(hbar/scroll.maxim, limit)
--Bar Scroll
draw.fillrect(950, ybar-2 + ((hbar-pos_height)/(scroll.maxim-1))*(scroll.sel-1), 8, pos_height, color.new(0,255,0))
end

screen.print(955,500,"Plugins: "..toinstall,1,color.white,color.blue, __ARIGHT)

screen.flip()

-------------------------- Controls --------------------------
if buttons.up or buttons.analogly < -60 then scroll:up() end
if buttons.down or buttons.analogly > 60 then scroll:down() end

--if buttons.triangle then update_adrenaline(change) end

--Install selected plugins
if buttons.cross then
if toinstall <= 1 then
plugins_installation(scroll.sel)
else
for i=1, scroll.maxim do
if plugins[i].inst then plugins_installation(i) end
end
os.delay(50)
end
end

--Mark/Unmark
if buttons.square then
dofile("resources/extra.lua")
end
plugins[scroll.sel].inst = not plugins[scroll.sel].inst
if plugins[scroll.sel].inst then toinstall+=1 else toinstall-=1 end
end

if buttons.released.start then break end -- Exit
end
--Clean selected
if buttons.select then
for i=1,scroll.maxim do
plugins[i].inst = false
if toinstall >= 1 then toinstall-=1 end
end
end

--Install ALL plugins
if buttons.triangle then
multi=true
for i=1,scroll.maxim do
plugins_installation(i)
end
end

--Exit
if buttons.released.start then
if change then
os.message("Your PSVita will restart.\n\nThe config.txt backup has been saved to\n\n"..locations[loc].."tai/tai_backup/config.txt",0)
os.delay(250)
power.restart()
end
break
end

end
Loading

0 comments on commit 3220cb8

Please sign in to comment.