[Q]zipalign on boot code - Hero, G2 Touch General

Hey there
I just found out that robocik zipalign on boot code was as same as maxisma ones
robocik​
Code:
#!/system/bin/sh
# Automatic ZipAlign by Wes Garner
# ZipAlign files in /data that have not been previously ZipAligned (using md5sum)
# Thanks to oknowton for the changes
# Changelog:
# 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
# 1.0 (11/30/09) Original
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /system/sd/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
else
echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
Maxisma​
Code:
#!/system/bin/sh
echo "++++ ZIP ALIGNMENT PROCESS STARTING ++++"
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting DC Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC | tee -a $LOG_FILE;
fi;
else
echo DCZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo "++++ ZIP ALIGNMENT PROCESS FINISHED ++++"
I have bold the differences between this two codes
So are this two codes work the same? Does it need /system/bin/sh in order to run the command line? If I change the #!/system/bin/sh (the first line) to #!/system/xbin/bash,will it work too? If I have don't have the bash file in /system/xbin/ ,will it work too? Are bash and sh the same?
BTW,erasmux's boot OC pack also included a 09betterzipalign in it (he said it wasn't his)
Here is the code
Code:
#!/system/xbin/bash
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
SYSTEM=$(mount|grep "/system "|awk '{ print $1 }')
function mountrw {
mount | grep "/system " | grep rw >/dev/null || mount -o remount,rw $SYSTEM /system
}
function mountro {
mount | grep "/system " | grep ro >/dev/null || mount -o remount,ro $SYSTEM /system
}
[ -e $LOG_FILE ] && rm $LOG_FILE
[ -f $ZIPALIGNDB ] || touch $ZIPALIGNDB
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app /data/app-private ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
mountrw
cp -f -p /cache/$APK $APK
rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
mountro
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
the first line is #!/system/xbin/bash,so it needs the bash file in the /system/xbin folder in order to work,rite? Is it the same as robocik and maxisma code?

What is this?
make something clear!!

robocik's script looks for apks to zipalign at "/system/sd/app/"
while Maxisma's looks at "/data/app/"
When looking at the dirs, robably robocik's mounts things as well in another script. Maybe apps2sd?
The first long line is quite unimportant, it just states "hey I'm zipalign and ready to work", with different names/texts.
I believed bash was based on sh, can't tell for sure. I always learned to follow the sh guidelines to get max compability. Maybe some linux-expert can tell you for sure, or just try to google it a little

riemervdzee said:
robocik's script looks for apks to zipalign at "/system/sd/app/"
while Maxisma's looks at "/data/app/"
When looking at the dirs, robably robocik's mounts things as well in another script. Maybe apps2sd?
The first long line is quite unimportant, it just states "hey I'm zipalign and ready to work", with different names/texts.
I believed bash was based on sh, can't tell for sure. I always learned to follow the sh guidelines to get max compability. Maybe some linux-expert can tell you for sure, or just try to google it a little
Click to expand...
Click to collapse
After some hours of research,I found out most of the ROM in XDA all include sh file (I didn't check all of it but most of them included sh file) but not all included bash file (10 out of 4 rom included bash file),this means in order to run the code,I need bash file in xbin (did a adb logcat and found out a line that says busybox runparts - blah blah blah /system/etc/init.d/09betterzipalign [the one that has #!/system/xbin/bash line on it] error running something like that)
BTW,robocik and maxisma one are almost the same,how can robocik ones can zipalign /system/sd/app/,he didn't change the code or anything,just type in the log file,thats all...
One more thing,y can't we run zipalign-on-boot on all the apps that were installed through the Android Market or wasn't installed on the /data/app?

Ng LC said:
Hey there
I just found out that robocik zipalign on boot code was as same as maxisma ones
robocik​
Code:
#!/system/bin/sh
# Automatic ZipAlign by Wes Garner
# ZipAlign files in /data that have not been previously ZipAligned (using md5sum)
# Thanks to oknowton for the changes
# Changelog:
# 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
# 1.0 (11/30/09) Original
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /system/sd/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
else
echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
Maxisma​
Code:
#!/system/bin/sh
echo "++++ ZIP ALIGNMENT PROCESS STARTING ++++"
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting DC Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC | tee -a $LOG_FILE;
fi;
else
echo DCZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo "++++ ZIP ALIGNMENT PROCESS FINISHED ++++"
I have bold the differences between this two codes
So are this two codes work the same? Does it need /system/bin/sh in order to run the command line? If I change the #!/system/bin/sh (the first line) to #!/system/xbin/bash,will it work too? If I have don't have the bash file in /system/xbin/ ,will it work too? Are bash and sh the same?
BTW,erasmux's boot OC pack also included a 09betterzipalign in it (he said it wasn't his)
Here is the code
Code:
#!/system/xbin/bash
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
SYSTEM=$(mount|grep "/system "|awk '{ print $1 }')
function mountrw {
mount | grep "/system " | grep rw >/dev/null || mount -o remount,rw $SYSTEM /system
}
function mountro {
mount | grep "/system " | grep ro >/dev/null || mount -o remount,ro $SYSTEM /system
}
[ -e $LOG_FILE ] && rm $LOG_FILE
[ -f $ZIPALIGNDB ] || touch $ZIPALIGNDB
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app /data/app-private ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
mountrw
cp -f -p /cache/$APK $APK
rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
mountro
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
the first line is #!/system/xbin/bash,so it needs the bash file in the /system/xbin folder in order to work,rite? Is it the same as robocik and maxisma code?
Click to expand...
Click to collapse
Thanks mate, getting this error
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 24: tee: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 15: tee: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 16: basename: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 15: basename: command not found
Any idea?

Related

[DEV/TOOL] Automated(ish) T-Mobile Theme Generator

A script I've been working on for a couple of days. Still a work in progress so if you suck less, I could use improvements. It's real simple:
** Put this script in a stock theme template like Cyanbread
1.) Place a source ROM you want to theme for, the base ROM/THROM you're taking images from and a stock theme template (like Cyanbread) and set them in the script at the top.
2.) Modify the script as needed (it's not done as of this writing) and set verbosity out the output, etc.
2.) Run the script and it will do the work
The code should be pretty self explanatory and I'll update it as I go. Just about finished at this point.
Screenshot shows you what it does
Code:
#!/bin/bash
# ------------------------- Set theme name TODO
# themeName=$(cat Android.mk | grep LOCAL_PACKAGE_NAME | sed 's/^LOCAL_PACKAGE_NAME\s:=\s//g')
# read -p "Enter theme name. Enter for default [$themeName]: " REPLY
# REPLY=${REPLY:-$themeName}
# echo "Theme name is $themeName"
# ------------------------- for testing to spare the parameters
SRCROM="ABSOLUTE/PATH/TO/ROOT/OF/SOURCEROM"
BASEROM="ABSOLUTE/PATH/TO/ROOT/OF/BASEROM/YOURE/THEMING/FOR"
# my example:
# SRCROM=~/GBSense2.1/
# BASEROM=~/cm_glacier_full-42/
# running this script from ~/haxzamatic-Templatebread--918313e/
DSTROM=$(pwd)
LOGFILE=$DSTROM/logfile.log
decompile_rom(){
cd $1/app
if [ ! -d $1/app/Browser/ ]; then # need apktool for drawables
#apktool if framework/framework_res.apk
#if [ -e framework/com.htc.resources.apk ]; then
# apktool if framework/com.htc.resources.apk
#fi
for i in `ls $1/app/*.apk`; do echo "Decompiling $i"; apktool d $i; done
cd ../framework
for i in `ls $1/framework/*.apk`; do echo "Decompiling $i"; apktool d $i; done
else
echo "Already decompiled"
fi
}
decompile_rom $SRCROM/system
decompile_rom $BASEROM/system
cd $DSTROM
rm $DSTROM/res/xml/*.xml
echo "" > appendleftovers.tmp
# ------------------------- Log file purge and title
cat <<EOF > $LOGFILE
*********************************************************
Missing files from $SRCROM
*********************************************************
EOF
# ------------------------- Redirections.xml
cat <<EOF > res/xml/redirections.xml
<?xml version="1.0" encoding="utf-8"?>
<theme-redirections
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pluto="http://www.w3.org/2001/pluto.html">
EOF
# ------------------------- Android.xml
echo "<resource-redirections>">$DSTROM/res/xml/android.xml
# ------------------------- Main Loop
find "$BASEROM" -type f -name "*.png" | while read fimg; do
# ------------------------- Base Params
FIMGFNAME=$(cat $(dirname $fimg)"/../../apktool.yml" | grep "apkFileName" | sed 's/apkFileName:\s//g' | sed 's/\.apk//g' )
FIMGPNAME=$(cat $(dirname $fimg)"/../../AndroidManifest.xml" | grep "package" | tr " " "\n" | grep package= | cut -d \" -f 2)
if [ $FIMGPNAME = "android" ]; then FIMGPNAME=framework_res; fi
FIMGDNAME=$(echo $(dirname $fimg) | sed "s/\(.*\)\///" )
cd $DSTROM
if [ "$FIMGFNAME" = "framework-res" ] || [ "$FIMGFNAME" = "com.htc.resources" ]; then wp="framework"
else wp="app"
fi
# -------------------------
SRCFILEPATH=$SRCROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
SRCFILENAME=$(echo $(basename $fimg))
DSTFILEPATH=$DSTROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
DSTFILENAME=$(echo $(echo $FIMGPNAME|sed 's/\./_/g')"_$(basename $fimg)")
BSEFILEPATH=$BASEROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
BSEFILENAME=$(echo $(basename $fimg))
# -------------------------
[ -d res ] || mkdir res
[ -d res/$FIMGDNAME ] || mkdir res/$FIMGDNAME
# -------------------------
if [ -f $SRCFILEPATH$SRCFILENAME ]; then
echo "cp $SRCFILEPATH$SRCFILENAME $DSTROM/res/$FIMGDNAME/$DSTFILENAME"
cp $SRCFILEPATH$SRCFILENAME $DSTROM/res/$FIMGDNAME/$DSTFILENAME
# ------------------------- Redirections.xml
thispname=$(cat $(dirname $fimg)"/../../AndroidManifest.xml" | grep "package" | tr " " "\n" | grep package= | cut -d \" -f 2)
if ! grep -iq $thispname $DSTROM/res/xml/redirections.xml ; then
echo "<package-redirections android:name=\"$thispname\" android:minSdkVersion=\"7\" android:resource=\"@xml/$(echo $thispname|sed 's/\./_/g')\" />" >>$DSTROM/res/xml/redirections.xml
fi
# ------------------------- Android.xml
drawrsrc=$(echo $SRCFILENAME | sed 's/\(.*\)\..*/\1/' | sed 's/\.9//g')
drawrdst=$(echo $DSTFILENAME | sed 's/\(.*\)\..*/\1/' | sed 's/\.9//g')
echo "<item name=\"@drawable/$drawrsrc\">@drawable/$drawrdst</item>" >>$DSTROM/res/xml/android.xml
# ------------------------- Package Redirections
drawrfnamenoext=$(echo $drawrsrc | sed 's/\./_/g')
dstfilenameparsed=$(echo $drawrdst | sed 's/\./_/g')
dstredirfname=`echo "$DSTROM/res/xml/$(echo $FIMGPNAME | sed 's/\./_/g').xml"`
if [ ! -f $dstredirfname ]; then
cat <<EOF > $dstredirfname
<?xml version="1.0" encoding="utf-8"?>
<resource-redirections>
EOF
echo "$dstredirfname" >> appendleftovers.tmp
fi
echo "<item name=\"drawable/$drawrfnamenoext\">@drawable/$dstfilenameparsed</item>" >>$dstredirfname
else
echo "[MISSING]: $SRCFILEPATH$SRCFILENAME" >> $LOGFILE
#echo "1.) $fimg" >> $LOGFILE
#echo "2.) $FIMGFNAME" >> $LOGFILE
#echo "3.) $FIMGPNAME" >> $LOGFILE
#echo "4.) $FIMGDNAME" >> $LOGFILE
#echo "5.) $SRCFILEPATH" >> $LOGFILE
#echo "6.) $SRCFILENAME" >> $LOGFILE
#echo "7.) $DSTFILEPATH" >> $LOGFILE
#echo "8.) $DSTFILENAME" >> $LOGFILE
#echo "9.) $BSEFILEPATH" >> $LOGFILE
#echo "10.)$BSEFILENAME" >> $LOGFILE
#echo "------------------------------" >> $LOGFILE
fi
# echo "1.) $fimg"
# echo "2.) $FIMGFNAME"
# echo "3.) $FIMGPNAME"
# echo "4.) $FIMGDNAME"
# echo "5.) $SRCFILEPATH"
# echo "6.) $SRCFILENAME"
# echo "7.) $DSTFILEPATH"
# echo "8.) $DSTFILENAME"
# echo "9.) $BSEFILEPATH"
# echo "10.)$BSEFILENAME"
# echo "------------------------------"
# ------------------------- Example output:
# 1.) ~/cm_glacier_full-42/system/app/Browser/res/drawable-hdpi/fav_icn_background.png
# 2.) Browser
# 3.) com.android.browser
# 4.) drawable-hdpi
# 5.) ~/GBSense2.1/system/app/Browser/res/drawable-hdpi/
# 6.) fav_icn_background.png
# 7.) ~/haxzamatic-Templatebread--918313e/system/app/Browser/res/drawable-hdpi/
# 8.) com_android_browser_fav_icn_background.png
# 9.) ~/cm_glacier_full-42/system/app/Browser/res/drawable-hdpi/
# 10.)fav_icn_background.png
done
# ------------------------- Close out the XML tags
echo "</resource-redirections>">>$DSTROM/res/xml/android.xml
echo "</theme-redirections>">>$DSTROM/res/xml/redirections.xml
cat $DSTROM/appendleftovers.tmp | while read thistmp; do
echo "</resource-redirections>" >> $thistmp
done
rm $DSTROM/appendleftovers.tmp
echo "FINISHED:::::::::::::::::::::::::::::::::::::::::::::::::::::::"
reserved for spam

