[Request] Dev Help Pretty Please! - Atrix 4G Q&A, Help & Troubleshooting

Ok I'm on the OTA 2.3.4 from a fresh unlocked 4.1.83 no problems what soever and I'm looking to make a few mods when I saw the link posted for the 2.3.4 HDMI Mirror over at
http://forum.xda-developers.com/showthread.php?t=1169457
I went ahead and ran
adb shell
su
mount -o remount,rw /dev/block/mmcblk0p12 /system
sed -ie s/ro.hdmi.mirror.enable=false/ro.hdmi.mirror.enable=true/g /system/build.prop
mount -o remount,ro /dev/block/mmcblk0p12 /system
cd /etc/init.d
cp startXServer.sh startXServer.bak
(head -n 40 startXServer.bak; echo "if [ ! -e /var/run/noWebtop ]; then"; tail -n 12 startXServer.bak; echo "fi") > startXServer.sh
restart your phone
I read through the command and seemed pretty safe and was excited because the post listed the HDMI Mirror as being in "landscape" mode. Hell yeah right! Well it wasn't, it was the same portrait so I was looking to revert back. Go change the build.prop back for the ro.hdmi.mirror to equal false. No big deal that's easy enough with root explorer. Read through the commands and saw that the startXServer.sh was cp to startXServer.bak. Easy enough just delete the startXServer.sh and rename startXServer.bak to .sh.
Well there is the problem. When i ran the commands the first time didn't work so i went into the build.prop and did a manual change. Then re-ran the bottom half. It seems doing that I over wrote the .bak agan and now both files are exactly the same and have no way of reverting. I have the system, boot, and webtop backed up with an .img but that didn't fix my entertainment center when I plug in an HDMI to the TV. The original commands did a back-up so I didn't double back-up the file.lol
I was wondering if a dev that has a little more command line knowledge, maybe the orginal contents of startXServer.sh, or the actual file could help me out with the revert back and a working entertainment center. The current contents are
if [ ! -e /var/run/noWebtop ]
fi
I'm pretty sure that's the problem, unless someone else sees something I'm missing.
**Edit**
This was solved under the Q&A Section from a earlier post yesterday afternoon. Mods please close if necessary. In case any one needs it see below. I just rewrote the startXServer.sh to contain the following.
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi

Related

[Request] startXServer.sh

Would it be possible for someone who is rooted on 2.3.4 to copy the startXServer.sh file in /etc/init.d and post it?
I used the HDMI Mirror hack over in http://forum.xda-developers.com/showthread.php?t=1169457 and for some reason the original one that was backed up in startXServer.bak was overwritten. I think it is the reason I cannot get my media center to work again.
Thanks.
I am on K. Penn's 4.5.91 beta 3, and this file does not exist for me in that location.
CaelanT said:
I am on K. Penn's 4.5.91 beta 3, and this file does not exist for me in that location.
Click to expand...
Click to collapse
Same here....don't have it. Sorry man!
J-man67 said:
Same here....don't have it. Sorry man!
Click to expand...
Click to collapse
Thanks for the look. I appreciate it. I'm on the OTA from the update.zip
it was under the /ect/init.d folder, there is another ect folder in system but that one is different( /system/ect)
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi
Sent from my MB860 using XDA App
Robert Havens said:
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi
Sent from my MB860 using XDA App
Click to expand...
Click to collapse
Thank you very much for this. Worked like a charm. I basically used it to rewrite the .sh file. You're a life saver. MODS please close if needed, unless someone else runs into the same issue.

[Q] How to use string array in init.d script?

