Skip to content

Commit

Permalink
migrated to vim v8.2.4564
Browse files Browse the repository at this point in the history
  • Loading branch information
mirsella committed Mar 16, 2022
1 parent 6167a6a commit 1fc7505
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 29 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Nano for Android NDK
### osm0sis @ xda-developers
*Static ARM nano binary for Android built with the NDK*
# vim for Android NDK
vim version of osm0sis's vim-ndk modules, all credits to him.
### [osm0sis nano-ndk](https://github.com/Magisk-Modules-Repo/nano-ndk)
the vim binary i used is from Zackptg5 : [Cross-Compiled-Binaries-Android](https://github.com/Zackptg5/Cross-Compiled-Binaries-Android)

### Links
* [GitHub](https://github.com/Magisk-Modules-Repo/nano-Installer)
* [Support](https://forum.xda-developers.com/showthread.php?t=2239421)
* [Sponsor](https://github.com/sponsors/osm0sis)
* [Donate](https://www.paypal.me/osm0sis)
check convert-to-vim.zsh to see the steps

### Description
A simple installer to push my own static Android ARM build of the nano editor binary to /system/xbin/ along with the required files in /system/etc/terminfo/, and a wrapper with optional --term parameter to choose your terminfo profile. Detects and supports "systemless" install via SuperSU/Magisk as well. It can then be used from Terminal while booted from that point on.
A simple installer to push static Android ARM build of the vim editor binary to /system/xbin/ along with the required files in /system/etc/terminfo/, and a wrapper with optional --term parameter to choose your terminfo profile. Detects and supports "systemless" install via SuperSU/Magisk as well. It can then be used from Terminal while booted from that point on.

Each time you flash in recovery it also temporarily enables use in recovery by pushing a script to /sbin/nano with the required environment variables, so you can then trigger it from recovery shell or the console in amarullz' brilliant AROMA Filemanager. Makes it extremely easy and worry-free to tweak and mod on the go, knowing you can edit the faulty build.prop or init.d script if something goes wrong.
Each time you flash in recovery it also temporarily enables use in recovery by pushing a script to /sbin/vim with the required environment variables, so you can then trigger it from recovery shell or the console in amarullz' brilliant AROMA Filemanager. Makes it extremely easy and worry-free to tweak and mod on the go, knowing you can edit the faulty build.prop or init.d script if something goes wrong.
Binary file removed bin/nano.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions bin/nano → bin/vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/system/bin/sh
# nano: wrapper to set up and run nano from terminal
# vim: wrapper to set up and run vim from terminal
# osm0sis @ xda-developers

dir="$(cd "$(dirname "$0")"; pwd)";
Expand All @@ -13,5 +13,5 @@ fi;

clear;
resize >/dev/null 2>&1;
TERMINFO=$dir/../etc/terminfo TERM=$term $dir/nano.bin "$@";
TERMINFO=$dir/../etc/terminfo TERM=$term $dir/vim.bin "$@";

Binary file added bin/vim.bin
Binary file not shown.
22 changes: 22 additions & 0 deletions convert-to-vim.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
mv README.md README.md.bak
mv convert-to-vim.zsh convert-to-vim.zsh.bak
git fetch https://github.com/Magisk-Modules-Repo/nano-ndk master
git reset --hard FETCH_HEAD
mv README.md.bak README.md
mv convert-to-vim.zsh.bak convert-to-vim.zsh
wget 'https://github.com/Zackptg5/Cross-Compiled-Binaries-Android/raw/master/vim/vim-arm64' -O bin/vim.bin
vimversion=$(curl -s 'https://raw.githubusercontent.com/Zackptg5/Cross-Compiled-Binaries-Android/master/README.md' | rg '\* Vim \(' | sed 's#* Vim (##; s#)##')
vimversioncode=$(sed 's#v##; s#\.##g' <<< $vimversion)
rm bin/nano.bin
fd -E convert-to-vim.zsh -E README.md -t f -x sed -i 's/nano/vim/gi' {}
fd 'nano$' -x mv {} {//}/vim
sed -i 's#nano#vim#gi; s#author=#author=mirsella'\''s fork of #' module.prop
sed -i 's#version=.*#version='$vimversion'#; s#versionCode=.*#versionCode='$vimversioncode'#' module.prop
git add -A
git commit -m "migrated to vim $vimversion"
git push -f origin master
zip magisk-vim-ndk.zip $(fd -t f)
gh config set prompt disabled
gh release create "$vimversion" magisk-vim-ndk.zip -t "vim $vimversion (automatic release ⚠️)"
gh config set prompt enabled
rm magisk-vim-ndk.zip
12 changes: 6 additions & 6 deletions diffusion_config.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Diffusion Installer Config
# osm0sis @ xda-developers

INST_NAME="Nano Installer Script";
INST_NAME="vim Installer Script";
AUTH_NAME="osm0sis @ xda-developers";

USE_ARCH=false
Expand All @@ -21,13 +21,13 @@ custom_target() {

custom_install() {
ui_print " ";
ui_print "Installing nano to $BIN ...";
ui_print "Installing vim to $BIN ...";
ui_print "Installing terminfo to $ETC ...";
set_perm 0 0 755 $BIN/nano $BIN/nano.bin;
set_perm 0 0 755 $BIN/vim $BIN/vim.bin;
if ! $BOOTMODE; then
ui_print "Installing nano recovery script to /sbin ...";
ui_print "Installing vim recovery script to /sbin ...";
cp -rf sbin/* /sbin;
set_perm 0 0 755 /sbin/nano;
set_perm 0 0 755 /sbin/vim;
fi;
}

Expand All @@ -50,7 +50,7 @@ custom_cleanup() {
custom_exitmsg() {
if ! $BOOTMODE && [ "$ACTION" == installation ]; then
ui_print " ";
ui_print "nano may now be run temporarily from";
ui_print "vim may now be run temporarily from";
ui_print "terminal/adb shell for this recovery session,";
ui_print "and from now on in booted Android.";
fi;
Expand Down
12 changes: 6 additions & 6 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
id=nano-ndk
name=Nano for Android NDK
version=6.0
versionCode=6000
author=osm0sis @ xda-developers
description=Static ARM nano binary for Android built with the NDK
id=vim-ndk
name=vim for Android NDK
version=v8.2.4564
versionCode=824564
author=mirsella's fork of osm0sis @ xda-developers
description=Static ARM vim binary for Android built with the NDK
support=https://forum.xda-developers.com/showthread.php?t=2239421
donate=https://www.paypal.me/osm0sis
template=1500
10 changes: 5 additions & 5 deletions sbin/nano → sbin/vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/sbin/sh
# nano: set up and run nano from recovery/terminal
# vim: set up and run vim from recovery/terminal
# osm0sis @ xda-developers

(mount /data;
Expand Down Expand Up @@ -28,13 +28,13 @@ if [ "$suimg" ]; then
losetup -d $loop 2>/dev/null;
fi;
fi;
[ $mnt == /magisk ] && magisk=/nano-ndk/system;
[ $mnt == /magisk ] && magisk=/vim-ndk/system;
etc=$mnt$magisk/etc;
bin=$mnt$magisk/bin;
else
mnt=$(dirname `find /data -name supersu_is_here | head -n1`);
[ -e /data/adb/modules ] && mnt=/data/adb/modules/nano-ndk/system;
[ -e /data/adb/modules_update ] && mnt=/data/adb/modules_update/nano-ndk/system;
[ -e /data/adb/modules ] && mnt=/data/adb/modules/vim-ndk/system;
[ -e /data/adb/modules_update ] && mnt=/data/adb/modules_update/vim-ndk/system;
if [ -e "$mnt" ]; then
etc=$mnt/etc;
bin=$mnt/bin;
Expand All @@ -54,5 +54,5 @@ else
fi;

clear;
TERMINFO=$etc/terminfo TERM=$term $bin/nano.bin "$@";
TERMINFO=$etc/terminfo TERM=$term $bin/vim.bin "$@";

0 comments on commit 1fc7505

Please sign in to comment.