Tizen

As tizen source is available now I wondered if anyone has taken a look at it yet.
I prepared my machine to start building it and test it.
Will publish updates in this thread.
Sent from my GT-I9300 using xda premium
Another mobile OS. Like there isnt enough already.
Subscribe
Tapatalk 2-vel küldve az én GT-I9300-ről
As far as I have read the new phone with Tizen which Samsung will release (i9500) uses the i9300 modem.
Looking at the structure, used kernel etc now.
For building a kickstart file is used, it is looking like this:
Code:
# -*-mic2-options-*- -f loop [email protected]@-rs.tar.gz -*-mic2-options-*-
#
# Do not Edit! Generated by:
# kickstarter.py
#
lang en_US.UTF-8
keyboard us
timezone --utc America/Los_Angeles
# ROOT fs partition
#part / --size=800 --ondisk mmcblk0p --fstype=ext4 --label=platform
# Use larger partition for creation, and will be shrinked at last, workaround of libzypp bug
#part / --size=2000 --ondisk mmcblk0p --fstype=ext4 --label=platform
# DATA partition
#part /opt/ --size=1800 --ondisk mmcblk0p --fstype=ext4 --label=data
# ROOT fs partition
part / --size=1700 --ondisk mmcblk0p --fstype=ext4 --label=platform
# DATA partition
part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data
# UMS partition
part /opt/media/ --size=300 --ondisk mmcblk0p --fstype=vfat --label=ums
rootpw tizen
bootloader --timeout=0 --append="rootdelay=5"
desktop --autologinuser=root
user --name root --groups audio,video --password ''
repo --name=Tizen-main --baseurl=https://download.tizen.org/snapshots/trunk/common/@[email protected]/repos/main/armv7l/packages/ --save --ssl_verify=no
repo --name=Tizen-base --baseurl=https://download.tizen.org/snapshots/trunk/common/@[email protected]/repos/base/armv7l/packages/ --save --ssl_verify=no
%packages
@tizen-c210
@tizen-bootstrap
-glib2-static
-gettext-tools
-eglibc-utils
-imake
-giflib-utils
-brcm-gps-daemon
-insserv
%end
%prepackages
libgcc
eglibc
sqlite
zlib
libpython
libdlog
libcap
libattr
default-files-slp
busybox
python-base
libacl
glib2
tzdata-slp
vconf
libxml2
heynoti
openssl
shared-mime-info
libudev
security-server
dbus-libs
cert-svc
libsecurity-server-client
%end
%post
echo 'kickstart post script start'
if [ -d /etc/init.d ]; then
cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
fi
rm -rf /etc/init.d*
ln -sf /etc/rc.d/init.d /etc/init.d
# Without this line the rpm don't get the architecture right.
echo -n 'armv7l-meego-linux' > /etc/rpm/platform
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
ail_initdb
/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
cat > /usr/bin/press << EOF
#!/bin/sh
JUNK="SLP"
[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
echo "Press return key to stop scripts"
read -t \$TIMEOUT JUNK
exit \$?
EOF
chmod +x /usr/bin/press
ln -s /opt/etc/X11/xkb /usr/share/X11
echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
rm -rf /usr/include
rm -rf /usr/share/man
rm -rf /usr/share/doc
MAJOR="2"
MINOR="0"
cat >/etc/info.ini <<EOF
[Version]
Major=$MAJOR;
Minor=$MINOR;
Build=TIZEN_`date +%Y%m%d`_1;
Order=;
[Build]
Date=`date +%Y.%m.%d`;
Time=`date +%H:%M:%S`;
EOF
ln -sf /etc/info.ini /opt/etc/info.ini
ln -sf /etc/info.ini /usr/etc/info.ini
mkdir -p /home/app
cp -a /etc/skel/.e /home/app/
chown -R 5000:5000 /home/app
chmod 0755 /home/app
chown -R 5000:5000 /opt/home/app
chmod 0755 /opt/home/app
cat > /usr/lib/systemd/system/usb-debug.service << EOF
[Unit]
Description=Start usb networking for debugging
ConditionPathExists=/sys/devices/platform/usb_mode/UsbMenuSel
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=PATH=/bin:/sbin
ExecStart=/bin/bash -c 'echo 4 > /sys/devices/platform/usb_mode/UsbMenuSel'
ExecStart=/sbin/ifconfig usb0 192.168.129.3 netmask 255.255.255.0
ExecStop=/bin/bash -c 'echo 0 > /sys/devices/platform/usb_mode/UsbMenuSel'
#
# We now don't launch this USB mode hack by default. If you need that, run this:
# systemctl enable usb-debug.service
# or create a link manually like below:
# ln -s ../usb-debug.service /usr/lib/systemd/system/basic.target.wants/usb-debug.service
#
[Install]
WantedBy=basic.target
EOF
# required for the connman systemd service
cat > /etc/sysconfig/connman << EOF
OPTIONS="-W wext"
EOF
# required for the wpa_supplicant systemd service
cat > /etc/sysconfig/wpa_supplicant << EOF
OPTIONS="-Dwext"
EOF
ldconfig
rpm --rebuilddb
echo 'kickstart post script end'
%end
%post --nochroot
%end
News ?
It is nice Android to have competition but from what I saw on youtube Tizen is just android stuck at version 2.3. Is there anything new except that there will be no native apps?
gud to here that
now wating for ur good work

[HELP] Problem Installing Firefox OS on LG Optimus L3

Hi all! I want to install Firefox OS on my LG Optimus L3 (a non-supported device) but someone created the Manifest file for my device. You can see it here: github.com/fergy/B2G/blob/master/optimus-l3.xml
The problem is that I've followed the official guide in developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Preparing_for_your_first_B2G_build and I don't know how to proceed after downloading the optimus-l3.xml file that he created. I follow the guide properly until the "Configuring B2G for your device" chapter. Could you explain how to continue and what are the necessary steps?
Thank you very much for your excellent work and for your help. Bye!
I cloned B2G from mozilla-b2g then fixed config.sh:
Code:
#!/bin/bash
REPO=${REPO:-./repo}
sync_flags=""
repo_sync() {
rm -rf .repo/manifest* &&
$REPO init -u $GITREPO -b $BRANCH -m $1.xml &&
$REPO sync $sync_flags
ret=$?
if [ "$GITREPO" = "$GIT_TEMP_REPO" ]; then
rm -rf $GIT_TEMP_REPO
fi
if [ $ret -ne 0 ]; then
echo Repo sync failed
exit -1
fi
}
case `uname` in
"Darwin")
# Should also work on other BSDs
CORE_COUNT=`sysctl -n hw.ncpu`
;;
"Linux")
CORE_COUNT=`grep processor /proc/cpuinfo | wc -l`
;;
*)
echo Unsupported platform: `uname`
exit -1
esac
GITREPO=${GITREPO:-"git://github.com/fergy/B2G"}
BRANCH=master
while [ $# -ge 1 ]; do
case $1 in
-d|-l|-f|-n|-c|-q)
sync_flags="$sync_flags $1"
shift
;;
--help|-h)
# The main case statement will give a usage message.
break
;;
-*)
echo "$0: unrecognized option $1" >&2
exit 1
;;
*)
break
;;
esac
done
GIT_TEMP_REPO="tmp_manifest_repo"
if [ -n "$2" ]; then
GITREPO=$GIT_TEMP_REPO
rm -rf $GITREPO &&
git init $GITREPO &&
cp $2 $GITREPO/$1.xml &&
cd $GITREPO &&
git add $1.xml &&
git commit -m "manifest" &&
git branch -m $BRANCH &&
cd ..
fi
echo MAKE_FLAGS=-j$((CORE_COUNT + 2)) > .tmp-config
echo GECKO_OBJDIR=$PWD/objdir-gecko >> .tmp-config
echo DEVICE_NAME=$1 >> .tmp-config
case "$1" in
"galaxy-s2")
echo DEVICE=galaxys2 >> .tmp-config &&
repo_sync $1
;;
"galaxy-nexus")
echo DEVICE=maguro >> .tmp-config &&
repo_sync $1
;;
"nexus-4")
echo DEVICE=mako >> .tmp-config &&
repo_sync nexus-4
;;
"optimus-l3")
echo DEVICE=e400 >> .tmp-config &&
repo_sync $1
;;
"nexus-s")
echo DEVICE=crespo >> .tmp-config &&
repo_sync $1
;;
"nexus-s-4g")
echo DEVICE=crespo4g >> .tmp-config &&
repo_sync $1
;;
"otoro"|"unagi"|"keon"|"inari"|"leo"|"hamachi"|"peak"|"helix"|"wasabi")
echo DEVICE=$1 >> .tmp-config &&
repo_sync $1
;;
"tara")
echo DEVICE=sp8810ea >> .tmp-config &&
echo LUNCH=sp8810eabase-eng >> .tmp-config &&
repo_sync $1
;;
"pandaboard")
echo DEVICE=panda >> .tmp-config &&
repo_sync $1
;;
"emulator"|"emulator-jb")
echo DEVICE=generic >> .tmp-config &&
echo LUNCH=full-eng >> .tmp-config &&
repo_sync $1
;;
"emulator-x86"|"emulator-x86-jb")
echo DEVICE=generic_x86 >> .tmp-config &&
echo LUNCH=full_x86-eng >> .tmp-config &&
repo_sync $1
;;
*)
echo "Usage: $0 [-cdflnq] (device name)"
echo "Flags are passed through to |./repo sync|."
echo
echo Valid devices to configure are:
echo - galaxy-s2
echo - galaxy-nexus
echo - nexus-4
echo - nexus-s
echo - nexus-s-4g
echo - otoro
echo - unagi
echo - inari
echo - keon
echo - peak
echo - leo
echo - hamachi
echo - helix
echo - wasabi
echo - tara
echo - pandaboard
echo - emulator
echo - emulator-jb
echo - emulator-x86
echo - emulator-x86-jb
exit -1
;;
esac
if [ $? -ne 0 ]; then
echo Configuration failed
exit -1
fi
mv .tmp-config .config
echo Run \|./build.sh\| to start building
and now downloading the source tree... let's check if it completes well
gellmar said:
I cloned B2G from mozilla-b2g then fixed config.sh:
Code:
#!/bin/bash
REPO=${REPO:-./repo}
sync_flags=""
repo_sync() {
rm -rf .repo/manifest* &&
$REPO init -u $GITREPO -b $BRANCH -m $1.xml &&
$REPO sync $sync_flags
ret=$?
if [ "$GITREPO" = "$GIT_TEMP_REPO" ]; then
rm -rf $GIT_TEMP_REPO
fi
if [ $ret -ne 0 ]; then
echo Repo sync failed
exit -1
fi
}
case `uname` in
"Darwin")
# Should also work on other BSDs
CORE_COUNT=`sysctl -n hw.ncpu`
;;
"Linux")
CORE_COUNT=`grep processor /proc/cpuinfo | wc -l`
;;
*)
echo Unsupported platform: `uname`
exit -1
esac
GITREPO=${GITREPO:-"git://github.com/fergy/B2G"}
BRANCH=master
while [ $# -ge 1 ]; do
case $1 in
-d|-l|-f|-n|-c|-q)
sync_flags="$sync_flags $1"
shift
;;
--help|-h)
# The main case statement will give a usage message.
break
;;
-*)
echo "$0: unrecognized option $1" >&2
exit 1
;;
*)
break
;;
esac
done
GIT_TEMP_REPO="tmp_manifest_repo"
if [ -n "$2" ]; then
GITREPO=$GIT_TEMP_REPO
rm -rf $GITREPO &&
git init $GITREPO &&
cp $2 $GITREPO/$1.xml &&
cd $GITREPO &&
git add $1.xml &&
git commit -m "manifest" &&
git branch -m $BRANCH &&
cd ..
fi
echo MAKE_FLAGS=-j$((CORE_COUNT + 2)) > .tmp-config
echo GECKO_OBJDIR=$PWD/objdir-gecko >> .tmp-config
echo DEVICE_NAME=$1 >> .tmp-config
case "$1" in
"galaxy-s2")
echo DEVICE=galaxys2 >> .tmp-config &&
repo_sync $1
;;
"galaxy-nexus")
echo DEVICE=maguro >> .tmp-config &&
repo_sync $1
;;
"nexus-4")
echo DEVICE=mako >> .tmp-config &&
repo_sync nexus-4
;;
"optimus-l3")
echo DEVICE=e400 >> .tmp-config &&
repo_sync $1
;;
"nexus-s")
echo DEVICE=crespo >> .tmp-config &&
repo_sync $1
;;
"nexus-s-4g")
echo DEVICE=crespo4g >> .tmp-config &&
repo_sync $1
;;
"otoro"|"unagi"|"keon"|"inari"|"leo"|"hamachi"|"peak"|"helix"|"wasabi")
echo DEVICE=$1 >> .tmp-config &&
repo_sync $1
;;
"tara")
echo DEVICE=sp8810ea >> .tmp-config &&
echo LUNCH=sp8810eabase-eng >> .tmp-config &&
repo_sync $1
;;
"pandaboard")
echo DEVICE=panda >> .tmp-config &&
repo_sync $1
;;
"emulator"|"emulator-jb")
echo DEVICE=generic >> .tmp-config &&
echo LUNCH=full-eng >> .tmp-config &&
repo_sync $1
;;
"emulator-x86"|"emulator-x86-jb")
echo DEVICE=generic_x86 >> .tmp-config &&
echo LUNCH=full_x86-eng >> .tmp-config &&
repo_sync $1
;;
*)
echo "Usage: $0 [-cdflnq] (device name)"
echo "Flags are passed through to |./repo sync|."
echo
echo Valid devices to configure are:
echo - galaxy-s2
echo - galaxy-nexus
echo - nexus-4
echo - nexus-s
echo - nexus-s-4g
echo - otoro
echo - unagi
echo - inari
echo - keon
echo - peak
echo - leo
echo - hamachi
echo - helix
echo - wasabi
echo - tara
echo - pandaboard
echo - emulator
echo - emulator-jb
echo - emulator-x86
echo - emulator-x86-jb
exit -1
;;
esac
if [ $? -ne 0 ]; then
echo Configuration failed
exit -1
fi
mv .tmp-config .config
echo Run \|./build.sh\| to start building
and now downloading the source tree... let's check if it completes well
Click to expand...
Click to collapse
good morning, hello friend, first congratulate you on your work, I still, as I have a lg400, I've been looking at this pots, and wanted preguntart, possible?
gellmar said:
I cloned B2G from mozilla-b2g then fixed config.sh:
Code:
#!/bin/bash
REPO=${REPO:-./repo}
sync_flags=""
repo_sync() {
rm -rf .repo/manifest* &&
$REPO init -u $GITREPO -b $BRANCH -m $1.xml &&
$REPO sync $sync_flags
ret=$?
if [ "$GITREPO" = "$GIT_TEMP_REPO" ]; then
rm -rf $GIT_TEMP_REPO
fi
if [ $ret -ne 0 ]; then
echo Repo sync failed
exit -1
fi
}
case `uname` in
"Darwin")
# Should also work on other BSDs
CORE_COUNT=`sysctl -n hw.ncpu`
;;
"Linux")
CORE_COUNT=`grep processor /proc/cpuinfo | wc -l`
;;
*)
echo Unsupported platform: `uname`
exit -1
esac
GITREPO=${GITREPO:-"git://github.com/fergy/B2G"}
BRANCH=master
while [ $# -ge 1 ]; do
case $1 in
-d|-l|-f|-n|-c|-q)
sync_flags="$sync_flags $1"
shift
;;
--help|-h)
# The main case statement will give a usage message.
break
;;
-*)
echo "$0: unrecognized option $1" >&2
exit 1
;;
*)
break
;;
esac
done
GIT_TEMP_REPO="tmp_manifest_repo"
if [ -n "$2" ]; then
GITREPO=$GIT_TEMP_REPO
rm -rf $GITREPO &&
git init $GITREPO &&
cp $2 $GITREPO/$1.xml &&
cd $GITREPO &&
git add $1.xml &&
git commit -m "manifest" &&
git branch -m $BRANCH &&
cd ..
fi
echo MAKE_FLAGS=-j$((CORE_COUNT + 2)) > .tmp-config
echo GECKO_OBJDIR=$PWD/objdir-gecko >> .tmp-config
echo DEVICE_NAME=$1 >> .tmp-config
case "$1" in
"galaxy-s2")
echo DEVICE=galaxys2 >> .tmp-config &&
repo_sync $1
;;
"galaxy-nexus")
echo DEVICE=maguro >> .tmp-config &&
repo_sync $1
;;
"nexus-4")
echo DEVICE=mako >> .tmp-config &&
repo_sync nexus-4
;;
"optimus-l3")
echo DEVICE=e400 >> .tmp-config &&
repo_sync $1
;;
"nexus-s")
echo DEVICE=crespo >> .tmp-config &&
repo_sync $1
;;
"nexus-s-4g")
echo DEVICE=crespo4g >> .tmp-config &&
repo_sync $1
;;
"otoro"|"unagi"|"keon"|"inari"|"leo"|"hamachi"|"peak"|"helix"|"wasabi")
echo DEVICE=$1 >> .tmp-config &&
repo_sync $1
;;
"tara")
echo DEVICE=sp8810ea >> .tmp-config &&
echo LUNCH=sp8810eabase-eng >> .tmp-config &&
repo_sync $1
;;
"pandaboard")
echo DEVICE=panda >> .tmp-config &&
repo_sync $1
;;
"emulator"|"emulator-jb")
echo DEVICE=generic >> .tmp-config &&
echo LUNCH=full-eng >> .tmp-config &&
repo_sync $1
;;
"emulator-x86"|"emulator-x86-jb")
echo DEVICE=generic_x86 >> .tmp-config &&
echo LUNCH=full_x86-eng >> .tmp-config &&
repo_sync $1
;;
*)
echo "Usage: $0 [-cdflnq] (device name)"
echo "Flags are passed through to |./repo sync|."
echo
echo Valid devices to configure are:
echo - galaxy-s2
echo - galaxy-nexus
echo - nexus-4
echo - nexus-s
echo - nexus-s-4g
echo - otoro
echo - unagi
echo - inari
echo - keon
echo - peak
echo - leo
echo - hamachi
echo - helix
echo - wasabi
echo - tara
echo - pandaboard
echo - emulator
echo - emulator-jb
echo - emulator-x86
echo - emulator-x86-jb
exit -1
;;
esac
if [ $? -ne 0 ]; then
echo Configuration failed
exit -1
fi
mv .tmp-config .config
echo Run \|./build.sh\| to start building
and now downloading the source tree... let's check if it completes well
Click to expand...
Click to collapse
any success?

