Skip to content

Variables

Zackptg5 edited this page Jan 4, 2020 · 8 revisions

Usable Variables (Other than ones in customize.sh)

  • MODPATH - Working directory of installer - where all files are extracted to - equivalent to /data/adb/modules/$MODID in recovery and /data/adb/modules_update/$MODID in magisk manager (BOOTMODE)
  • BOOTMODE - Equal to true if in magisk manager, false otherwise
  • MODID - 'id' from module.prop - the unique identifier for your mod
  • MODULEROOT - The directory containing MODPATH (/data/adb/modules or /data/adb/modules_update)
  • NVBASE - if magisk install - path to magisk files (currently /data/adb)
  • LIBDIR - If DYNAMICLIB=true: Equal to /system/vendor if rom is oreo+, /system otherwise
  • LIBPATCH - Same as libdir but formatted for sed with standard '/' delimiter
  • API - Taken from build.prop. Equal to the API level (android version) of the device (e.g. 21 for Android 5.0)
  • ABILONG - Taken from build.prop. Equal to the ABI version of the device
  • ABI - Taken from build.prop. Equal to the ABI number (first 3 characters of ABILONG) of the device - equal to arm or x86
  • ABI2 - Taken from build.prop. Equal to the ABI2 number of the device (first 3 characters)
  • ARCH - Equal to the cpu architecture of the device - equal to arm, arm64, x86, or x86_64
  • ARCH32 - Equal to the simplified cpu type of the device - equal to arm or x86
  • IS64BIT - Set to 'true' if 64 bit capable device is detected, set to 'false' otherwise
  • ORIGDIR - The original directory for device files (original files unaffected by magisk mounting). Equals $MAGISKTMP/mirror if in BOOTMODE, nothing otherwise (MAGISKTMP=/sbin/.magisk). This is useful if you're copying files from the device to your mod for modification.
  • ORIGVEN - Equal to the original vendor directory. This is more complex than you'd think with magisk or else I wouldn't have it here

Variables for boot scripts (differ slightly from main installer ones)

  • MODID - Same as before
  • LIBDIR - Same as before
  • INFO - Equal to the INFO file (contains a list of all installed files not in magisk mod directory)
  • MODPATH - Equal to module directory
  • MODDIR - Equal to current directory, will be different that $MODPATH if script isn't installed in $MODPATH directory (such as with .core scripts)
Clone this wiki locally