I want to make app symlinks to sd-ext on booting.
I made a short init.d script, And It correctly worked on JB based rom.
But after I downgraded to GB, It doesn't work anymore.
I founded that pure bone shell doesn't support arrays.
The script uses string array to declare apk list I want to symlink.
So is there a way to use string array or make similar effect?
Here is my script.
Code:
#!/system/bin/sh
if [ -z "$SD_EXT_DIRECTORY" ]; then SD_EXT_DIRECTORY=/sd-ext; fi
SYSBLOCK=`mount | grep system | cut -f 1 -d ' '`
sysapp2sd=("BackupRestoreConfirmation.apk" "BasicDreams.apk" "Bluetooth.apk" "CertInstaller.apk" "Calculator.apk" "CMFileManager.apk" "CMScreenshot.apk" "DSPManager.apk" "DrmProvider.apk" "Email.apk" "Email2.apk" "Exchange.apk" "Exchange2.apk" "Gmail.apk" "GoogleBackupTransport.apk" "InputDevices.apk" "Music.apk" "OneTimeInitializer.apk" "PhotoTable.apk" "PicoTts.apk" "SamsungTTS.apk" "SharedStorageBackup.apk" "SoundRecorder.apk" "Talk.apk" "ThemeChooser.apk" "ThemeManager.apk" "Torch.apk" "VpnDialogs.apk" "WAPPushManager.apk")
app2sd_exception=("com.UCMobile" "com.adobe.flashplayer" "com.android.lmt" "com.fiberthemax.OpQ2keyboard" "com.fiberthemax.OpQ2keyboard.dict.ko" "com.google.android.gms" "com.google.android.googlequicksearchbox" "com.jungsup.thecall" "com.mobint.hololauncher" "com.mobint.hololauncherplus" "com.mobitobi.android.gentlealarm" "com.myhome.mytheme" "com.rs.autorun" "com.teslacoilsw.launcher" "com.vladlee.callconfirm.free" "eu.chainfire.supersu" "kz.mek.DialerOne" "me.dennis.weather.naver" "net.dinglisch.android.taskerm" "net.everythingandroid.smspopup" )
# make sure $SD_EXT_DIRECTORY is actually mounted
if ! awk -vDIR="$SD_EXT_DIRECTORY" '$2 == DIR { exit 1; }' /proc/mounts ; then
mount -rw -o remount SYSBLOCK /system
mkdir -p /sd-ext/symlink/system/app
# /system/app/ -> /sd-ext/symlink/system/app/
FILES=`find /system/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
for pattern in ${sysapp2sd[@]}; do
if [[ $filename == $pattern ]]; then
cp /system/app/$filename /sd-ext/symlink/system/app/
rm -f /system/app/$filename
ln -s /sd-ext/symlink/system/app/$filename /system/app/$filename
fi
done
done
# /data/app/ -> /sd-ext/symlink/data/app/
FILES=`find /data/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
match=false
for pattern in ${app2sd_exception[@]}; do
if [[ $filename == $pattern* ]]; then
match=true
fi
done
if ! $match; then
cp /data/app/$filename /sd-ext/symlink/data/app/
rm -f /data/app/$filename
ln -s /sd-ext/symlink/data/app/$filename /data/app/$filename
fi
done
mount -r -o remount SYSBLOCK /system
fi
You can use echo or cat command to wrap list and grab it with awk.
and add another for loop over for loop for getting the counted numbers to be used on awk...

[Q] Link2SD and launcher stop to work?

