as far we know, github blocks raw code usage as http requests by using nosniff attribute. also website named rawgit stopped working too.
right now the only way to access library on github is to use pages feature (note - you need to have administrator access to a repo and be ble to turn on pages for repo with library)
how to do it then?
why does it work? if you make a webpage on github you arent forced to put all your code into single html file. github respects that you might link subfiles to a main index.html or other sub-webpage. when you use a link from pages feature github doesnt have any way to check if you use that library inside page on same repo or outside but because its intended to display pages, even with external files so it cant enable nosniff mode cause otherwise pages could broke (and only index.html site could be then displayed).
and yes - we take android as linux OS (because it IS based on linux, just very modified and might not contain all core commands + google changed filesystem a little).
phone running android might boot in few states. they are : system (only if operating system is properly installed), bootloader/fastboot (common while installing recovery via desktop pc), bootanimation (while operating system throws errors and cant boot it properly) and recovery. default android recovery is a menu to which you can have access by presing buttons when you reboot your phone (usually vol down/up + power) and have options to restore system, update and sometimes even fix it quickly . here we will focus on custom recovery (bootloader-installable) named TWRP (but practically similar method can be used to madify device also with other recoveries, like CWM or even stock/default).
/
data (here are all user apps and data of it)
dev (here structure is same or similar to linux - contains hardware devices stored as files with some drivers)
storage (list of hard drives connected to phone both with internal storage)
root (home user for system administrator. mostly empty)
system (contains system modifications of manufacturer or custom roms, like bootanimation, some apps or fonts. also some hardware device configurations in build.prop and addon.d)
sys (contains kernel and its modules)
cache (contains OS and recovery cache)
mnt (contains list of all mount points and its contents - shortcuts)
sometimes android OS'es might contain also other folders like opt, persist, sdcard and so on. it depends on manufacturer, ROM (even stock roms are different !!! ) and hardware.
system apps (arent deinstallable by default, have some more permissions than apk files or apps installed from stores)
bootanimation.zip
addon.d and build.prop
fonts and ringtones
also deinstalling core apps and installing + modifying busybox (cli tools)
(ofcourse all other parts of android OS are modifiable)
/
META-INF
/
(list of certificates)
com
/
/
android
/
updater-script and update-binary (both are needed)
yes this file structure is very basic. just saying - any of mods you want to install you need to add folders in root zip directory. like:
/
META-INF
sys
system
dev
okey. so now we know basics. lets start programming.
updater-script is made in edify language and managed by update-binary in same directory.
every updater-script ends with empty line and doesn't start with any initial lines like common programming languages (just make file and literally start programming), every commands from these below ends with a semicolon (famous ' ; ' ) and new line.
getprop(property name) - checks for property in build.prop and returns ts value (eg. device name)
mount("filesystem type", "name of partition, mostly EMMC", "path to device file", "place it should be mounted") - mounts specified device as a folder. where it'll will be mounted - it depends on device
is_mounted("mount point") - checks if mount point exist in specified directory
unmount("mount point") - unmounts path from device (removes folder which mount command mounted)
format("filesystem type", "name of partition", "path to current device file") - formats selected partition to other or same type. erases content of partition.
ui_print("text") - displays text in user console.
package_extract_dir("folder in recovery.zip", "folder in system") - extracts folders from recovery.zip to system
package_extract_file("file in recovery.zip", "folder to place file into system") - extracts selected file from recovery.zip to system
symlink("symlink name or path", "file path", "optionally other file pathes", "", "" ... ) - symlinks folders or files to a file
delete("file path") - removes files or empty folders
delete_recursive("folder path") - removes files and folders (even non-empty, including its content)
set_perm("user id", "group id", "user permissions", "group permissions", "file or folder path") - changes user's permissions to files and folders (does NOT include subfolders)
set_perm_recursive("user id", "group id", "user permissions", "group permissions", "file or folder path") - changes user's permissions to files and folders (includes subfolders)
show_progress("size of progressbar defined in fraction", "duration - how long") - shows progress in recovery screen (oftenly at bottom)
set_progress("size of progress") - sets recovery' progressbar to defined size
write_raw_image(image.img , partition) - flashes selected partition (same way as bootloader)
wipe_cache() - resets cache (mostly temporary variables, useful to run when script ends)
abort() - leave script alone and leave it (ends script)
sleep(time) - waits specified time
run_program(program path [program args , , , ]) runs a custom bash script with passed arguments (so you can extend elify to custom linux commands)
read_file(path and name) - returns contents of specified file
for comparing is_mounted() and getprop() you can use double & like here:
is_mounted() && extract_package_dir()
where it checks if is_mounted() returns true and extracts files or
is_mounted() || mount()
where it checks if file is not mounted.
to compare output from getprop() we can compare it to a value and then pass to if condition. like here:
getprop() == device;
device || abort()
will stop if device doesnt match device name.
use these, cause otherwise these actions will become useless...
if you want to make your own update/recovery zip you need to also sign it and properly package (zip file, no compression/store). basic recovery/update zip contents are here (signed) : https://codeberg.org/hacknorris/twrp-template using language above and archive (in store mode).
█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ▒▒ █ ▒▒ █ ▒▒ █████ █ █ █ █ █ █ █ ██ █ ██ █ ███ █ █ █ █ █ █ █ ▒▒ █ ▒▒ █ ▒▒ █████ █ █ █ █ █ █ █ ██ █ ██ █ ███
yet more info? i like xkcd, metallica, retro music and such games too, what for askin more?
yet more? really? take this : website
bottom text