[OPEN-SOURCE PROJECT]Flash Gordon, an Edify to Bash parser/translator written in Java - Java for Android App Development

What is Flash Gordon ?
Basically, Flash Gordon is an app which allows you to flash any flashable zip (except for Roms) without having a recovery installed.
You just point it to the zip you want to flash, (be it a kernel, a mod, gapps...) and it will interpret the updater-script of this package and install its content just like a recovery would.
How does it work ?
Here is what happens step by step :
You tap the "select a zip" button, select the built-in file explorer to select the zip you want to flash
Flash Gordon will first extract this zip, depending on its size it can take a little time
When you press the "Flash Now" button, Flash Gordon will locate the updater-script and start translating it into shell code, line by line
It will output the resulting translated bash script on your sdcard and execute it, thus installing the zip's content
The app creates a notification, just tap on it to reboot
In order to achieve those last 2 steps, I'm writing a full Edify to Bash parser and translator.
Here is the list of all the Edify commands this parser can currently process and what their respective bash translation is (in green), using examples:
(more will be added over time, this is really just a draft)
By no means am I a bash expert, so if you have suggestions for better bash equivalents of any edify commands please post them
Code:
package_extract_file("path/to/source/file.txt", "/path/to/destination/file.txt");
[COLOR="DarkGreen"]busybox cp -fp /path/to/source/file.txt /path/to/destination/file.txt[/COLOR]
package_extract_dir("/source/folder", "/destination/folder");
[COLOR="DarkGreen"]busybox cp -rfp /source/folder/* /destination/folder[/COLOR]
set_perm(0, 2000, 0755, "/file/or/folder");
[COLOR="DarkGreen"]chown 0:2000 /file/or/folder
chmod 0755 /file/or/folder[/COLOR]
set_perm_recursive(0, 2000, 0644, 0755, "/path/to/set/permissions/recursively);
[COLOR="DarkGreen"]chown 0:2000 /path/to/set/permissions/recursively
chown 0:2000 /path/to/set/permissions
chown 0:2000 /path/to/set
chown 0:2000 /path/to
chown 0:2000 /path
chmod 0644 /path/to/set/permissions/recursively
chmod 0755 /path/to/set/permissions
chmod 0755 /path/to/set
chmod 0755 /path/to
chmod 0755 /path[/COLOR]
delete("file/to/delete");
[COLOR="DarkGreen"]busybox rm -f /file/to/delete[/COLOR]
run_program("/script/to/run.sh");
[COLOR="DarkGreen"]sh /script/to/run.sh[/COLOR]
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
[COLOR="DarkGreen"]busybox mount -o rw,remount -t auto /system [I](will soon change to -t mmcblk0p9 or whichever mount point is in the updater-script)[/I][/COLOR]
unmount("/system");
[COLOR="DarkGreen"]busybox mount -o remount,ro /system[/COLOR]
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
"/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
"/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
"/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
"/system/xbin/brctl", "/system/xbin/bunzip2", "/system/xbin/bzcat",
"/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat",
"/system/xbin/catv", "/system/xbin/chattr", "/system/xbin/chgrp",
"/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot",
"/system/xbin/clear", "/system/xbin/cmp", "/system/xbin/comm",
"/as/many/lines/as/you/want");
[COLOR="DarkGreen"]ln -s busybox /system/xbin/[ /system/xbin/[[
/system/xbin/adjtimex /system/xbin/arp /system/xbin/ash
/system/xbin/awk /system/xbin/base64 /system/xbin/basename
/system/xbin/bbconfig /system/xbin/blkid /system/xbin/blockdev
/system/xbin/brctl /system/xbin/bunzip2 /system/xbin/bzcat
/system/xbin/bzip2 /system/xbin/cal /system/xbin/cat
/system/xbin/catv /system/xbin/chattr /system/xbin/chgrp
/system/xbin/chmod /system/xbin/chown /system/xbin/chroot
/system/xbin/clear /system/xbin/cmp /system/xbin/comm
/as/many/lines/as/you/want
(not sure about this one, please correct me if I'm wrong, I could change to [I]ln -s argument/number/1 argument/number/2[/I] as many times as required if needed)[/COLOR]
write_raw_image("/tmp/boot.img", "mmcblk0p5");
[COLOR="DarkGreen"]dd if=/tmp/boot.img of=/dev/block/mmcblk0p5[/COLOR]
This is just a proof of concept for the moment, I'm aiming at adding all the possible Edify commands, and maybe do it backwards (Bash2Edify) in the future, too.
Screenshots
This is from the apk I use for debugging, so the UI is pretty barebones atm, it will quickly evolve to something more fancy and featureful
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Contribute
Flash Gordon is fully Open-Source, and contributions are more than welcome!
You can check-out the full source code on my github at : https://github.com/Androguide/FlashGordon
This app depends on the following Open-Source libraries :
My fork of the CardsUI library by [URL="https://plus.google.com/101314917101345770417/posts"]Nadav Fima[/URL]
aFileChooser by Paul Burke
This project is at a very early stage of development, and I'm looking for help, especially if you're good at one of these things :
regex
java
bash
edify
Even if you're not, don't hesitate to jump in or ask questions about the code if you don't understand.
This is basically the "dev" thread, the general thread is here : http://forum.xda-developers.com/showthread.php?t=2250555

I guess this project died

Related

[APP] [4.0.3+] App Backup (Simple backup app) [update 7/26]

Hello XDA :victory:
I just finished making a simple yet useful backup app for Android 4.0.3+ (Root needed)
It can:
Make a Nandroid backup of the following partitions: /data, /cache, /android-secure, /sd-ext, /system
Copy all user installed APK's into the sdcard
Simple, yes, but somewhat useful
Screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Change log:
7/26
-Option to make a full Nandroid backup
-Changed some GUI
To install:
1. Install this APK.
2. copy this file AND this file to system/bin and set permissions as 655, or run this in adb:
1. "adb push xdevilium_onandroid_data_backup system/bin"
2. "adb push xdevilium_onandroid_backup system/bin"
3. "adb shell chmod 655 system/bin/xdevilium_onandroid_data_backup"
4. "adb shell chmod 655 system/bin/xdevilium_onandroid_backup"
Credits: The creator of "onandroid" script (sorry, i forgot the username )
I see that you are using an old version of Online Nandroid. I would really appreciate if you could keep it upto date.
Btw, great attempt at an app.
ameer1234567890 said:
I see that you are using an old version of Online Nandroid. I would really appreciate if you could keep it upto date.
Btw, great attempt at an app.
Click to expand...
Click to collapse
I can't, sorry, I lost the source code and I'm working on Newgen and XDA ROM HUB now
Is it similar to the "App2zip"?
Two issue, i can download apk file but i can't download other 2 files, i receive a text web page.
Eg:-
echo "##########################################"
echo "XRH Nadroid Data Backup"
echo "* This tool backups /data partition."
echo "* It is fully compatible with nandroid."
echo "* Based on 'onandroid' By Ameer Dawood"
echo "##########################################"
echo ""
# Define constants
path="/sdcard/clockworkmod/backup"
safety=7
name="none"
tz="u"
req_power=10
sdcard_temp_mount="/mnt/sdcard4nandroid"
logfile=/data/local/tmp/onandroid.log
# Logging function
mkdir -p /data/local/tmp
[ -f $logfile ] && busybox rm $logfile
logmsg(){
message="$*"
dtime=`busybox date +%T`
echo -e "$dtime $message"
echo "$dtime $message" >>$logfile
if [ "`busybox which log`" != "" ]; then
log -p i -t onandroid "$message"
fi
}
# Process arguments
if [ $# -gt 0 ]; then
if [ $1 == "--help" ]; then
# Display usage instructions
clear
echo ""
echo "Usage: xrh_backup_script [OPTIONS] [NAME]"
echo ""
Click to expand...
Click to collapse
android addicts said:
Is it similar to the "App2zip"?
Two issue, i can download apk file but i can't download other 2 files, i receive a text web page.
Eg:-
Click to expand...
Click to collapse
Right click, save page as
I'm having trouble getting this to work. Is there anyway you can all the install steps into the app for me
Sent from my SCH-I800 using Tapatalk 2

[SCRIPT] Install an apk file or push a file to sdcard using a right-click

Here's a little script to push a file to the root of your sdcard, by right-clicking on the file and selecting "Send to Android" it save you time if you use swap (app not partition) so you dont need to turn off swap and activate USB mass storage then turn on swap again every time you want to copy a file to sdcard
If the file is an apk file, you have the option to install it or just copy it to your sdcard.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
It uses adb.exe from the Android SDK. It's quite basic, but I guess could be adapted or made more complex quite easily.
Instructions
------------
1. Adding the right-click context menu
Place the pushfile.vbs file somewhere safe on your system.
Edit the .reg file so that the path to the vbs file is correct.
Double click on the .reg file, and accept the changes to the registry.
2. Edit pushfile.vbs
Open up the vbs file using Notepad.
If you already have adb.exe on your system (it's part of the Android SDK), edit line 6 of the file so that it points to your existing adb.exe
If your path has spaces, use double quotes around the whole file path, e.g --> ""C:\Program Files\Android SDK\tools\adb.exe""
Save the file and exit.
If you don't have the Android SDK, copy the adb.exe in the zip file into C:\windows\system32
Edit line 6 of pushfile.vbs so that it looks like this:
Code:
adb = "C:\windows\system32\adb.exe"
Save the file and exit.
Click to expand...
Click to collapse
The download is at the bottom of this post.
Linux users
Create this script in ~/.gnome2/nautilus-scripts/
Call it something sensible like "Send\ to\ Android". Just edit the path to your adb.
Code:
#!/bin/sh
export adb=~/AndroidSDK/tools/adb
export tmp=/tmp/.out
for arg
do
if [ `echo $arg | awk -F "." {'print $2'}` = "apk" ]; then
zenity --question --text="Do you want to install $arg?" --no-wrap --ok-label="Install" --cancel-label="Push to sdcard" --title="Question"
if [ "$(echo $?)" == "0" ]; then
$adb install -r "$arg" 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
done
[ -f $tmp ] && rm -f $tmp
Now you can push files to /sdcard or install apk's by using right-click - scripts - Send to Android
thanks to st0kes Original Thread
Thanks! it could be useful at some point...
Thanks! Very useful.
Sent from my Sensation 4G using xda premium
Good start off point!
even simpler solution
create a .cmd file
Code:
@echo off
path-to-adb.exe push %1 "/mnt/sdcard/external_sd/music/%~n1"
this will let you copy folders for example music albums
place it in %APPDATA%\Microsoft\Windows\SendTo
justsayin' said:
Here's a little script to push a file to the root of your sdcard, by right-clicking on the file and selecting "Send to Android" it save you time if you use swap (app not partition) so you dont need to turn off swap and activate USB mass storage then turn on swap again every time you want to copy a file to sdcard
If the file is an apk file, you have the option to install it or just copy it to your sdcard.
It uses adb.exe from the Android SDK. It's quite basic, but I guess could be adapted or made more complex quite easily.
The download is at the bottom of this post.
Linux users
Create this script in ~/.gnome2/nautilus-scripts/
Call it something sensible like "Send\ to\ Android". Just edit the path to your adb.
Code:
#!/bin/sh
export adb=~/AndroidSDK/tools/adb
export tmp=/tmp/.out
for arg
do
if [ `echo $arg | awk -F "." {'print $2'}` = "apk" ]; then
zenity --question --text="Do you want to install $arg?" --no-wrap --ok-label="Install" --cancel-label="Push to sdcard" --title="Question"
if [ "$(echo $?)" == "0" ]; then
$adb install -r "$arg" 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
done
[ -f $tmp ] && rm -f $tmp
Now you can push files to /sdcard or install apk's by using right-click - scripts - Send to Android
thanks to st0kes Original Thread
Click to expand...
Click to collapse
just what i was looking for :laugh:

Sprint G2 Wifi Tether - sorta working, need help

http://www.androidcoliseum.com/2013/03/how-to-enable-nexus-4-lte-tethering-on.html
This method worked when I input the commands via adb shell. The script didn't seem to take for some reason.
Code:
XanSama on XDA posted
If you log in to the phone via ADB and as root (either via "adb root" command, or via "su" from the shell) execute the commands listed here the tethering will work. Test it yourself.
If you want a persistent fix you have two options:
1) If you have a custom kernel installed, create a script in /system/etc/init.d that executes the commands from the post above (don't forget to set the permissions to executable!).
2) Install a program like Script Manager from the market, create a script using the commands from the post above, and tell it to execute the script at startup with root permissions.
Currently I'm running a rooted stock ROM with stock kernel, so I'm using Script Manager, and it's working perfectly.
Here's the script I'm using right now:
#!/system/bin/sh
iptables -A bw_FORWARD -i !lo+
iptables -A natctrl_FORWARD -j RETURN -i rmnet+ -o wlan0 -m state --state RELATED,ESTABLISHED
iptables -A natctrl_FORWARD -j DROP -i wlan0 -o rmnet+ -m state --state INVALID
iptables -A natctrl_FORWARD -j RETURN -i wlan0 -o rmnet+
iptables -A natctrl_FORWARD -j DROP
iptables -A natctrl_nat_POSTROUTING -t nat -o rmnet+ -j MASQUERADE
And now here's how I easily did it on my own. First thing you'll need is a script editor as XanSama said. I used the scripter that came inside Rom Toolbox pro.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Did you ever get it to work?
calvin269 said:
Did you ever get it to work?
Click to expand...
Click to collapse
WiFi tethering starts, however it won't broadcast the said. Actually quite common with this app.
Sent from my LG-LS980 using Tapatalk
WiFi tether works on Carbon ROM in the general section, Sprint testers 4.3.1 ROM grab Verizon's G2 PA Gaps 11/2
chris0160 said:
WiFi tether works on Carbon ROM in the general section, Sprint testers 4.3.1 ROM grab Verizon's G2 PA Gaps 11/2
Click to expand...
Click to collapse
Has anyone tried this?
snoopdog said:
Has anyone tried this?
Click to expand...
Click to collapse
Yes it works
Sent from my LG-LS980 using xda app-developers app
Anyone know of any progress on this?

Change the factory mode to user mode

I have this problem:crying::crying::crying::
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I try this but not work (i dont have the folder or the files):
Code:
su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot
Also installed bootloader, karnel and a modem... Noting works
HELP PLEASE:crying:
Punk44 said:
I have this problem:crying::crying::crying::
I try this but not work (i dont have the folder or the files):
Code:
su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot
Also installed bootloader, karnel and a modem... Noting works
HELP PLEASE:crying:
Click to expand...
Click to collapse
Hi mate,
Check out the video and follow the instructions , check also the XDA thread for more detail help
https://www.youtube.com/watch?v=d8dbrerUacw
http://forum.xda-developers.com/showthread.php?t=2335692
I dont have the files or the folders, my efs folder are empty. And i use ES file manager or root explorer....
Punk44 said:
I dont have the files or the folders, my efs folder are empty. And i use ES file manager or root explorer....
Click to expand...
Click to collapse
Did you check the XDA thread?
MAX 404 said:
Did you check the XDA thread?
Click to expand...
Click to collapse
Yes, not work for me, the efs was desmount.
I GOT IT :laugh:
For people with the same problem:
1- Install / use Terminal Emulator
2- mount -r -w -o remount,rw -t ext4 /dev/block/mmcblk0p10
3- mke2fs /dev/block/mmcblk0p10
4- mount -r -w -o remount,rw -t ext4 /dev/block/mmcblk0p10 /efs
5- Reboot
Thanks
Punk44 said:
Yes, not work for me, the efs was desmount.
I GOT IT :laugh:
For people with the same problem:
1- Install / use Terminal Emulator
2- mount -r -w -o remount,rw -t ext4 /dev/block/mmcblk0p10
3- mke2fs /dev/block/mmcblk0p10
4- mount -r -w -o remount,rw -t ext4 /dev/block/mmcblk0p10 /efs
5- Reboot
Click to expand...
Click to collapse
Only for root Roms ?
Thank you for your info :good:

Minfree script to /etc/init.d

Please script to /etc/init.d to set the minfree. I don't want any application, I want the script to autostart.
The script will be ok? I'm not asking about the value.
Code:
#!/system/bin/sh
#Created by hinxnz
#Set Minfree and Adj values
bb=$(find /system/ -name 'swapon')
if [ -n "$bb" ] && [ -e "$bb" ] ; then
bb=${bb%/*}
cd $bb
./busybox chmod 664 /sys/module/lowmemorykiller/parameters/minfree
./busybox echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
./busybox chmod 444 /sys/module/lowmemorykiller/parameters/adj
./busybox chmod 664 /sys/module/lowmemorykiller/parameters/minfree
./busybox echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
./busybox chmod 444 /sys/module/lowmemorykiller/parameters/minfree
fi
Tell someone? The above and below are not working:
Code:
echo "0,1,2,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
echo "5120,7680,11520,15360,20480,25600" > /sys/module/lowmemorykiller/parameters/minfree
This is the Nexus 7 2013 forum. I think you want this thread.
I know that this forum Nexus 7 2013. To him I need a script.
WSZR said:
I know that this forum Nexus 7 2013. To him I need a script.
Click to expand...
Click to collapse
Does the kernel you are using support init.d? What kernel?
If you have a kernel that supports it, is the perms set so it can execute? is it getting executed at all at startup?, maybe have it echo a value into a file to make sure it is getting executed. Does it execute and work if you run it manually?
I use ElementalX, supports init.d. BusyBox installed. In the terminal script "echo" works. Changing "minfree" in applications "Kernel Tweaker" works.
I can't verify startup. I tried the script from entering text into a blank file, not be made.
Code:
echo test > /data/data/file
In "init.d" is script to configure the kernel and perhaps to perform.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I don't know how to manage permissions in "init.d". File with the script I gave full permissions. A postscript of permissions must be before the script?
The script is executed:
Code:
#!/system/bin/sh
chmod 664 /data/data/file
echo test > /data/data/file
chmod 444 /data/data/file
I'll try to convert to "minfree".
WSZR said:
I use ElementalX, supports init.d. BusyBox installed. In the terminal script "echo" works. Changing "minfree" in applications "Kernel Tweaker" works.
I can't verify startup. I tried the script from entering text into a blank file, not be made.
Code:
echo test > /data/data/file
In "init.d" is script to configure the kernel and perhaps to perform.
I don't know how to manage permissions in "init.d". File with the script I gave full permissions. A postscript of permissions must be before the script?
Click to expand...
Click to collapse
I use the same kernel.
The script for minfree that you try to run from init.d, did you set the perms to 777 on it? It sounds like you have, but I am just making sure.
Have you tried appending the lines (from your post #2 above), to /etc/init.d/99elementalx to see if they get executed?
Something else to try:
Backup 99elementalx first, then try placing these lines in 99elementalx at the bottom, just above "exit 0". (This assumes you have the binary busybox in /system/xbin (you should, it's the proper place for it for this device), or a path that is in your $PATH environment.)
Code:
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
chmod 444 /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
chmod 444 /sys/module/lowmemorykiller/parameters/minfree
#test to see if executed
echo test > /sdcard/minfreetest.txt
Reboot, and see if there is the word test in /sdcard/minfreetest.txt.
If so, cat your minfree and adj files and see if they have your desired values.
mdamaged said:
I use the same kernel.
The script for minfree that you try to run from init.d, did you set the perms to 777 on it? It sounds like you have, but I am just making sure.
Have you tried appending the lines (from your post #2 above), to /etc/init.d/99elementalx to see if they get executed?
Something else to try:
Backup 99elementalx first, then try placing these lines in 99elementalx at the bottom, just above "exit 0". (This assumes you have the binary busybox in /system/xbin (you should, it's the proper place for it for this device), or a path that is in your $PATH environment.)
Code:
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
chmod 444 /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
chmod 444 /sys/module/lowmemorykiller/parameters/minfree
#test to see if executed
echo test /sdcard/minfreetest.txt
Reboot, and see if there is the word test in /sdcard/minfreetest.txt.
If so, cat your minfree and adj files and see if they have your desired values.
Click to expand...
Click to collapse
When added to 99elementalx script works.
Strange that in a separate file does not work, even though other scripts are running.
Thanks for your help.
WSZR said:
When added to 99elementalx script works.
Strange that in a separate file does not work, even though other scripts are running.
Thanks for your help.
Click to expand...
Click to collapse
Well try this.
Comment out those lines from 99elementalx and create a new file /etc/init.d/98minfree
Put the contents in it below:
Code:
#!/system/bin/sh
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
chmod 444 /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
chmod 444 /sys/module/lowmemorykiller/parameters/minfree
#test to see if executed
echo newtest > /sdcard/minfreetest.txt
save it as /etc/init.d/98minfree ...then chmod it 777 (rwxrwxrwx), then reboot, and see if it worked.
If you have to leave it in 99elementalx to make it work, it will get wiped the next time you flash the kernel again. Alternatively, you can just forget init.d, and use tasker to execute the commands.

Categories

Resources