[email protected]@holic help thread

This is a thirteen step program for flashaholics.
{
"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"
}
Since there is no cure for flashaholism, we may as well give those afflicted more to flash..
**ALWAYS FLASH AT YOUR OWN RISK ANYTHING THAT GETS POSTED HERE**​
Just follow these simple steps:
1. Rate this thread 5 stars
2. Subscribe to this thread
3. Tell other flashaholics to join this thread
4. Treat all flashaholics with respect
5. Be on the constant lookout for anything new and noteworthy
6. Be helpful to those afflicted by posting these new found links
7. Always use protection when flashing (have a backup)
8. Don't be discrete about your flashing adventures, share your steamy details
9. Be helpful to outsiders that aren't as flash savvy as you and answer their posts nicely
10. If you feel a member is on the wagon, help them fall off by bragging about how cool your phone is
11. Remember to follow XDA rules
12. Happy flashing!!
13. Always thank your developers, and donate if you can..
BECOME PART OF AN ADDICTIVE COMMUNITY
I'm on telegram
HELP THE COMMUNITY AND JOIN THE ROM "WIKI"
You can add your knowledge to this growing chart of roms
-JOIN HERE-​
When not flashing I will update the thread with notable links of what, where, and how to flash..
Contributors
@#sychrome#
XDA community
Get your support banners -HERE-
WE'RE HERE FOR YOUR TUNING NEEDS
KA MOD (Kernel aduitor)
http://forum.xda-developers.com/android/apps-games/kernel-adiutor-mod-singularity-kernel-t3333549
How to apply profiles
http://forum.xda-developers.com/oneplus-one/development/rom-cm-12-builds-t3045053/post68636831
Lightning Kernel profiles
http://forum.xda-developers.com/oneplus-one/general/flshholic-help-thread-t2869514/post69351130
New Kernel profiles (jgcaap rom)
http://forum.xda-developers.com/oneplus-one/general/flshholic-help-thread-t2869514/post69271814
Moriarty Kernel profiles (S.O.S. rom)
http://forum.xda-developers.com/showpost.php?p=70181339&postcount=175
Battery Savings tips
1. Keep unneeded services off (location, BT, NFC, ect..)
2. Lower the screen brightness
3. Manage your apps with greenify (many apps will abuse services if you let them)
4. Don't discharge the battery to zero, and try to keep it cool (hot batteries discharge faster)
Settings Script
WELCOME TO SETTINGS SCRIPT
This is a set scripts I started collecting and working on since my days of old using a Nexus S. It has been updated and tested 100's of times and is ready for use on the OnePlus. I am not going to claim 1000's of points gained in benchmarks, or days of battery life, but it should help balance performance and battery..
Basically it's a collection of init.d scripts to gently modify some services, system, battery and various functions. This is active at boot (assuming you have init.d support and busybox). Please don't use this with other scripts (seeder is okay). Don't operate while intoxicated or holding an iPhone..
Code:
#!/system/bin/sh
# test
if [ -f /data/Test.log ] ; then
rm /data/Test.log
fi
echo "Script is working !!!" >> /data/Test.log
echo "excecuted on $(date +"%d-%m-%Y %r" )" >> /data/Test.log
# Expand Kernel Permission
if [ -e /dev/cpuctl/apps/cpu.notify_on_migrate ]; then
chown system.system /dev/cpuctl/apps/cpu.notify_on_migrate
chmod 0666 /dev/cpuctl/apps/cpu.notify_on_migrate
fi
# Cleaner
#Interval between runs, in seconds, 172800=48 hours
RUN_EVERY=172800
busybox rm -f /data/anr/*.*
busybox rm -f /data/cache/*.*
busybox rm -f /data/log/*.*
busybox rm -f /data/local/tmp/*.*
busybox rm -f /data/mlog/*
busybox rm -f /data/tombstones/*
busybox rm -f /data/backup/pending/*
busybox rm -f /data/system/dropbox/*
busybox rm -f /cache/recovery/*
busybox rm -f /dev/log/main/*
chmod 700 /data/system/dropbox
busybox chmod 700 /data/system/usagestats
# Zipalign
# 86400=24 hours
RUN_EVERY=86400
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
cp -f -p /cache/$APK $APK
busybox rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done;
done;
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
# Renice
B=/system/xbin/busybox
( while true
do
sf=$( service list | $B grep -c "SurfaceFlinger" )
if [ $sf -eq 1 ]
then
service call SurfaceFlinger 1008 i32 1
break
else
sleep 2
fi
done
) &
# Kernel Tweaks
if [ -e /proc/sys/kernel/softlockup_panic ]
then
echo 0 > /proc/sys/kernel/softlockup_panic
fi
if [ -e /proc/sys/kernel/hung_task_timeout_secs ]
then
echo 0 > /proc/sys/kernel/hung_task_timeout_secs
fi
if [ -e /proc/sys/kernel/panic_on_oops ]
then
echo 0 > /proc/sys/kernel/panic_on_oops
fi
if [ -e /proc/sys/kernel/panic ]
then
echo 0 > /proc/sys/kernel/panic
fi
if [ -e /proc/sys/kernel/msgmni ]
then
echo 2048 > /proc/sys/kernel/msgmni
fi
if [ -e /proc/sys/kernel/msgmax ]
then
echo 64000 > /proc/sys/kernel/msgmax
fi
if [ -e /proc/sys/kernel/shmmax ]
then
echo 268435500 > /proc/sys/kernel/shmmax
fi
if [ -e /proc/sys/kernel/threads-max ]
then
echo 525810 > /proc/sys/kernel/threads-max
fi
if [ -e /proc/sys/kernel/nmi_watchdog ]; then
echo "0" > /proc/sys/kernel/nmi_watchdog;
sysctl -e -w kernel.nmi_watchdog=0;
fi;
if [ -e /proc/sys/vm/drop_caches ]; then
echo "3" > /proc/sys/vm/drop_caches;
sysctl -e -w vm.drop_caches=3;
fi;
#fsync
if [ -e /sys/devices/virtual/misc/fsynccontrol/fsync_enabled ]; then
echo "0" > /sys/devices/virtual/misc/fsynccontrol/fsync_enabled;
fi;
if [ -e /sys/class/misc/fsynccontrol/fsync_enabled ]; then
echo "0" > /sys/class/misc/fsynccontrol/fsync_enabled;
fi;
if [ -e /sys/module/sync/parameters/fsync ]; then
echo "0" > /sys/module/sync/parameters/fsync;
fi;
if [ -e /sys/module/sync/parameters/fsync_enabled ]; then
echo "0" > /sys/module/sync/parameters/fsync_enabled;
echo "N" > /sys/module/sync/parameters/fsync_enabled;
fi;
# Disable Sleepers
echo "NO_NEW_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features;
echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features;
# Kill Media Tweak
LOG=/data/mediaserver_log.txt;
supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };";
if [ "$SDK" -le "18" ]; then
if [ "$SDK" -gt "10" ]; then
echo "Mediaserver kill" >> $LOG;
busybox killall -9 android.process.media;
busybox killall -9 mediaserver;
fi;
fi;
# Vsync tweak
if [ -e /sys/kernel/debug/msm_fb/0/vsync_enable ]; then
echo 0 > /sys/kernel/debug/msm_fb/0/vsync_enable
fi;
#Sqlite
# Log file location
LOG_FILE=/data/sqlite.log
#Interval between SQLite3 runs, in seconds, 604800=1 week
RUN_EVERY=604800
# Get the last modify date of the Log file, if the file does not exist, set value to 0
if [ -e $LOG_FILE ]; then
LASTRUN=`stat -t $LOG_FILE | awk '{print $14}'`
else
LASTRUN=0
fi;
# Get current date in epoch format
CURRDATE=`date +%s`
# Check the interval
INTERVAL=$(expr $CURRDATE - $LASTRUN)
# If interval is more than the set one, then run the main script
if [ $INTERVAL -gt $RUN_EVERY ]; then
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
echo "SQLite database VACUUM and REINDEX started at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for i in `busybox find /d* -iname "*.db"`;
do /system/xbin/sqlite3 $i 'VACUUM;';
resVac=$?
if [ $resVac == 0 ]; then
resVac="SUCCESS";
else
resVac="ERRCODE-$resVac";
fi;
/system/xbin/sqlite3 $i 'REINDEX;';
resIndex=$?
if [ $resIndex == 0 ]; then
resIndex="SUCCESS";
else
resIndex="ERRCODE-$resIndex";
fi;
echo "Database $i: VACUUM=$resVac REINDEX=$resIndex" | tee -a $LOG_FILE;
done
echo "SQLite database VACUUM and REINDEX finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
fi;
#Lcd power
if [ -e /sys/class/lcd/panel/power_reduce ]; then
echo "LCD power reduce detected. Activating..";
echo "1" > /sys/class/lcd/panel/power_reduce;
fi;
# Properties tweak
setprop ro.kernel.android.checkjni 0
setprop debug.kill_allocating_task 0
setprop dev.pm.dyn_samplingrate 1
setprop pm.sleep_mode 1
setprop persist.sys.purgeable_assets 1
setprop persist.cust.tel.eons 1
setprop ro.ril.enable.amr.wideband 1
setprop ro.ril.transmitpower true
setprop ro.ril.sensor.sleep.control 1
setprop ro.config.combined_signal true
setprop ro.ril.hep 1
setprop wifi.supplicant_scan_interval 300
setprop cm.filesystem.ready 1
setprop persist.service.pcsync.enable 0
setprop persist.service.lgospd.enable 0
setprop ro.min_pointer_dur 1
setprop ro.sys.fw.bg_apps_limit 6
setprop ro.lcd_min_brightness 1
setprop persist.sys.use_dithering 0
setprop persist.sys.use_16bpp_alpha 1
setprop ro.max.fling_velocity 20000
setprop ro.min.fling_velocity 10000
#Ext4 mount
# Log file location
LOG_FILE=/data/fsck.log
if ( mount | grep -w ext4 ) then
echo "EXT4 Partition Found!"
echo "Remounting..."
mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /cache /cache;
mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /data /data;
mount >> /data/fsck.log;
else
echo "EXT4 Partition Not Found!"
fi;
echo "Script finished"
FLASH AT YOUR OWN RISK
INSTALLATION:
**Requires BusyBox and init.d support**
(For some Nougat roms emulation of init.d may be nessesary, use KA mod, or another app for init.d emulation..)
Just flash in recovery, no extra steps required to enjoy..
It removes the old version, so flash and forget, it also survives a dirty flash (v5.5+)..
This has been tested, but no guarantees for protection from aliens or ninjas..
SPECIAL THANKS TO: @h-cspu @7u5h4r @Stone_88@ashutoshmn @Purerawenergy and @maxed4901 for helping me improve it..
Unless there's a bug fix or something I like, this won't get updated further.. NO ETAS
DOWNLOAD(s)
https://www.androidfilehost.com/?w=files&flid=123565
SCRIPTS & UNINSTALLER
LATEST UPDATE
VERSION: 6.1 SS Beta 08/04/2017
VERSION: 3.1 SS Stable 08/04/2017
Enjoy
Mine
CARBON
DOWNLOAD
Normal ext4 Debloated, with Android L keyboard and MiXplorer
Converted F2FS Converted, debloated, with Android L keyboard and MiXplorer.. THIS DOES NOT NEED A KERNEL FLASHED OVER THIS it is an "all in one" convert and is complete..
Original from Moonlight Original with extra Chinese apps
Not mine
yeeeaaaaaa
Sent from my 1+1
Thank you so much for bringing us carbon!
For the spreadsheet, it requires access. Don't forget to change the permissions
You need permission
Want in? Ask the owner for access, or switch to an account with permission. Learn more
Click to expand...
Click to collapse
zephiK said:
For the spreadsheet, it requires access. Don't forget to change the permissions
Click to expand...
Click to collapse
I'll get that fixed, its a work in progress..
Sent from my One using XDA Premium 4 mobile app
My name is ninjanurse, and I am a [email protected]@holic
Sent from my One A0001 using Tapatalk
welcome, ninjanurse
Sent from my 1+1
ninjanurse said:
My name is ninjanurse, and I am a [email protected]@holic
Sent from my One A0001 using Tapatalk
Click to expand...
Click to collapse
I think you need to tell the group about your latest flashing exploits, and don't forget to brag..
Sent from my One using XDA Premium 4 mobile app
Hello i am primo14z
and i can't stand to have one ROM to much time :/
so ya they say that first step is to face yourself with the problem , so I am a [email protected]@holic
i tryed Carbon ROM and i must say works great, but doesn't have that special something why would i make it my daily
I'm a [email protected]@holic as well, dansou901 is my name. My method of getting along is having multirom installed, it helps alot with all the flashing...
dansou901 said:
I'm a [email protected]@holic as well, dansou901 is my name. My method of getting along is having multirom installed, it helps alot with all the flashing...
Click to expand...
Click to collapse
I wonder if multirom works on f2fs?..
**using that search thingy, it turns out that multirom does indeed support f2fs..
Sent from my One using XDA Premium 4 mobile app
Setting.Out said:
I wonder if multirom works on f2fs?..
**using that search thingy, it turns out that multirom does indeed support f2fs..
MultiROM really helps me to stay a real [email protected]@holic, why choose a rom of choice.. I can have them all...
Click to expand...
Click to collapse
ninjanurse said:
Setting.Out said:
I wonder if multirom works on f2fs?..
**using that search thingy, it turns out that multirom does indeed support f2fs..
MultiROM really helps me to stay a real [email protected]@holic, why choose a rom of choice.. I can have them all...
Click to expand...
Click to collapse
As long as you don't run out of storage space...
Click to expand...
Click to collapse
ninjanurse said:
As long as you don't run out of storage space...
Click to expand...
Click to collapse
Binge and purge!!..
Sent from my A0001 using XDA Premium 4 mobile app
I just moved back to ext4 from f2fs.. For a Flashaholic that was a long time to be limited in how and when you can flash.. I was going through withdrawls, so I flashed 4 roms 3 recoveries and 1 kernel along with gapps and the lot as well.. AHHHH... Much better.. And honestly, I know that f2fs is supposed to be faster, but even if it is, I want a bit more freedom to flash.. I'm not saying I won't try it again, but not for a while..
I will have some updated links to websites/roms this week as well as more than just a shell of a chart.. I think the chart(s) will really help others see what a rom has to offer..

[Q] no wifi no bluetooth and now ... noob error caused bootloop

hey guys long time reader first time poster
iv been a bit of a noob
i have here a customers phone that i fixed the screen on
after booting the phone up and checking it over i find that the wifi bluetooth and google play services are all in trouble and wont start
wifi is greyed out bluetooth switches itself off and google play services keep crashing
i assume the phone has recently got the lollipop update and that is whats causing the issues
i rooted the phone using skipsofts toolkit and all the recommended options twrp and so on phone rooted fine
done a bit of messing around with wifi files and stuff using guides online but none of this worked
then the brainstorm
try twrp recovery ... it may have answers
found what i thought was my answer
FIX PERMISSIONS .... ahh yes i thought ..... i permissions fault after the update ... whats the harm in trying anyway ??
thats when the phone become a nice soft brick
congratulations you have successfully entered bootloop mode
i know the bootloop has been caused by me clicking fix permissions on a perfectly working phone
the question is do any of you know how to reverse the fix permissions or revert to previous permissions ??
i know theres ways to recover the phone to a useable state but from what iv seen this means losing data
due to this being a customers phone and me being the idiot thats put it in a bootloop not her i dont want to lose a single user data byte !!
a big ask i know but if anyone can make miracles happen its the xda team u guys have saved my bacon more than once
should mention i had this same phone in about a month ago with another broken screen and wifi and bluetooth was working fine then
phone is sm-g900f
stock rom 5.0
build boa3
twrp 2.7.1.0 used
grabbed logcat info ( adb is enabled at samsung boot screen ... how lucky )
--------- beginning of main
W/asset ( 7518): Asset path /system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/CloudAgent/CloudAgent.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DCMProvider/DCMProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/ContextProvider/ContextProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DefaultContainerService/DefaultContainerService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DeviceTest/DeviceTest.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DiagMonAgent/DiagMonAgent.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DocumentService/DocumentService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DirectShareManager/DirectShareManager.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/EasyLauncher2/EasyLauncher2.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/FmmDM/FmmDM.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/FmmDS/FmmDS.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/HealthService/HealthService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/Kies/Kies.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/LogsProvider/LogsProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/ManagedProvisioning/ManagedProvisioning.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/MmsService/MmsService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/NoiseField/NoiseField.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/OutOfFocusViewer_WQHD_K/OutOfFocusViewer_WQHD_K.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/PCWClientS18/PCWClientS18.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/PayWithPaypal/PayWithPaypal.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/PhaseBeam/PhaseBeam.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/FingerprintService/FingerprintService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/ProxyHandler/ProxyHandler.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SHealth3_5/SHealth3_5.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SOAgent/SOAgent.apk is neither a directory nor file (type=0).
I/bootchecker( 7422): Sleep for 8 minutes
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/SamsungLinkPlatform/SamsungLinkPlatform.apk': Failed to open oat filename for reading: No such file or directory
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected][email protected]' for file location '/system/priv-app/SamsungApps_K/SamsungApps_K.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /system/priv-app/SNS/SNS.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SamsungBilling/SamsungBilling.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecContactsProvider/SecContactsProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecTelephonyProvider_Candy/SecTelephonyProvider_Candy.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecWallpaperPicker/SecWallpaperPicker.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecMediaProvider/SecMediaProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/Tag/Tag.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/VoiceNote/VoiceNote.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/WallpaperCropper/WallpaperCropper.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/intelligenceservice/intelligenceservice.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudDataRelay/sCloudDataRelay.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudDataSync/sCloudDataSync.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncCalendar/sCloudSyncCalendar.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncContacts/sCloudSyncContacts.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected][email protected]' for file location '/system/priv-app/SPPPushClient_Prod/SPPPushClient_Prod.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncMemo/sCloudSyncMemo.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/Telecom/Telecom.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncSNote3/sCloudSyncSNote3.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SharedStorageBackup/SharedStorageBackup.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.whatsapp-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.android.vending-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.videos-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.android.chrome-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/flipboard.app-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.dsi.ant.service.socket-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/wssyncmlnps/wssyncmlnps.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.plus-2/base.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/Phonesky/Phonesky.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /data/app/com.sec.app.samsungprintservice-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.books-2/base.apk is neither a directory nor file (type=0).
W/ResourceType( 7518): ResTable_typeSpec entry count inconsistent: given 2, previously 1633
W/asset ( 7518): Asset path /data/app/com.samsung.android.app.mirrorlink-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/uk.co.o2.android.myo2-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/tv.peel.smartremote-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.samsung.SMT-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.sec.spp.push-1/base.apk is neither a directory nor file (type=0).
W/ResourceType( 7518): ResTable_typeSpec entry count inconsistent: given 1, previously 1633
W/asset ( 7518): Asset path /data/app/com.google.android.webview-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.mobeam.barcodeService-1/base.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/MyGalaxyStub.2.0.3/MyGalaxyStub.2.0.3.apk': Failed to open oat filename for reading: No such file or directory
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/system/priv-app/MyGalaxyStub.2.0.3/arm/MyGalaxyStub.2.0.3.odex' for file location '/system/priv-app/MyGalaxyStub.2.0.3/MyGalaxyStub.2.0.3.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /data/app/com.qihoo.security-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.samsunguk.mygalaxy-2/base.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/Velvet/Velvet.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /data/app/com.pinterest-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.youtube-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.estrongs.android.pop-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.dropbox.android-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.sec.android.iap-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.gm-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.marvin.talkback-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.dsi.ant.plugins.antplus-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.docs-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.play.games-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.talk-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.maps-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.rbs.mobile.android.ubn-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.music-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.tts-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.yahoo.mobile.client.android.mail-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.googlequicksearchbox-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.samsung.android.sdk.samsunglink-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.scoompa.collagemaker-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.infraware.polarisviewer5-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.roidapp.photogrid-1/base.apk is neither a directory nor file (type=0).
W/ResourceType( 7518): ResTable_typeSpec entry count inconsistent: given 1, previously 1633
W/asset ( 7518): Asset path /data/app/air.uk.co.bbc.android.mediaplayer-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.lu.barcodescannerbanner-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.brilliantlabs.solitaire-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.docs.editors.docs-2/base.apk is neither a directory nor file (type=0).
I/QCOM PowerHAL( 7518): QCOM power HAL initing.
I/QCOM PowerHAL( 7518): Dual core online
W/libsuspend( 7518): Error writing 'on' to /sys/power/state: Invalid argument
I/libsuspend( 7518): Selected wakeup count
D/MISC PowerHAL( 7518): sysfs_write +: /sys/class/power_supply/battery/lcd: 1
D/MISC PowerHAL( 7518): sysfs_write -: /sys/class/power_supply/battery/lcd: 1
I/QCOM PowerHAL( 7518): Got set_interactive hint
D/EnterprisePartitionManager( 7518): createConnector() for socket epm
W/SEAMS ( 7518): Service is null
W/SEAMS ( 7518): Service is null
D/EnterprisePartitionManager( 7518): onDaemonConnected() for socket epm
I/PersonaManagerService( 7518): Pruning of unwanted persona has started...
I/PersonaManagerService( 7518): Pruning mPersonas's size is 0
I/PersonaManagerService( 7518): <init> adding PersonaPolicyManagerService
looking bad ... can post more if required very small snippet
Seeing as almost every error is saying files dont exist, seems you may have managed to wipe /system or something.
Sent from my Twi5ted SM-G900A using Tapatalk
Rakuu said:
Seeing as almost every error is saying files dont exist, seems you may have managed to wipe /system or something.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
its a permissions error.
system has a low permission level and as such cant see its own files and results in system finding nothing it needs to be able to boot
it is a curable situation
just need the right man/woman to see the post
i have adb access
i have cygwin installed on the pc and all links up and reads fine
can pull and push files all day long
just need to set the permissions
killabyte0 said:
its a permissions error.
system has a low permission level and as such cant see its own files and results in system finding nothing it needs to be able to boot
it is a curable situation
just need the right man/woman to see the post
i have adb access
i have cygwin installed on the pc and all links up and reads fine
can pull and push files all day long
just need to set the permissions
Click to expand...
Click to collapse
I'm pretty sure itd be saying "permission denied" if they had improper perms, if you say you can push and pull files though i'll take your word for it, can you not just set the permissions with adb?
Sent from my Twi5ted SM-G900A using Tapatalk
Rakuu said:
I'm pretty sure itd be saying "permission denied" if they had improper perms, if you say you can push and pull files though i'll take your word for it, can you not just set the permissions with adb?
[QRCODE][/QRCODE]
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
that is the hope yes i know it can be done but im unsure how to do it or if it would even be a viable option ie if i had to do every file manually it would be pointless and also i dont want to mess with things i dont know about. iv done enough damage already my linux background is limited
killabyte0 said:
that is the hope yes i know it can be done but im unsure how to do it or if it would even be a viable option ie if i had to do every file manually it would be pointless and also i dont want to mess with things i dont know about. iv done enough damage already my linux background is limited
Click to expand...
Click to collapse
The fix permissions wouldnt have done this unless the recovery was very broken, you had to have done something else. I just made a file on my server and changed the perms to 000 and tried to open it and got "permission denied" so no, those files are not there, it would say permission denied no matter how bad the permissions are.
Sent from my Twi5ted SM-G900A using Tapatalk
Rakuu said:
The fix permissions wouldn't have done this unless the recovery was very broken, you had to have done something else. I just made a file on my server and changed the perms to 000 and tried to open it and got "permission denied" so no, those files are not there, it would say permission denied no matter how bad the permissions are.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
lol must be something wrong with my eyes then because im looking at the files
as i said before its a permissions error
the system is not saying the files are missing
its saying each file is not a directory or a file
there has been a class change somewhere in relation to permissions
i understand you are trying to help me but please stop if you dont know what you are talking about
all hope is not lost and my files are not there ... if i was joe bloggs who knew no better you would of just had me delete all the files that are there and perfectly useable once permissions are repaired
fyi a permissions change alone can never delete a file
killabyte0 said:
lol must be something wrong with my eyes then because im looking at the files
as i said before its a permissions error
the system is not saying the files are missing
its saying each file is not a directory or a file
there has been a class change somewhere in relation to permissions
i understand you are trying to help me but please stop if you dont know what you are talking about
all hope is not lost and my files are not there ... if i was joe bloggs who knew no better you would of just had me delete all the files that are there and perfectly useable once permissions are repaired
fyi a permissions change alone can never delete a file
Click to expand...
Click to collapse
Yes i know, i mentioner earlier i run a server, i think i know what i'm talking about. If the files its saying arent there are there, then just do a recursive chmod through adb on the directories and then manually clean up whatever else needs it. If I were you i'd make a nandroid, wipe and reflash, then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk
Rakuu said:
Yes i know, i mentioner earlier i run a server, i think i know what i'm talking about. If the files its saying arent there are there, then just do a recursive chmod through adb on the directories and then manually clean up whatever else needs it. If I were you i'd make a nandroid, wipe and reflash, then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
chmod to what level ? 666 777 775 ?
whats the adb command to recursive chmod a directory and how do i point to it ?
is it just abd chmod 777 /data ?
this is why i need help dont want to go screwing whit things i know nothing about and cause more damage
killabyte0 said:
chmod to what level ? 666 777 775 ?
whats the adb command to recursive chmod a directory and how do i point to it ?
is it just abd chmod 777 /data ?
this is why i need help dont want to go screwing whit things i know nothing about and cause more damage
Click to expand...
Click to collapse
Just realized, the fix permissions action in twrp doesnt actually even mess with file permissions, it fixes missmatched UIDs. You'want to do
Code:
adb shell chmod -R XXX /dir
Replacing xxx with the octal and /dir with the directory. Like i said though, the system says they arent there, no permissions error will make them invisible to the system, i would really just do a nandroid and reflash then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk
Rakuu said:
Just realized, the fix permissions action in twrp doesnt actually even mess with file permissions, it fixes missmatched UIDs. You'want to do
Code:
adb shell chmod -R XXX /dir
Replacing xxx with the octal and /dir with the directory. Like i said though, the system says they arent there, no permissions error will make them invisible to the system, i would really just do a nandroid and reflash then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
humm well if this is just a uid error is it possible to boot the phone as root user ?
killabyte0 said:
humm well if this is just a uid error is it possible to boot the phone as root user ?
Click to expand...
Click to collapse
That wouldnt fix anything. I'm telling you, do what you canto back up everything you can off the phone and reflash.
Sent from my Twi5ted SM-G900A using Tapatalk
mount /data partition and execute this command.
find /data -type d -exec chmod 775 {} \;
find /data -type f -exec chmod 644 {} \;
Or you can just reverse the fix permission script.
Since lollipop fix permission has been outdated by SELinux.
Code:
#! /system/bin/sh
#
# Warning: if you want to run this script in cm-recovery change the above to #!/sbin/sh
#
# fix_permissions - fixes permissions on Android data directories after upgrade
# [email protected]
#
# thanks to: http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
#
# v1.1 - work with protected apps
# v1.2 - chown all the subfolders different than 'lib' and the single files [by ankn]
# v1.3 - support for the packages with userShareId; added parameter to support the remount
# mechanism in images different than Cyanogen [by ankn]
# v1.4 - fix the file and directory permissions as well [by smeat]
# v1.5 - integrate code by thenefield for logging and only making changes if needed [by smeat and thenefield]
# v1.6 - Don't mess with user's sdcard, log to it if present or to /data/data/ if not present [by farmatito]
# v1.7 - Simplify and improve readability of script a little, enforce safe default permissions where possible [by farmatito]
# v1.8 - Make sure we choose busybox applets when system binaries with the same name are available [by farmatito]
# v1.9 - reintegrated "chown all the subfolders different than 'lib' and the single files [by ankn]", fixed private app GID [by smeat]
# v1.10 - chmod and chown /data/data/$PACKAGE/lib as well [by smeat]
# v1.11 - logging of /data/data/$PACKAGE/lib, check if /data/data/$PACKAGE/lib needs be changed, fixed ls on chown [by smeat]
# v1.12 - reduced the number of finds down to one, chown and chmod actions reduced to a single loop, bug fixes and code clean up [by smeat]
# v1.13 - Minor Clean up [by farmatito]
# v1.14 - remove additional file checks in the chmod loop [by smeat]
# v1.15 - Apply correct ownership and permissions to the apks. [by farmatito]
# v1.16 - very minor cleanups, changed all command subsitutions to be new style [by smeat]
# v1.17 - Print version [by farmatito]
# v1.18 - print what app fix_permissions is working on [by smeat]
# v1.19 - Improve debug info [by farmatito]
# v1.20 - print what app fix_permissions is working on to the log as well [by smeat]
# v1.21 - Handle filenames with spaces correctly - fix version numbering - echo is a busybox applet [by farmatito]
# v1.22 - [ is a busybox applet when android shell is used [by farmatito]
# v1.23 - chmod, cat, mount and umount are busybox applets as well, make sure drives are mounted
# run nearly unchanged in recovery/ROM [by smeat]
# v1.24 - Minor cosmetic fix.
# v1.25 - Remove debug switch (needs getopt) add switch to remove stale data dirs of uninstalled apk packages. [by farmatito]
# v1.26 - Autodetect on which device /system is. [by farmatito]
# v1.27 - Don't complain if we can't remount /system ro and other minor fixes
# v1.28 - Fix mount rw /system and other minor fixes
# v1.29 - Fix some broken tests
VERSION="1.29"
# Turn debug on by uncommenting it in this script,
# by setting DEBUG=1 on the commandline, e.g.
# DEBUG=1 ./fix_permissions
# or by exporting DEBUG=1 before you run the script, e.g.
# export DEBUG=1
# ./fix_permissions
#DEBUG="1"
UID_MSG="Changing user ownership for:"
GID_MSG="Changing group ownership for:"
PERM_MSG="Changing permissions for:"
ECHO="busybox echo"
GREP="busybox grep"
EGREP="busybox egrep"
CAT="busybox cat"
CHOWN="busybox chown"
CHMOD="busybox chmod"
MOUNT="busybox mount"
UMOUNT="busybox umount"
CUT="busybox cut"
FIND="busybox find"
LS="busybox ls"
TR="busybox tr"
TEE="busybox tee"
TEST="busybox test"
SED="busybox sed"
RM="busybox rm"
CODEPATH=""
UID=""
GID=""
PACKAGE=""
REMOVE="0"
if $TEST "$1" = "-h"; then
$ECHO "Usage $0 [OPTIONS]"
$ECHO " -r remove stale data directories"
$ECHO " of uninstalled packages"
$ECHO " -V print version"
$ECHO " -h this help"
elif $TEST "$1" = "-V"; then
$ECHO "$0 $VERSION"
else
if $TEST "$1" = "-r"; then
REMOVE="1"
fi
if $TEST $( $GREP -c " /system " "/proc/mounts" ) -ne "0"; then
DEVICE=$( $GREP " /system " "/proc/mounts" | $CUT -d ' ' -f1 )
if $TEST "x$DEBUG" = "x1"; then
$ECHO "/system mounted on $DEVICE"
fi
if $TEST $( $GREP " /system " "/proc/mounts" | $GREP -c " ro " ) -ne "0"; then
$MOUNT -o remount,rw $DEVICE /system
SYSREMOUNT="1"
fi
else
$MOUNT /system > /dev/null 2>&1
SYSMOUNT="1"
fi
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq "0"; then
$MOUNT /data > /dev/null 2>&1
DATAMOUNT="1"
fi
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " /system/sd " "/proc/mounts" ) -eq "0"; then
$MOUNT /system/sd > /dev/null 2>&1
SYSSDMOUNT="1"
fi
if $TEST $( $MOUNT | $GREP -c /sdcard ) -eq "0"; then
LOG_FILE="/data/fix_permissions.log"
else
LOG_FILE="/sdcard/fix_permissions.log"
fi
if $TEST ! -e "$LOG_FILE"; then
> $LOG_FILE
fi
$ECHO "Starting fix_permissions $VERSION $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
$CAT /data/system/packages.xml | $GREP "^<package" | $GREP serId | $GREP -v framework-res.apk | while read line; do
for i in $( $ECHO $line | $TR " " "\n" ); do
if $TEST $i = "<package"; then
CODEPATH=""
PACKAGE=""
UID=""
GID=""
elif ( $ECHO $i | $GREP "^codePath" > /dev/null ); then
CODEPATH=$( $ECHO $i | $CUT -d '"' -f 2 )
APPDIR0=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 2 )
APPDIR1=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 3 )
APPDIR2=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 4 )
elif ( $ECHO $i | $GREP "^name" > /dev/null ); then
PACKAGE=$( $ECHO $i | $CUT -d '"' -f 2 )
elif ( $ECHO $i | $GREP "^userId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 )
GID=$UID
elif ( $ECHO $i | $GREP "^sharedUserId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 );
GID=$UID
fi
done
if $TEST "x$DEBUG" = "x1"; then
$ECHO "$CODEPATH $APPDIR0/$APPDIR1/$APPDIR2 $UID:$GID" | $TEE -a $LOG_FILE
else
$ECHO "Checking permissions for: $PACKAGE" | $TEE -a $LOG_FILE
fi
if $TEST -e "$CODEPATH"; then
OLD_UID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$APPDIR0" = "system"; then
if $TEST "$OLD_UID" -ne "0"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '0'" | $TEE -a $LOG_FILE
$CHOWN 0 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "0"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '0'" | $TEE -a $LOG_FILE
$CHOWN :0 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR0" = "data"; then
if $TEST "$APPDIR1" = "app"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR1" = "app-private"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$CODEPATH"
fi
chmod 640 "$CODEPATH"
fi
fi
if $TEST -d "/data/data/$PACKAGE"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG /data/data/$PACKAGE from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "/data/data/$PACKAGE"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG /data/data/$PACKAGE from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "/data/data/$PACKAGE"
fi
chmod 755 "/data/data/$PACKAGE"
fi
if $TEST -d "/data/data/$PACKAGE/lib"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG /data/data/$PACKAGE/lib from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "/data/data/$PACKAGE/lib"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG /data/data/$PACKAGE/lib from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "/data/data/$PACKAGE/lib"
fi
chmod 755 "/data/data/$PACKAGE/lib"
fi
for package_dir in $( $LS "/data/data/$PACKAGE" ); do
if $TEST -d "/data/data/$PACKAGE/$package_dir"; then
$FIND "/data/data/$PACKAGE/$package_dir" ! -name lib\* | while read entry; do
if $TEST "x$DEBUG" = "x1"; then
$ECHO "'$entry'" | $TEE -a $LOG_FILE
fi
if $TEST -d "$entry"; then
LS_OUT=$( $LS -ldn "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="1"
else
LS_OUT=$( $LS -ln "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="0"
fi
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG $entry from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "$entry"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $entry from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$entry"
fi
if $TEST "$IS_DIRECTORY" -eq "0"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-rw----"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw-rw---- (660)" | $TEE -a $LOG_FILE
chmod 660 "$entry"
elif $TEST $( $ECHO "$entry" | $EGREP -c "/cache/" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-------"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw------- (600)" | $TEE -a $LOG_FILE
chmod 600 "$entry"
fi
fi
if $TEST "$IS_DIRECTORY" -eq "1"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases|/cache" ) != 0 \
&& $TEST "$OLD_PERM" != "rwxrwx--x"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rwxrwx--x (771)" | $TEE -a $LOG_FILE
chmod 771 "$entry"
fi
fi
done
fi
done
else
$ECHO "$CODEPATH does not exist. Reinstall." | $TEE -a $LOG_FILE
if $TEST $REMOVE -eq "1" ; then
if $TEST -d /data/data/$PACKAGE ; then
$ECHO "Removing stale dir /data/data/$PACKAGE" | $TEE -a $LOG_FILE
$RM -R /data/data/$PACKAGE
fi
fi
fi
done
if $TEST "x$SYSREMOUNT" = "x1"; then
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
fi
if $TEST "x$SYSSDMOUNT" = "x1"; then
$UMOUNT /system/sd > /dev/null 2>&1
fi
if $TEST "x$SYSMOUNT" = "x1"; then
$UMOUNT /system > /dev/null 2>&1
fi
if $TEST "x$DATAMOUNT" = "x1"; then
$UMOUNT /data > /dev/null 2>&1
fi
$ECHO "fix_permissions $VERSION has completed $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
fi
Riyal said:
mount /data partition and execute this command.
find /data -type d -exec chmod 775 {} \;
find /data -type f -exec chmod 644 {} \;
Or you can just reverse the fix permission script.
Since lollipop fix permission has been outdated by SELinux.
Code:
#! /system/bin/sh
#
# Warning: if you want to run this script in cm-recovery change the above to #!/sbin/sh
#
# fix_permissions - fixes permissions on Android data directories after upgrade
# [email protected]
#
# thanks to: http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
#
# v1.1 - work with protected apps
# v1.2 - chown all the subfolders different than 'lib' and the single files [by ankn]
# v1.3 - support for the packages with userShareId; added parameter to support the remount
# mechanism in images different than Cyanogen [by ankn]
# v1.4 - fix the file and directory permissions as well [by smeat]
# v1.5 - integrate code by thenefield for logging and only making changes if needed [by smeat and thenefield]
# v1.6 - Don't mess with user's sdcard, log to it if present or to /data/data/ if not present [by farmatito]
# v1.7 - Simplify and improve readability of script a little, enforce safe default permissions where possible [by farmatito]
# v1.8 - Make sure we choose busybox applets when system binaries with the same name are available [by farmatito]
# v1.9 - reintegrated "chown all the subfolders different than 'lib' and the single files [by ankn]", fixed private app GID [by smeat]
# v1.10 - chmod and chown /data/data/$PACKAGE/lib as well [by smeat]
# v1.11 - logging of /data/data/$PACKAGE/lib, check if /data/data/$PACKAGE/lib needs be changed, fixed ls on chown [by smeat]
# v1.12 - reduced the number of finds down to one, chown and chmod actions reduced to a single loop, bug fixes and code clean up [by smeat]
# v1.13 - Minor Clean up [by farmatito]
# v1.14 - remove additional file checks in the chmod loop [by smeat]
# v1.15 - Apply correct ownership and permissions to the apks. [by farmatito]
# v1.16 - very minor cleanups, changed all command subsitutions to be new style [by smeat]
# v1.17 - Print version [by farmatito]
# v1.18 - print what app fix_permissions is working on [by smeat]
# v1.19 - Improve debug info [by farmatito]
# v1.20 - print what app fix_permissions is working on to the log as well [by smeat]
# v1.21 - Handle filenames with spaces correctly - fix version numbering - echo is a busybox applet [by farmatito]
# v1.22 - [ is a busybox applet when android shell is used [by farmatito]
# v1.23 - chmod, cat, mount and umount are busybox applets as well, make sure drives are mounted
# run nearly unchanged in recovery/ROM [by smeat]
# v1.24 - Minor cosmetic fix.
# v1.25 - Remove debug switch (needs getopt) add switch to remove stale data dirs of uninstalled apk packages. [by farmatito]
# v1.26 - Autodetect on which device /system is. [by farmatito]
# v1.27 - Don't complain if we can't remount /system ro and other minor fixes
# v1.28 - Fix mount rw /system and other minor fixes
# v1.29 - Fix some broken tests
VERSION="1.29"
# Turn debug on by uncommenting it in this script,
# by setting DEBUG=1 on the commandline, e.g.
# DEBUG=1 ./fix_permissions
# or by exporting DEBUG=1 before you run the script, e.g.
# export DEBUG=1
# ./fix_permissions
#DEBUG="1"
UID_MSG="Changing user ownership for:"
GID_MSG="Changing group ownership for:"
PERM_MSG="Changing permissions for:"
ECHO="busybox echo"
GREP="busybox grep"
EGREP="busybox egrep"
CAT="busybox cat"
CHOWN="busybox chown"
CHMOD="busybox chmod"
MOUNT="busybox mount"
UMOUNT="busybox umount"
CUT="busybox cut"
FIND="busybox find"
LS="busybox ls"
TR="busybox tr"
TEE="busybox tee"
TEST="busybox test"
SED="busybox sed"
RM="busybox rm"
CODEPATH=""
UID=""
GID=""
PACKAGE=""
REMOVE="0"
if $TEST "$1" = "-h"; then
$ECHO "Usage $0 [OPTIONS]"
$ECHO " -r remove stale data directories"
$ECHO " of uninstalled packages"
$ECHO " -V print version"
$ECHO " -h this help"
elif $TEST "$1" = "-V"; then
$ECHO "$0 $VERSION"
else
if $TEST "$1" = "-r"; then
REMOVE="1"
fi
if $TEST $( $GREP -c " /system " "/proc/mounts" ) -ne "0"; then
DEVICE=$( $GREP " /system " "/proc/mounts" | $CUT -d ' ' -f1 )
if $TEST "x$DEBUG" = "x1"; then
$ECHO "/system mounted on $DEVICE"
fi
if $TEST $( $GREP " /system " "/proc/mounts" | $GREP -c " ro " ) -ne "0"; then
$MOUNT -o remount,rw $DEVICE /system
SYSREMOUNT="1"
fi
else
$MOUNT /system > /dev/null 2>&1
SYSMOUNT="1"
fi
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq "0"; then
$MOUNT /data > /dev/null 2>&1
DATAMOUNT="1"
fi
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " /system/sd " "/proc/mounts" ) -eq "0"; then
$MOUNT /system/sd > /dev/null 2>&1
SYSSDMOUNT="1"
fi
if $TEST $( $MOUNT | $GREP -c /sdcard ) -eq "0"; then
LOG_FILE="/data/fix_permissions.log"
else
LOG_FILE="/sdcard/fix_permissions.log"
fi
if $TEST ! -e "$LOG_FILE"; then
> $LOG_FILE
fi
$ECHO "Starting fix_permissions $VERSION $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
$CAT /data/system/packages.xml | $GREP "^<package" | $GREP serId | $GREP -v framework-res.apk | while read line; do
for i in $( $ECHO $line | $TR " " "\n" ); do
if $TEST $i = "<package"; then
CODEPATH=""
PACKAGE=""
UID=""
GID=""
elif ( $ECHO $i | $GREP "^codePath" > /dev/null ); then
CODEPATH=$( $ECHO $i | $CUT -d '"' -f 2 )
APPDIR0=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 2 )
APPDIR1=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 3 )
APPDIR2=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 4 )
elif ( $ECHO $i | $GREP "^name" > /dev/null ); then
PACKAGE=$( $ECHO $i | $CUT -d '"' -f 2 )
elif ( $ECHO $i | $GREP "^userId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 )
GID=$UID
elif ( $ECHO $i | $GREP "^sharedUserId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 );
GID=$UID
fi
done
if $TEST "x$DEBUG" = "x1"; then
$ECHO "$CODEPATH $APPDIR0/$APPDIR1/$APPDIR2 $UID:$GID" | $TEE -a $LOG_FILE
else
$ECHO "Checking permissions for: $PACKAGE" | $TEE -a $LOG_FILE
fi
if $TEST -e "$CODEPATH"; then
OLD_UID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$APPDIR0" = "system"; then
if $TEST "$OLD_UID" -ne "0"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '0'" | $TEE -a $LOG_FILE
$CHOWN 0 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "0"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '0'" | $TEE -a $LOG_FILE
$CHOWN :0 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR0" = "data"; then
if $TEST "$APPDIR1" = "app"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR1" = "app-private"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$CODEPATH"
fi
chmod 640 "$CODEPATH"
fi
fi
if $TEST -d "/data/data/$PACKAGE"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG /data/data/$PACKAGE from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "/data/data/$PACKAGE"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG /data/data/$PACKAGE from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "/data/data/$PACKAGE"
fi
chmod 755 "/data/data/$PACKAGE"
fi
if $TEST -d "/data/data/$PACKAGE/lib"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG /data/data/$PACKAGE/lib from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "/data/data/$PACKAGE/lib"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG /data/data/$PACKAGE/lib from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "/data/data/$PACKAGE/lib"
fi
chmod 755 "/data/data/$PACKAGE/lib"
fi
for package_dir in $( $LS "/data/data/$PACKAGE" ); do
if $TEST -d "/data/data/$PACKAGE/$package_dir"; then
$FIND "/data/data/$PACKAGE/$package_dir" ! -name lib\* | while read entry; do
if $TEST "x$DEBUG" = "x1"; then
$ECHO "'$entry'" | $TEE -a $LOG_FILE
fi
if $TEST -d "$entry"; then
LS_OUT=$( $LS -ldn "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="1"
else
LS_OUT=$( $LS -ln "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="0"
fi
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG $entry from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "$entry"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $entry from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$entry"
fi
if $TEST "$IS_DIRECTORY" -eq "0"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-rw----"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw-rw---- (660)" | $TEE -a $LOG_FILE
chmod 660 "$entry"
elif $TEST $( $ECHO "$entry" | $EGREP -c "/cache/" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-------"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw------- (600)" | $TEE -a $LOG_FILE
chmod 600 "$entry"
fi
fi
if $TEST "$IS_DIRECTORY" -eq "1"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases|/cache" ) != 0 \
&& $TEST "$OLD_PERM" != "rwxrwx--x"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rwxrwx--x (771)" | $TEE -a $LOG_FILE
chmod 771 "$entry"
fi
fi
done
fi
done
else
$ECHO "$CODEPATH does not exist. Reinstall." | $TEE -a $LOG_FILE
if $TEST $REMOVE -eq "1" ; then
if $TEST -d /data/data/$PACKAGE ; then
$ECHO "Removing stale dir /data/data/$PACKAGE" | $TEE -a $LOG_FILE
$RM -R /data/data/$PACKAGE
fi
fi
fi
done
if $TEST "x$SYSREMOUNT" = "x1"; then
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
fi
if $TEST "x$SYSSDMOUNT" = "x1"; then
$UMOUNT /system/sd > /dev/null 2>&1
fi
if $TEST "x$SYSMOUNT" = "x1"; then
$UMOUNT /system > /dev/null 2>&1
fi
if $TEST "x$DATAMOUNT" = "x1"; then
$UMOUNT /data > /dev/null 2>&1
fi
$ECHO "fix_permissions $VERSION has completed $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
fi
Click to expand...
Click to collapse
Thanks for stepping in, i was really at a loss.
Sent from my Twi5ted SM-G900A using Tapatalk
Riyal said:
mount /data partition and execute this command.
find /data -type d -exec chmod 775 {} \;
find /data -type f -exec chmod 644 {} \;
Or you can just reverse the fix permission script.
Since lollipop fix permission has been outdated by SELinux.
Code:
#! /system/bin/sh
#
# Warning: if you want to run this script in cm-recovery change the above to #!/sbin/sh
#
# fix_permissions - fixes permissions on Android data directories after upgrade
# [email protected]
#
# thanks to: http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
#
# v1.1 - work with protected apps
# v1.2 - chown all the subfolders different than 'lib' and the single files [by ankn]
# v1.3 - support for the packages with userShareId; added parameter to support the remount
# mechanism in images different than Cyanogen [by ankn]
# v1.4 - fix the file and directory permissions as well [by smeat]
# v1.5 - integrate code by thenefield for logging and only making changes if needed [by smeat and thenefield]
# v1.6 - Don't mess with user's sdcard, log to it if present or to /data/data/ if not present [by farmatito]
# v1.7 - Simplify and improve readability of script a little, enforce safe default permissions where possible [by farmatito]
# v1.8 - Make sure we choose busybox applets when system binaries with the same name are available [by farmatito]
# v1.9 - reintegrated "chown all the subfolders different than 'lib' and the single files [by ankn]", fixed private app GID [by smeat]
# v1.10 - chmod and chown /data/data/$PACKAGE/lib as well [by smeat]
# v1.11 - logging of /data/data/$PACKAGE/lib, check if /data/data/$PACKAGE/lib needs be changed, fixed ls on chown [by smeat]
# v1.12 - reduced the number of finds down to one, chown and chmod actions reduced to a single loop, bug fixes and code clean up [by smeat]
# v1.13 - Minor Clean up [by farmatito]
# v1.14 - remove additional file checks in the chmod loop [by smeat]
# v1.15 - Apply correct ownership and permissions to the apks. [by farmatito]
# v1.16 - very minor cleanups, changed all command subsitutions to be new style [by smeat]
# v1.17 - Print version [by farmatito]
# v1.18 - print what app fix_permissions is working on [by smeat]
# v1.19 - Improve debug info [by farmatito]
# v1.20 - print what app fix_permissions is working on to the log as well [by smeat]
# v1.21 - Handle filenames with spaces correctly - fix version numbering - echo is a busybox applet [by farmatito]
# v1.22 - [ is a busybox applet when android shell is used [by farmatito]
# v1.23 - chmod, cat, mount and umount are busybox applets as well, make sure drives are mounted
# run nearly unchanged in recovery/ROM [by smeat]
# v1.24 - Minor cosmetic fix.
# v1.25 - Remove debug switch (needs getopt) add switch to remove stale data dirs of uninstalled apk packages. [by farmatito]
# v1.26 - Autodetect on which device /system is. [by farmatito]
# v1.27 - Don't complain if we can't remount /system ro and other minor fixes
# v1.28 - Fix mount rw /system and other minor fixes
# v1.29 - Fix some broken tests
VERSION="1.29"
# Turn debug on by uncommenting it in this script,
# by setting DEBUG=1 on the commandline, e.g.
# DEBUG=1 ./fix_permissions
# or by exporting DEBUG=1 before you run the script, e.g.
# export DEBUG=1
# ./fix_permissions
#DEBUG="1"
UID_MSG="Changing user ownership for:"
GID_MSG="Changing group ownership for:"
PERM_MSG="Changing permissions for:"
ECHO="busybox echo"
GREP="busybox grep"
EGREP="busybox egrep"
CAT="busybox cat"
CHOWN="busybox chown"
CHMOD="busybox chmod"
MOUNT="busybox mount"
UMOUNT="busybox umount"
CUT="busybox cut"
FIND="busybox find"
LS="busybox ls"
TR="busybox tr"
TEE="busybox tee"
TEST="busybox test"
SED="busybox sed"
RM="busybox rm"
CODEPATH=""
UID=""
GID=""
PACKAGE=""
REMOVE="0"
if $TEST "$1" = "-h"; then
$ECHO "Usage $0 [OPTIONS]"
$ECHO " -r remove stale data directories"
$ECHO " of uninstalled packages"
$ECHO " -V print version"
$ECHO " -h this help"
elif $TEST "$1" = "-V"; then
$ECHO "$0 $VERSION"
else
if $TEST "$1" = "-r"; then
REMOVE="1"
fi
if $TEST $( $GREP -c " /system " "/proc/mounts" ) -ne "0"; then
DEVICE=$( $GREP " /system " "/proc/mounts" | $CUT -d ' ' -f1 )
if $TEST "x$DEBUG" = "x1"; then
$ECHO "/system mounted on $DEVICE"
fi
if $TEST $( $GREP " /system " "/proc/mounts" | $GREP -c " ro " ) -ne "0"; then
$MOUNT -o remount,rw $DEVICE /system
SYSREMOUNT="1"
fi
else
$MOUNT /system > /dev/null 2>&1
SYSMOUNT="1"
fi
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq "0"; then
$MOUNT /data > /dev/null 2>&1
DATAMOUNT="1"
fi
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " /system/sd " "/proc/mounts" ) -eq "0"; then
$MOUNT /system/sd > /dev/null 2>&1
SYSSDMOUNT="1"
fi
if $TEST $( $MOUNT | $GREP -c /sdcard ) -eq "0"; then
LOG_FILE="/data/fix_permissions.log"
else
LOG_FILE="/sdcard/fix_permissions.log"
fi
if $TEST ! -e "$LOG_FILE"; then
> $LOG_FILE
fi
$ECHO "Starting fix_permissions $VERSION $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
$CAT /data/system/packages.xml | $GREP "^<package" | $GREP serId | $GREP -v framework-res.apk | while read line; do
for i in $( $ECHO $line | $TR " " "\n" ); do
if $TEST $i = "<package"; then
CODEPATH=""
PACKAGE=""
UID=""
GID=""
elif ( $ECHO $i | $GREP "^codePath" > /dev/null ); then
CODEPATH=$( $ECHO $i | $CUT -d '"' -f 2 )
APPDIR0=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 2 )
APPDIR1=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 3 )
APPDIR2=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 4 )
elif ( $ECHO $i | $GREP "^name" > /dev/null ); then
PACKAGE=$( $ECHO $i | $CUT -d '"' -f 2 )
elif ( $ECHO $i | $GREP "^userId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 )
GID=$UID
elif ( $ECHO $i | $GREP "^sharedUserId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 );
GID=$UID
fi
done
if $TEST "x$DEBUG" = "x1"; then
$ECHO "$CODEPATH $APPDIR0/$APPDIR1/$APPDIR2 $UID:$GID" | $TEE -a $LOG_FILE
else
$ECHO "Checking permissions for: $PACKAGE" | $TEE -a $LOG_FILE
fi
if $TEST -e "$CODEPATH"; then
OLD_UID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$APPDIR0" = "system"; then
if $TEST "$OLD_UID" -ne "0"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '0'" | $TEE -a $LOG_FILE
$CHOWN 0 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "0"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '0'" | $TEE -a $LOG_FILE
$CHOWN :0 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR0" = "data"; then
if $TEST "$APPDIR1" = "app"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR1" = "app-private"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$CODEPATH"
fi
chmod 640 "$CODEPATH"
fi
fi
if $TEST -d "/data/data/$PACKAGE"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG /data/data/$PACKAGE from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "/data/data/$PACKAGE"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG /data/data/$PACKAGE from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "/data/data/$PACKAGE"
fi
chmod 755 "/data/data/$PACKAGE"
fi
if $TEST -d "/data/data/$PACKAGE/lib"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG /data/data/$PACKAGE/lib from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "/data/data/$PACKAGE/lib"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG /data/data/$PACKAGE/lib from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "/data/data/$PACKAGE/lib"
fi
chmod 755 "/data/data/$PACKAGE/lib"
fi
for package_dir in $( $LS "/data/data/$PACKAGE" ); do
if $TEST -d "/data/data/$PACKAGE/$package_dir"; then
$FIND "/data/data/$PACKAGE/$package_dir" ! -name lib\* | while read entry; do
if $TEST "x$DEBUG" = "x1"; then
$ECHO "'$entry'" | $TEE -a $LOG_FILE
fi
if $TEST -d "$entry"; then
LS_OUT=$( $LS -ldn "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="1"
else
LS_OUT=$( $LS -ln "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="0"
fi
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG $entry from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "$entry"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $entry from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$entry"
fi
if $TEST "$IS_DIRECTORY" -eq "0"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-rw----"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw-rw---- (660)" | $TEE -a $LOG_FILE
chmod 660 "$entry"
elif $TEST $( $ECHO "$entry" | $EGREP -c "/cache/" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-------"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw------- (600)" | $TEE -a $LOG_FILE
chmod 600 "$entry"
fi
fi
if $TEST "$IS_DIRECTORY" -eq "1"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases|/cache" ) != 0 \
&& $TEST "$OLD_PERM" != "rwxrwx--x"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rwxrwx--x (771)" | $TEE -a $LOG_FILE
chmod 771 "$entry"
fi
fi
done
fi
done
else
$ECHO "$CODEPATH does not exist. Reinstall." | $TEE -a $LOG_FILE
if $TEST $REMOVE -eq "1" ; then
if $TEST -d /data/data/$PACKAGE ; then
$ECHO "Removing stale dir /data/data/$PACKAGE" | $TEE -a $LOG_FILE
$RM -R /data/data/$PACKAGE
fi
fi
fi
done
if $TEST "x$SYSREMOUNT" = "x1"; then
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
fi
if $TEST "x$SYSSDMOUNT" = "x1"; then
$UMOUNT /system/sd > /dev/null 2>&1
fi
if $TEST "x$SYSMOUNT" = "x1"; then
$UMOUNT /system > /dev/null 2>&1
fi
if $TEST "x$DATAMOUNT" = "x1"; then
$UMOUNT /data > /dev/null 2>&1
fi
$ECHO "fix_permissions $VERSION has completed $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
fi
Click to expand...
Click to collapse
hi Riyal thanks for joining in what do i do with this script you have sent ? is it already reversed or is thei what i have already run and needs reversed ? how do i run this script on the phone ?
i run the 2 chmod commands and thing iv lost adb access via the boot screen now (still have adb via twrp recovery)
i now have sound with my samsung logo
dont remember having that before so possibly fixed something
OK... I was thinking this must be a SELinux issue we're having so why not do this instead...
1. Boot to TWRP and mount data.
2. Open TWRP's built in terminal
3. Type these commands to fix SELinux issues with the files in data.
Code:
setenforce 0
getenforce
restorecon -RF /data
setenforce 0 - this should set the SELinux status to permissive.
getenforce - this should output the SELinux status. Note that this must output "permissive" if it's "enforcing" execute the first command again.
restorecon -RF /data - this should restore the security context of the files in the /data partition
after executing the 3 commands reboot again to system.
Riyal said:
OK... I was thinking this must be a SELinux issue we're having so why not do this instead...
1. Boot to TWRP and mount data.
2. Open TWRP's built in terminal
3. Type these commands to fix SELinux issues with the files in data.
Code:
setenforce 0
getenforce
restorecon -RF /data
setenforce 0 - this should set the SELinux status to permissive.
getenforce - this should output the SELinux status. Note that this must output "permissive" if it's "enforcing" execute the first command again.
restorecon -RF /data - this should restore the security context of the files in the /data partition
after executing the 3 commands reboot again to system.
Click to expand...
Click to collapse
i ran getenforce first to see the status it was enforcing
setenforce 0 and rerun getenforce now permissive
attempted to run restorecon -RF /data but come up with : invalid option -- F
usage: restorecon [-nrRv] pathname...
rebooted to system to see how we done so far if any change at all
appear to be no further forward
was going to run the command again without the F flag but figured without me knowing the usage of the flags this could do more harm than good
@killabyte0
It failed... Try running without the F option... Seems like restorecon for android is crippled :/ But try doing the commands again but this time execute restorecon without the F which would be
Code:
restorecon -R /data
Riyal said:
@killabyte0
It failed... Try running without the F option... Seems like restorecon for android is crippled :/ But try doing the commands again but this time execute restorecon without the F which would be
Code:
restorecon -R /data
Click to expand...
Click to collapse
~ # restorecon -R /data
/sbin/sh: ~: not found
~ #
killabyte0 said:
~ # restorecon -R /data
/sbin/sh: ~: not found
~ #
Click to expand...
Click to collapse
Did you mount /data?
Sent from my Twi5ted SM-G900A using Tapatalk

Categories

Resources