ApkBuilder

185 views
Skip to first unread message

Thiemo Melhorn

unread,
Mar 10, 2025, 10:32:50 AMMar 10
to DroidScript
Hello lovelies, 

how can I get the ApkBuilder now? The SPK file that was once made for me in this regard unfortunately no longer works with the new URL. 

Kind regards!

Thiemo Melhorn

unread,
Mar 11, 2025, 4:19:00 PMMar 11
to DroidScript
"use strict"

var edt, txt    // global variables
function OnStart()
{
   var lay = app.CreateLayout("linear", "VCenter,FillXY")
   lay.SetChildMargins( 0.01, 0.01, 0.01, 0.03 )
   var msg = storageIsScoped()+"\n"+
         (app.IsPremium()?"":"Not ")+"Premium"+"\n"+
         app.GetModel()+"\n"+
         app.GetUser()+
         builderInstalled()
   txt = app.AddText( lay, msg, -1, -1, "Left,Multiline" )
   edt = app.AddTextEdit(lay,
      "https://androidscript.org/apk/DroidScript_209/apkbuilder_209.ppk",
      -1,-1,"autoSelect")
   edt.SetOnChange( function (){
   if(this.GetText()=="?")
       this.SetText("http://www.androidscript.org/Plugins/@.zip")
  })
   var btn = app.AddButton(lay, "Install")
   btn.SetOnTouch(btn_OnTouch)
   btn.SetMargins(0.01, 0.05, 0.01, 0.01)
   app.AddLayout(lay)
   
}

function btn_OnTouch()
{
   // url to retrieve plugin file from
   var srcFileUrl = edt.GetText()
   // intermediate file can be read/written by anyone
   var targetDir = app.GetPrivateFolder("temp", "external")

   var dld = app.CreateDownloader();
   dld.SetOnError(dld_OnError);
   dld.SetOnDownload(dld_OnDownload);
   dld.Download(srcFileUrl, targetDir);
}

function dld_OnDownload(path)
{
   // Plugins folder
   var plugs = "/Storage/DroidScript/Plugins"
   // plugs path + filename
   var dest = plugs + "/" + (path.split("/")).pop()
   // default status
   var status = "Copy failed"
   // ensure Plugins folder existd
   app.MakeFolder(plugs)
   // delete destination filevif it exists
   if(app.FileExists(dest)) app.DeleteFile(dest)
   app.CopyFile(path, dest)
   if(app.FileExists(dest))
   {
      //edt.SetText( "" )
      status = "Success:\nPlease restart DroidScript\n\nMake sure all DS windows are closed before restarting"
   }
   app.Alert(status, dest);
}

function dld_OnError(err)
{
   app.Quit("Error:\n"+err)
}

// returns true=Scoped false=Traditional storage
function storageIsScoped() {
   return (app.IsScoped()?"Scoped":"Traditional")+" Storage"
}

function builderInstalled() {
  var msg = "Builder plugin not installed";
  var path = app.GetPrivateFolder("Plugins") +
    "/apkbuilder/ApkBuilder.inc"
  if(app.FileExists(path)) {
    app.LoadPlugin("ApkBuilder");
    msg = "DroidScript Version "+app.GetDSVersion().toFixed(2)
      +"\n"+
      "Builder version " + (new ApkBuilder().GetVersion()).toFixed(2);
  } else if(app.IsAPK()) {
    msg = "Built with " + app.GetDSVersion().toFixed(2);
  }
  return "\n\n"+msg
}









Dave

unread,
Mar 20, 2025, 5:54:46 AMMar 20
to DroidScript
I'd recommend using the latest v2.76 beta3, it's very close to release status and the most up-to-date version available -


You can install the APKBuilder by downloading it to your phone and using the DS file browser to import it into the /DroidScript/Plugins folder, then restarting DS.

Reply all
Reply to author
Forward
0 new messages