Greetings!
I have tried some ROMs -Ace I SCAPE, REINCARNATION, simplicity v5- and kernels -bieltv 3.0 for cm7, rafael 201211201515- but no matter what, after a few reboots my launcher -that is in the internal memory- and link2SD -that is in the internal memory too- just disappear, I don't know how could I track this since is not consistent -is like after 8-11 reboots-.
I don't have a clue of how to prevent this or what could be triggering it.
PS: Everytime I tried any of the above ROMs with their Kernels, I got back to the stock in ODIN 3.07 then did a fresh clean installation.
Logcat says it all
Try re-creating the case scenario, then using a PC, connect your phone (make sure to enable USB Debugging after the flash) and open a command line (Start->Run->cmd.exe if on windows)
Once open, try the instructions on this thread and upload the logcat here, try to make it as short as possible, I suggest you prepare it all before taking the logcat and once you find the issue, immediately do logcat
Good luck!
El_Dark said:
Logcat says it all
Try re-creating the case scenario, then using a PC, connect your phone (make sure to enable USB Debugging after the flash) and open a command line (Start->Run->cmd.exe if on windows)
Once open, try the instructions on this thread and upload the logcat here, try to make it as short as possible, I suggest you prepare it all before taking the logcat and once you find the issue, immediately do logcat
Good luck!
Click to expand...
Click to collapse
Right after the bug right? Because I wasn't sure if the logcat would explain why is after some reboots and not in the first one.
I'll be updating this post as it happens -usually is "conviently" when I finish installing all of my previous apps, then after 8-10 boots happens-.
sgdva said:
Right after the bug right? Because I wasn't sure if the logcat would explain why is after some reboots and not in the first one.
I'll be updating this post as it happens -usually is "conviently" when I finish installing all of my previous apps, then after 8-10 boots happens-.
Click to expand...
Click to collapse
it's a possible way, but note that it's useless after a reboot lol so it has to be right before you install your apps
El_Dark said:
it's a possible way, but note that it's useless after a reboot lol so it has to be right before you install your apps
Click to expand...
Click to collapse
I installed some apps to see if because I'm installing too many of them are making the phone to cause this -not quite sure if link2SD is working properly-. I had 140 apps before the upgrade -before switching between/roms kernels-, the reason why I upgrade was that I couldn't upgrade from the store the installed apps -it always told me I was running out of memory-.
Anyways, I have tried these days to recrate the scenario , one of the random reboots -when suddenly a message telling Link2SD was not responding- my launcher got out again, when I tried to logcat this by rebooting it worked again
But my whatsapp was gone
Here's the logcat available at paste bin of what I think are the problems:
http://pastebin.com/3jMNX7LV
If needed, I upload the whole thing in box:
https://app.box.com/s/i66rfop429c0wgwldqv4
Anyways I attach the logcat in pastebin
PS: I have read that VFY is missing / replacing in the logcat, for what I have read here
Could be superuser got messed up while flashing the cm7 kernel?
sgdva said:
I installed some apps to see if because I'm installing too many of them are making the phone to cause this -not quite sure if link2SD is working properly-. I had 140 apps before the upgrade -before switching between/roms kernels-, the reason why I upgrade was that I couldn't upgrade from the store the installed apps -it always told me I was running out of memory-.
Anyways, I have tried these days to recrate the scenario , one of the random reboots -when suddenly a message telling Link2SD was not responding- my launcher got out again, when I tried to logcat this by rebooting it worked again
But my whatsapp was gone
Here's the logcat available at paste bin of what I think are the problems:
http://pastebin.com/3jMNX7LV
If needed, I upload the whole thing in box:
https://app.box.com/s/i66rfop429c0wgwldqv4
Anyways I attach the logcat in pastebin
PS: I have read that VFY is missing / replacing in the logcat, for what I have read here
Could be superuser got messed up while flashing the cm7 kernel?
Click to expand...
Click to collapse
Try reflashing... Although the issues I've experienced with Link2SD are usually related to /data/ partition getting full when having too many apps..
If after reflashing, installing Link2SD and linking your apps again you still have issues, download Link2SD again from the Play store, you could also try the following after installing Link2SD and linking your apps: connect your phone to a PC and use adb shell, while the phone boots, once shell is up, do:
Code:
su
cd /data/
ls (make sure here that you have an sdext2 directory, if not, it means Link2SD is not installed properly)
cd sdext2
ls (make sure that you have a dalvik-cache directory in this place, if not, start Link2SD for a
cd /data/dalvik-cache/
for file in data*
do
if [! -h $file] (we make sure it's not a symlink already, you don't want looping links!!!)
cp $file /data/sdext2/dalvik-cache/
rm $file
ln -s /data/sdext2/dalvik-cache/$file $file
fi
done
try that without the text in the parenthesis lol
hope that helps, it could help anyone with space issues in /data/!!
El_Dark said:
All the post above
Click to expand...
Click to collapse
Thanks for being up with this issue!
Well this install is fresh new -is like 2 days long-, I tried the commands you told me but this is what I get
Code:
C:\android-sdk-windows\platform-tools>adb shell
# su
su
# ls
ls
efs
config
cache
sd-ext
sdcard
acct
mnt
vendor
devices
d
etc
fota.rc
init
init.charge.rc
ueventd.rc
data
init.rc
ueventd.goldfish.rc
sbin
lib
init.bcm21553.rc
sys
init.goldfish.rc
proc
recovery.rc
tmp
default.prop
system
res
root
dev
# cd sdext2
cd sdext2
cd: can't cd to sdext2
#
Also I'm not quite sure I understood this line?
El_Dark said:
installing Link2SD and linking your apps again you still have issues, download Link2SD again from the Play store,
Click to expand...
Click to collapse
Do I uninstall and re Install?
sgdva said:
Thanks for being up with this issue!
Well this install is fresh new -is like 2 days long-, I tried the commands you told me but this is what I get
Code:
C:\android-sdk-windows\platform-tools>adb shell
# su
su
[COLOR="Red"]you missed the "cd /data/" part lol[/COLOR]
# ls
ls
efs
config
<<intentionally snipped>>
Also I'm not quite sure I understood this line? Do I uninstall and re Install?
Click to expand...
Click to collapse
Yep, from the Play itself, just in case you're using some local/downloaded version lol, although I doubt it
El_Dark said:
Yep, from the Play itself, just in case you're using some local/downloaded version lol, although I doubt it
Click to expand...
Click to collapse
Ok Thanks for remarking my bad, lol.
Ok I got the dalvik cache folder as you state, though I get an error when typing this line
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> fi
fi
Syntax error: "fi" unexpected (expecting "then")
I thought maybe it was an if, but yeah, isn't a "then" missing for the "if [! -h $file]" that we typed before?
Full code:
Code:
C:\android-sdk-windows\platform-tools>adb shell
# su
su
# cd /data/
cd /data/
# ls
ls
log
dontpanic
cache
misc
local
data
app-private
app
property
fota
anr
dalvik-cache
lost+found
brcm
vt
gps
lcs.socket
rilgps.socket
link2sd-debuggerd.log
link2sd-11link2sd.log
zipalign.db
zipalign.log
aeqcoe.txt
soundbooster.txt
system
secure
backup
cp_data.txt
sdext2
tombstones
# cd sdext2
cd sdext2
# ls
ls
lost+found
data
dalvik-cache
com.whatsapp-1.apk
com.jb.gosms-1.apk
com.opera.mini.android-1.apk
com.imo.android.imoim-1.apk
com.urbandroid.sleep-1.apk
com.urbandroid.sleep.full.key-1.apk
je.fit-1.apk
com.jb.gosms.widget-1.apk
jp.co.johospace.jorte-1.apk
com.c2call.app.android.friendcaller-1.apk
com.skype.raider-1.apk
com.viber.voip-1.apk
com.sds.android.ttpod-1.apk
com.facebook.katana-1.apk
com.google.android.apps.plus-1.apk
com.megacloud.android-1.apk
com.google.android.apps.maps-1.apk
com.plaincode.clinometer-1.apk
org.exobel.routerkeygen-1.apk
es.pulimento.wifi-1.apk
# cd /data/dalvik-cache/
cd /data/dalvik-cache/
# for file in data*
for file in data*
> do
do
> if [! -h $file]
if [! -h $file]
> cp $file /data/sdext2/dalvik-cache/
cp $file /data/sdext2/dalvik-cache/
> rm $file
rm $file
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> fi
fi
Syntax error: "fi" unexpected (expecting "then")
sgdva said:
Ok Thanks for remarking my bad, lol.
Ok I got the dalvik cache folder as you state, though I get an error when typing this line
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> fi
fi
Syntax error: "fi" unexpected (expecting "then")
I thought maybe it was an if, but yeah, isn't a "then" missing for the "if [! -h $file]" that we typed before?
Full code:
Code:
C:\android-sdk-windows\platform-tools>adb shell
# su
su
# cd /data/
cd /data/
# ls
ls
log
dontpanic
cache
misc
local
data
app-private
app
property
fota
anr
dalvik-cache
lost+found
brcm
vt
gps
lcs.socket
rilgps.socket
link2sd-debuggerd.log
link2sd-11link2sd.log
zipalign.db
zipalign.log
aeqcoe.txt
soundbooster.txt
system
secure
backup
cp_data.txt
sdext2
tombstones
# cd sdext2
cd sdext2
# ls
ls
lost+found
data
dalvik-cache
com.whatsapp-1.apk
com.jb.gosms-1.apk
com.opera.mini.android-1.apk
com.imo.android.imoim-1.apk
com.urbandroid.sleep-1.apk
com.urbandroid.sleep.full.key-1.apk
je.fit-1.apk
com.jb.gosms.widget-1.apk
jp.co.johospace.jorte-1.apk
com.c2call.app.android.friendcaller-1.apk
com.skype.raider-1.apk
com.viber.voip-1.apk
com.sds.android.ttpod-1.apk
com.facebook.katana-1.apk
com.google.android.apps.plus-1.apk
com.megacloud.android-1.apk
com.google.android.apps.maps-1.apk
com.plaincode.clinometer-1.apk
org.exobel.routerkeygen-1.apk
es.pulimento.wifi-1.apk
# cd /data/dalvik-cache/
cd /data/dalvik-cache/
# for file in data*
for file in data*
> do
do
> if [! -h $file]
if [! -h $file]
> cp $file /data/sdext2/dalvik-cache/
cp $file /data/sdext2/dalvik-cache/
> rm $file
rm $file
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> fi
fi
Syntax error: "fi" unexpected (expecting "then")
Click to expand...
Click to collapse
heh, nice one, indeed I was missing the "then" after the "if" :silly:
El_Dark said:
heh, nice one, indeed I was missing the "then" after the "if" :silly:
Click to expand...
Click to collapse
So then, lol, is like this?
rm $file
ln -s /data/sdext2/dalvik-cache/$file $file
then
done
sgdva said:
So then, lol, is like this?
rm $file
ln -s /data/sdext2/dalvik-cache/$file $file
then
done
Click to expand...
Click to collapse
nope, it's like this:
Code:
for file in somefile*
do
if [ blablabla ]
then
some actions
fi
done
that's it
El_Dark said:
nope, it's like this:
Code:
for file in somefile*
do
if [ blablabla ]
then
some actions
fi
done
that's it
Click to expand...
Click to collapse
I'm not quite sure what you mean by "some actions" is this a command?
This is how I typed it
> if [! -h $file]
if [! -h $file]
> cp $file /data/sdext2/dalvik-cache/
cp $file /data/sdext2/dalvik-cache/
> rm $file
rm $file
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> then
then
> some actions
some actions
> fi
fi
> done
done
[!: not found
some: not found
[!: not found
cp: '[email protected]@[email protected]' and '/data/
sdext2/dalvik-cache/[email protected]@[email protected]
ex' are the same file
El_Dark said:
Code:
su
cd /data/
ls (make sure here that you have an sdext2 directory, if not, it means Link2SD is not installed properly)
cd sdext2
ls (make sure that you have a dalvik-cache directory in this place, if not, start Link2SD for a
cd /data/dalvik-cache/
for file in data*
do
if [! -h $file] (we make sure it's not a symlink already, you don't want looping links!!!)
[U][B]then[/B][/U]
cp $file /data/sdext2/dalvik-cache/
rm $file
ln -s /data/sdext2/dalvik-cache/$file $file
fi
done
Click to expand...
Click to collapse
quoting myself
El_Dark said:
quoting myself
Click to expand...
Click to collapse
Oh ok, done
For what I can understand everything is supposed to be linked right? hence this is shown "! not found"?
But I'm still not getting why randomly the SSlauncher is not working in some reboots -and when this happens my link2SD gets vanished too and the message low storage is shown-.
Should I make this everytime that happens? -if it happens again?-
Code:
> if [! -h $file]
if [! -h $file]
> then
then
> cp $file /data/sdext2/dalvik-cache/
cp $file /data/sdext2/dalvik-cache/
> rm $file
rm $file
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> fi
fi
> done
done
[!: not found
sgdva said:
Oh ok, done
For what I can understand everything is supposed to be linked right? hence this is shown "! not found"?
But I'm still not getting why randomly the SSlauncher is not working in some reboots -and when this happens my link2SD gets vanished too and the message low storage is shown-.
Should I make this everytime that happens? -if it happens again?-
Code:
> if [! -h $file]
if [! -h $file]
> then
then
> cp $file /data/sdext2/dalvik-cache/
cp $file /data/sdext2/dalvik-cache/
> rm $file
rm $file
> ln -s /data/sdext2/dalvik-cache/$file $file
ln -s /data/sdext2/dalvik-cache/$file $file
> fi
fi
> done
done
[!: not found
Click to expand...
Click to collapse
you shouldn't need to do it every time, mainly when you install new apps, alternatively, you can check the apps' data directories to see which one is consuming a lot of space, you can do that by issuing the commands below:
Code:
su
cd /data/data
du -hc
that should tell you how much space every dir is using (I think, lol)
PS: HIGHLY IMPORTANT!!! You should no longer link dalvik-cache via link2sd with this, or you might experience Force Closes due to the apps' dalvik cache being missing, and I say being missing because if you link a dalvik-cache file that's already linked, Link2SD might move the link and overwrite the physical file, and you'll have a symlink loop

[Q] autostart.sh and u2nl to init.d

How can I add u2nl to init.d? I have an HTC Evo 4g LTE and need to make android 4.3 Viper4g Rom run my script on boot. I've tried to use Root Explorer and Root Browser apps to manually add them to the init.d folder, set permissions and changed owner and group to root. But my phone won't boot after I've added my script. The name of my script file is autostart.sh and this is what it contains.
#!/system/bin/sh
export PATH="$PATH:/system/bin"
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A OUTPUT -o rmnet0 -p 6 ! -d 10.132.25.254 -j REDIRECT --to-port 1025
u2nl 10.132.25.254 8080 127.0.0.1 1025 >/dev/null 2>&1 &
sh -c "sleep 5;kill `ps|grep nk.bla.android.autostart|grep -v grep|awk '{print $2}'`" &
exit 0
I know someone here has the knowledge to make this happen. Please advise and assist. Thanks. P.S. I have tried to rename the script to 99data and placed it init.d directory so it would run last but phone won't boot.?
solcam said:
How can I add u2nl to init.d? I have an HTC Evo 4g LTE and need to make android 4.3 Viper4g Rom run my script on boot. I've tried to use Root Explorer and Root Browser apps to manually add them to the init.d folder, set permissions and changed owner and group to root. But my phone won't boot after I've added my script. The name of my script file is autostart.sh and this is what it contains.
#!/system/bin/sh
export PATH="$PATH:/system/bin"
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A OUTPUT -o rmnet0 -p 6 ! -d 10.132.25.254 -j REDIRECT --to-port 1025
u2nl 10.132.25.254 8080 127.0.0.1 1025 >/dev/null 2>&1 &
sh -c "sleep 5;kill `ps|grep nk.bla.android.autostart|grep -v grep|awk '{print $2}'`" &
exit 0
I know someone here has the knowledge to make this happen. Please advise and assist. Thanks. P.S. I have tried to rename the script to 99data and placed it init.d directory so it would run last but phone won't boot.?
Click to expand...
Click to collapse
have you tried a dummy test script that just echos a number to the sdcard file?
Thanks for replying. The script term-init.sh that I found elsewhere on XDA, had a test and set perms output file that can be found in /data/Test.log. I have solved the problem on my Evo 4g LTE but, not on my Sprint Galaxy S3. Turns out that I couldn't use Root Explorer to manually add the file! I had to REALLY MANUALLY add the file using the terminal emulator. That worked on the Evo but not the S3. I had placed the scripts in one postboot.rc files on S3 and it worked fine but, my battery seemed to be draining a lot faster, which was not acceptable. So I guess my problem is half solved. So, do you know how to make it work on the S3? Thanks in advance to anyone that can help me.

Guide: Fix WhatsApp Images mess after restoring backup

Hey there
Thought this might help some of you finding yourself in a huge mess because WhatApp restores all its media with the date the restore takes place. I wrote a little shellscript you can run in "adb shell". Just paste it into the shell and run it inside WhatsApps Folders.
In "WhatsApp Images" and it's subfolder "Sent" use this:
Code:
for file in *; do
if [ -f "$file" ]; then
timestamp=$(echo "$file" | sed 's/^IMG-\(.*\)-WA\(...\)\(.\)\..*/\10\2\.0\3/g')
echo $timestamp
echo $file
touch -m -t $timestamp $file
fi
done
For "WhatsApp Animated Gifs" and "WhatsApp Video" use this:
Code:
for file in *; do
if [ -f "$file" ]; then
timestamp=$(echo "$file" | sed 's/^VID-\(.*\)-WA\(...\)\(.\)\..*/\10\2\.0\3/g')
echo $timestamp
echo $file
touch -m -t $timestamp $file
fi
done
Keep the following in mind:
- This code works only if your version of Android allows you to change the modified date of files without root. As far as I know this is the case since Andoid 9
- This code doesn't work if you have files with a WA-Number higher than 0599 as my script doesn't take care to match the number with a proper timeformat.
- This code changes the last modified date of your files like this:
Filename: IMG-20190915-WA0039.jpg
Timestamp: 201909150003.09 -> 20190915 00:03:09
Feedbacks and comments welcome
Greets Air

Categories

Resources