Related
Code:
* Your warranty is now void..
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, you getting dumped or you getting fired because your phone
* bootloops and alarm does not go off. Please do some research if you have any
* YOU are choosing to make these modifications.
{
"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"
}
Requirements :-
- Android 4.0+
- Custom kernel (with init.d support)
- Root and Busybox installed
- 3MB of free space in "/system".
Feature :-
- Full memory management.
- kernel tweaks and improvements for better performance and battery life.
- Entropy generator engine used to reduce lags.
- Zipalign apps in "/system" and apps in "/data" every 48 hours which result in less RAM usage.
- Sqlite optimizations and faster database access.
- CPU governors tweaks and improvements for better performance and battery life.
- Increased SD Card read-ahead cache to 2048 KB .
- Ad blocking.
- Default.prop tweaks and improvements.
- Cleans log files and tombstones at every boot.
- Many other tweaks for better performance and battery life!
Steps :-
- go to system/etc/init.d/delete all files in it
- Download the zip
- Flash zip via recovery
- Feel the difference (1st boot may take time)
Some part of my Default .prop
#enable harware egl profile
debug.egl.profiler=1
#16BIT transparency , Smother Scrolling
persist.sys.use_16bpp_alpha=1
#debug.composition.type=gpu
debug.composition.type=c2d
debug.performance.tuning=1
debug.enabletr=true
debug.qctwa.preservebuf=1
dev.pm.dyn_samplingrate=1
video.accelerate.hw=1
ro.vold.umsdirtyratio=20
debug.overlayui.enable=1
debug.egl.hw=1
ro.fb.mode=1
hw3d.force=1
persist.sys.composition.type=c2d
persist.sys.ui.hw=1
ro.sf.compbypass.enable=0
#Enable tile rendering
debug.enabletr=true
persist.sys.composition.type=gpu
#3d performance
persist.android.strictmode=0
ro.min_pointer_dur=1
ro.secure=0
#Media quality
ro.media.enc.jpeg.quality=100
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
ro.media.dec.aud.wma.enabled=1
ro.media.dec.vid.wmv.enabled=1
ro.media.cam.preview.fps=0
ro.media.codec_priority_for_thumb=so
#Speed liquid
persist.service.lgospd.enable=0
persist.service.pcsync.enable=0
# For sensor sleep control
ro.ril.sensor.sleep.control=1
#loggers
ro.config.htc.nocheckin=1
ro.config.nocheckin=1
profiler.force_disable_ulog=1
profiler.force_disable_err_rpt=1
#Scrolling
windowsmgr.max_events_per_sec=90
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
#battery saver
ro.ril.disable.power.collapse=1
pm.sleep_mode=1
usb_wakeup=enable
proximity_incall=enable
power_supply.wakeup=enable
ro.config.hw_power_saving=1
ro.config.hw_fast_dormancy=1
ro.config.hw_quickpoweron=true
persist.sys.use_dithering=0
#improve battery under no signal -- need test
ro.mot.eri.losalert.delay=1000
#net speedtweaks
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.hspda=4096,87380,256960,4096,16 384,256960
net.tcp.buffersize.hspa=4096,87380,256960,4096,163 84,256960
#streaming faster
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
media.stagefright.enable-record=true
Some part of INIT.D :-
# Disable Logger
busybox rm /dev/log/main
# Busybox Remounting
busybox mount -o remount,noatime,barrier=0,nobh /system
busybox mount -o remount,noatime,barrier=0,nobh /data
busybox mount -o remount,noatime,barrier=0,nobh /cache
echo "Mounted Busybox"
# clearing junk files
busybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';' -exec echo "Cleared {}" ';'
rm -f /data/local/*.apk
rm -f /data/local/tmp/*.apk
rm -f /data/*.log
rm -f /data/log/*.log
rm -f /cache/*.*
rm -f /cache/recovery/*.*
rm -f /data/system/dropbox/*.txt
rm -f /data/backup/pending/*.tmp
rm -f /data/tombstones/*.*
echo "Junk cleared"
# Defrag Database Files
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
# Move Dalvik-Cache To Cache Partition
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 4000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
echo "Moved Dalvik-Cache To Cache Partition"
# Mod: Battery
setprop wifi.supplicant_scan_interval=180
setprop pm.sleep_mode=1
setprop ro.ril.disable.power.collapse=1
# Mod: Performance
setprop ro.kernel.android.checkjni=0
setprop persist.sys.purgeable_assets=1
setprop debug.sf.hw=1
setprop ro.telephony.call_ring.delay=0
setprop ro.foreground_app_mem=1280
setprop ro.visible_app_mem=2560
setprop ro.perceptible_app_mem=3840
setprop ro.heavy_weight_app_mem=6400
setprop ro.secondary_server_mem=7680
setprop ro.backup_app_mem=8960
setprop ro.home_app_mem=2048
setprop ro.hidden_app_mem=12800
setprop ro.content_provider_mem=15360
setprop ro.empty_app_mem=20480
setprop ro.foreground_app_adj=0
setprop ro.visible_app_adj=1
setprop ro.perceptible_app_adj=2
setprop ro.heavy_weight_app_adj=4
setprop ro.secondary_server_adj=5
setprop ro.backup_app_adj=6
setprop ro.home_app_adj=1
setprop ro.hidden_app_min_adj=7
setprop ro.empty_app_adj=15
# Mod: Graphics
setprop debug.performance.tuning=1
setprop video.accelerate.hw=1
setprop ro.media.dec.jpeg.memcap=8000000
setprop ro.media.enc.hprof.vid.bps=8000000
setprop persist.sys.use_dithering 1
# Touch Screen Sensitivity
echo 7035 > /sys/class/touch/switch/set_touchscreen;
echo 8002 > /sys/class/touch/switch/set_touchscreen;
echo 11000 > /sys/class/touch/switch/set_touchscreen;
echo 13060 > /sys/class/touch/switch/set_touchscreen;
echo 14005 > /sys/class/touch/switch/set_touchscreen;
# Renice Apps
renice -20 `pidof com.android.phone`
renice -19 `pidof com.android.inputmethod.latin`
renice -19 `pidof com.swype.android.inputmethod`
renice -17 `pidof com.android.systemui`
renice -9 `pidof com.android.settings`
renice -9 `pidof com.android.vending`
renice -6 `pidof com.sec.android.app.camera`
renice -6 `pidof com.sec.android.app.fm`
renice -6 `pidof com.google.android.apps.maps`
renice -4 `pidof com.google.android.apps.googlevoice`
renice -3 `pidof android.process.media`
# SqLite Optimize
for i in \
`busybox find /data -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
if [ -d "/dbdata" ]; then
for i in \
`busybox find /dbdata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
if [ -d "/datadata" ]; then
for i in \
`busybox find /datadata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
for i in \
`busybox find /sdcard -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
echo "SqLite Database Optimized"
echo "System Optimized And Boosted at $( date +"%m-%d-%Y %H:%M:%S" )"
function mountrw {
mount|grep "/system "|grep rw >/dev/null
[ $? -eq 1 ] && mount -o remount,rw $(mount|grep "/system "|awk '{ print $1 }') /system
}
function mountro {
mount|grep "/system "|grep ro >/dev/null
[ $? -eq 1 ] && mount -o remount,ro $(mount|grep "/system "|awk '{ print $1 }') /system
}
echo " Starting package optimization"
echo "Starting ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )"
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
mountrw;
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC;
fi;
else
echo Velocity ZipAlign already completed on $apk
fi;
done;
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC
fi;
else
echo Velocity ZipAlign already completed on $apk
fi;
done;
mountro;
echo "ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )"
Thanks for your work. I had some FC issues after installing v3, I wonder if you fixed any?
do this
reserved
opps
masteriori said:
Thanks for your work. I had some FC issues after installing v3, I wonder if you fixed any?
Click to expand...
Click to collapse
i didnt face any fc issue which rom do u use
even i dint face any
gauravj said:
go to system/etc/init.d delete all files flash this :good:
Click to expand...
Click to collapse
Ok, will try. Also, it seems as though, I have been having issues with my microSD after v3. Hoping v4 doesn't have such issues :good:
---------- Post added at 09:43 AM ---------- Previous post was at 09:42 AM ----------
iossux said:
i didnt face any fc issue which rom do u use
Click to expand...
Click to collapse
I am on Zelly Cream 3.1.
I appreciate your work.
I must say that with v3 after a few hours there has been a total collapse of the phone. I failed the backup or restore the phone to normal.
then re-install .13 FTF, format sd, install rom, restore the settings before speed v3.
Is v4 fix, or we can expect problems? thanks
bane.twit said:
I appreciate your work.
I must say that with v3 after a few hours there has been a total collapse of the phone. I failed the backup or restore the phone to normal.
then re-install .13 FTF, format sd, install rom, restore the settings before speed v3.
Is v4 fix, or we can expect problems? thanks
Click to expand...
Click to collapse
Did you have issues with your microSD after v3? I have been having freezes using RootExplorer, copying/moving apps/files, the app just gets stuck.
nope
bane.twit said:
I appreciate your work.
I must say that with v3 after a few hours there has been a total collapse of the phone. I failed the backup or restore the phone to normal.
then re-install .13 FTF, format sd, install rom, restore the settings before speed v3.
Is v4 fix, or we can expect problems? thanks
Click to expand...
Click to collapse
no problem in v4 works very properly
<br />
no problem in v4 works very properly
Click to expand...
Click to collapse
Ok, tnx.
Sent from my Xperia Arc S using xda app-developers app
So far so good, will test further and report back. :good:
masteriori said:
Did you have issues with your microSD after v3? I have been having freezes using RootExplorer, copying/moving apps/files, the app just gets stuck.
Click to expand...
Click to collapse
masteriori said:
So far so good, will test further and report back. :good:
Click to expand...
Click to collapse
yes mate, I am waiting your beck report. tnx
!!!!
masteriori said:
So far so good, will test further and report back. :good:
Click to expand...
Click to collapse
report:good:
How can i understand does tweaks are work ?
lol
bluxe said:
How can i understand does tweaks are work ?
Click to expand...
Click to collapse
u will automatically see improvement in touch responce, less cpu usage , more free ram etc
DO we need to delete all files in the int. folder first before update to v4?
yup
WaterMelon90 said:
DO we need to delete all files in the int. folder first before update to v4?
Click to expand...
Click to collapse
yes we have to do it think so
---------- Post added at 11:33 AM ---------- Previous post was at 11:17 AM ----------
the tweaks work preferctly for me really improved overall performance of phone
but takes time to boot
hehe
iossux said:
yes we have to do it think so
---------- Post added at 11:33 AM ---------- Previous post was at 11:17 AM ----------
the tweaks work preferctly for me really improved overall performance of phone
but takes time to boot
Click to expand...
Click to collapse
thnx:angel:
:0
gauravj said:
u will automatically see improvement in touch responce, less cpu usage , more free ram etc
Click to expand...
Click to collapse
I've checked "sys/devices/virtual/bdi/179:0/" and "read_ahead_kb" is still the same (128kb) and checked zRam then swap still "0"
I guess tweaks are not working on my device. btw permissions of your tweaks "rw-r-r" but permissions of orginal cm10 tweaks "rwxr-xr-x". I tried changing the permissions but still doesn't work.
Device inf; Xperia Arc S - Fusion Kernel 5.5 - CM10)
btw sorry for my little English.
sorry
bluxe said:
:0
I've checked "sys/devices/virtual/bdi/179:0/" and "read_ahead_kb" is still the same (128kb) and checked zRam then swap still "0"
I guess tweaks are not working on my device. btw permissions of your tweaks "rw-r-r" but permissions of orginal cm10 tweaks "rwxr-xr-x". I tried changing the permissions but still doesn't work.
Device inf; Xperia Arc S - Fusion Kernel 5.5 - CM10)
btw sorry for my little English.
Click to expand...
Click to collapse
tweaks are not build for cm i will pm u if i found some good tweaks:good:
Hello I'm on oxygenOS 2.1.1 (one plus 2) with a custom kernel and today I woke up and noticed Xposed wasn't active.. I didn't change any setting from the setup I had with Xposed working, and even after rebooting; reflashing rom+Xposed; flashing the Uninstaller and then reflashing Xposed would not make it work again.
Xposed reports "Xposed's latest version is not active. Have you installed the framework and rebooted? "
Here's a screenshot
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Next time I'll better do a search. Installing busybox from playstore solved the problem
kal eh said:
Next time I'll better do a search. Installing busybox from playstore solved the problem
Click to expand...
Click to collapse
Thanks for coming back and posting the solution, even though it does not pertain to me
banderos101 said:
Thanks for coming back and posting the solution, even though it does not pertain to me
Click to expand...
Click to collapse
Have you tried a /system and both cache wipe? Then install rom (supersu) gapps xposed??
edit: lol misundersoo d
Hello!
I have the same problem:
I installed the framework manually (ASUS MemoPad 7 (ME572CL) has currently no means to unlock the bootloader, so there is no custom recovery). Also I installed the Xposed Installer alpha 4 apk.
Then I restarted the MemoPad 7, but the Xposed Installer app told me the the latest version (v75) is installed but not active. So I installed Busybox as mentioned and restarted. But there is no change and Xposed framework remains inactive.
Any idea what's going wrong here?
klausstoertebeker said:
Hello!
I have the same problem:
I installed the framework manually (ASUS MemoPad 7 (ME572CL) has currently no means to unlock the bootloader, so there is no custom recovery). Also I installed the Xposed Installer alpha 4 apk.
Then I restarted the MemoPad 7, but the Xposed Installer app told me the the latest version (v75) is installed but not active. So I installed Busybox as mentioned and restarted. But there is no change and Xposed framework remains inactive.
Any idea what's going wrong here?
Click to expand...
Click to collapse
Without a custom recovery, you won't be able to install the Xposed framework properly. A custom recovery is mandatory.
So you want to tell me that everybody who cannot unlock the bootloader of his/her device won't be able to use Xposed framework? I don't believe that because there are posts concerning successful installations on those devices. So there must be a way...
kal eh said:
Have you tried a /system and both cache wipe? Then install rom (supersu) gapps xposed??
Click to expand...
Click to collapse
Sorry, probably should have phrased that better............i dont have this problem, i was just commenting that its nice to see someone post the solution to their issue instead of not, if/when they find it, as it might end up helping someone else down the line someday
Hello again!
I was able to install Xposed framework on my ASUS MemoPad 7 (ME572CL) without unlocked bootloader and therefore without custom recovery.
And for everybody interested in I'll tell in the following how I made it
Prerequisites:
- a rooted device
- a terminal emulator able to run in root mode (I used that from ROM Toolbox Pro)
- the xposed ZIP file compatible with your devices architecture and Android version (can be downloades here)
Now find out the architecture of your device. For this you have to open the file "/system/build.prop" and search for one of these strings:
"ro.product.cpu.abilist32" or
"ro.product.cpu.abilist64"
One of these entries is NOT empty and contains data describing the architecture (in my case it was the first entry which wasn't empty and looked like:
"ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi" - so I have a 32 Bit X86-architecture)
Next find out the sdk version which was used for building your Android system. Again search the file "/system/build.prop", but this time for the string:
"ro.build.version.sdk" (in my case it looked like: "ro.build.version.sdk=21" - so they have used sdk version 21 to build my Android system)
Now you know which file to download (for me it was xposed-v75-sdk21-x86.zip)
After download unzip the file to where you want Now open the terminal emulator, apply the "SU"-command and change to the directory "META-INF" found in the unzipped xposed folder. Then apply the command "touch flash-script.sh" to generate an alternatve install script. Open this file with a text editor and fill in the following code:
Code:
##########################################################################################
#
# Xposed framework installer zip.
#
# This script installs the Xposed framework files to the system partition.
# The Xposed Installer app is needed as well to manage the installed modules.
#
##########################################################################################
cp_perm() {
cp -f $1 $2 || exit 1
set_perm $2 $3 $4 $5 $6
}
set_perm() {
chown $2:$3 $1 || exit 1
chmod $4 $1 || exit 1
if [ "$5" ]; then
chcon $5 $1 2>/dev/null
else
chcon 'u:object_r:system_file:s0' $1 2>/dev/null
fi
}
install_nobackup() {
cp_perm ..$1 $1 $2 $3 $4 $5
}
install_and_link() {
TARGET=$1
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f ..$XPOSED ]; then
return
fi
cp_perm ..$XPOSED $XPOSED $2 $3 $4 $5
if [ ! -f $BACKUP ]; then
mv $TARGET $BACKUP || exit 1
ln -s $XPOSED $TARGET || exit 1
chcon -h 'u:object_r:system_file:s0' $TARGET 2>/dev/null
fi
}
install_overwrite() {
TARGET=$1
if [ ! -f ..$TARGET ]; then
return
fi
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f $TARGET ]; then
touch $NO_ORIG || exit 1
set_perm $NO_ORIG 0 0 600
elif [ -f $BACKUP ]; then
rm -f $TARGET
gzip $BACKUP || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" -a ! -f $NO_ORIG ]; then
mv $TARGET $BACKUP || exit 1
gzip $BACKUP || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm ..$TARGET $TARGET $2 $3 $4 $5
}
##########################################################################################
echo "******************************"
echo "Xposed framework installer zip"
echo "******************************"
echo "- Mounting /system and /vendor read-write"
mount /system >/dev/null 2>&1
mount /vendor >/dev/null 2>&1
mount -o remount,rw /system
mount -o remount,rw /vendor >/dev/null 2>&1
if [ ! -f '/system/build.prop' ]; then
echo "! Failed: /system could not be mounted!"
exit 1
fi
echo "- Placing files"
install_nobackup /system/xposed.prop 0 0 0644
install_nobackup /system/framework/XposedBridge.jar 0 0 0644
install_and_link /system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0
install_overwrite /system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0
install_overwrite /system/bin/oatdump 0 2000 0755
install_overwrite /system/bin/patchoat 0 2000 0755 u:object_r:dex2oat_exec:s0
install_overwrite /system/lib/libart.so 0 0 0644
install_overwrite /system/lib/libart-compiler.so 0 0 0644
install_overwrite /system/lib/libart-disassembler.so 0 0 0644
install_overwrite /system/lib/libsigchain.so 0 0 0644
install_overwrite /system/lib/libxposed_art.so 0 0 0644
echo "- Done"
exit 0
PLEASE BE AWARE THAT THIS SCRIPT ONLY WORKS WITH 32 BIT VERSIONS. FOR 64 BIT VERSIONS IT HAS TO BE ADOPTED! BECAUSE I DON'T HAVE A 64 BIT SYSTEM I WASN'T ABLE TO DO THIS!
After saving the changes run this script by applying the command "sh flash-script.sh". This should install the framework as intended by rovo89. I got some linker error messages (something like not found) concerning "libsigchain.so" - I ignored them, but it worked.
And don't forget to install the "XposedInstaller_3.0_alpha4.apk"
klausstoertebeker said:
Hello again!
I was able to install Xposed framework on my ASUS MemoPad 7 (ME572CL) without unlocked bootloader and therefore without custom recovery.
And for everybody interested in I'll tell in the following how I made it
Prerequisites:
- a rooted device
- a terminal emulator able to run in root mode (I used that from ROM Toolbox Pro)
- the xposed ZIP file compatible with your devices architecture and Android version (can be downloades here)
Now find out the architecture of your device. For this you have to open the file "/system/build.prop" and search for one of these strings:
"ro.product.cpu.abilist32" or
"ro.product.cpu.abilist64"
One of these entries is NOT empty and contains data describing the architecture (in my case it was the first entry which wasn't empty and looked like:
"ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi" - so I have a 32 Bit X86-architecture)
Next find out the sdk version which was used for building your Android system. Again search the file "/system/build.prop", but this time for the string:
"ro.build.version.sdk" (in my case it looked like: "ro.build.version.sdk=21" - so they have used sdk version 21 to build my Android system)
Now you know which file to download (for me it was xposed-v75-sdk21-x86.zip)
After download unzip the file to where you want Now open the terminal emulator, apply the "SU"-command and change to the directory "META-INF" found in the unzipped xposed folder. Then apply the command "touch flash-script.sh" to generate an alternatve install script. Open this file with a text editor and fill in the following code:
Code:
##########################################################################################
#
# Xposed framework installer zip.
#
# This script installs the Xposed framework files to the system partition.
# The Xposed Installer app is needed as well to manage the installed modules.
#
##########################################################################################
cp_perm() {
cp -f $1 $2 || exit 1
set_perm $2 $3 $4 $5 $6
}
set_perm() {
chown $2:$3 $1 || exit 1
chmod $4 $1 || exit 1
if [ "$5" ]; then
chcon $5 $1 2>/dev/null
else
chcon 'u:object_r:system_file:s0' $1 2>/dev/null
fi
}
install_nobackup() {
cp_perm ..$1 $1 $2 $3 $4 $5
}
install_and_link() {
TARGET=$1
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f ..$XPOSED ]; then
return
fi
cp_perm ..$XPOSED $XPOSED $2 $3 $4 $5
if [ ! -f $BACKUP ]; then
mv $TARGET $BACKUP || exit 1
ln -s $XPOSED $TARGET || exit 1
chcon -h 'u:object_r:system_file:s0' $TARGET 2>/dev/null
fi
}
install_overwrite() {
TARGET=$1
if [ ! -f ..$TARGET ]; then
return
fi
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f $TARGET ]; then
touch $NO_ORIG || exit 1
set_perm $NO_ORIG 0 0 600
elif [ -f $BACKUP ]; then
rm -f $TARGET
gzip $BACKUP || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" -a ! -f $NO_ORIG ]; then
mv $TARGET $BACKUP || exit 1
gzip $BACKUP || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm ..$TARGET $TARGET $2 $3 $4 $5
}
##########################################################################################
echo "******************************"
echo "Xposed framework installer zip"
echo "******************************"
echo "- Mounting /system and /vendor read-write"
mount /system >/dev/null 2>&1
mount /vendor >/dev/null 2>&1
mount -o remount,rw /system
mount -o remount,rw /vendor >/dev/null 2>&1
if [ ! -f '/system/build.prop' ]; then
echo "! Failed: /system could not be mounted!"
exit 1
fi
echo "- Placing files"
install_nobackup /system/xposed.prop 0 0 0644
install_nobackup /system/framework/XposedBridge.jar 0 0 0644
install_and_link /system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0
install_overwrite /system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0
install_overwrite /system/bin/oatdump 0 2000 0755
install_overwrite /system/bin/patchoat 0 2000 0755 u:object_r:dex2oat_exec:s0
install_overwrite /system/lib/libart.so 0 0 0644
install_overwrite /system/lib/libart-compiler.so 0 0 0644
install_overwrite /system/lib/libart-disassembler.so 0 0 0644
install_overwrite /system/lib/libsigchain.so 0 0 0644
install_overwrite /system/lib/libxposed_art.so 0 0 0644
echo "- Done"
exit 0
PLEASE BE AWARE THAT THIS SCRIPT ONLY WORKS WITH 32 BIT VERSIONS. FOR 64 BIT VERSIONS IT HAS TO BE ADOPTED! BECAUSE I DON'T HAVE A 64 BIT SYSTEM I WASN'T ABLE TO DO THIS!
After saving the changes run this script by applying the command "sh flash-script.sh". This should install the framework as intended by rovo89. I got some linker error messages (something like not found) concerning "libsigchain.so" - I ignored them, but it worked.
And don't forget to install the "XposedInstaller_3.0_alpha4.apk"
Click to expand...
Click to collapse
It seems I have to withdraw my statement about the mandatory custom recovery. You should open a separate thread for this guide in the Xposed sub-forum or at least ask the moderator of the unofficial Xposed for Lollipop FAQ (danarama) to include it in his FAQ. This is really helpful for people running a device for which a custom recovery is not available.
Use light theme and flash framework again.
Sent from my GT-I9505 using Tapatalk
klausstoertebeker said:
So you want to tell me that everybody who cannot unlock the bootloader of his/her device won't be able to use Xposed framework? I don't believe that because there are posts concerning successful installations on those devices. So there must be a way...
Click to expand...
Click to collapse
There is an all in one root tool that can unlock bootloaders for you or you can use ADB to do the work for you.
Hi,
Today decided to flash a rooted Google play edition ROM (because I had some issues with my current rom). I had to push the ROM to the phone with adb(because my phone has been acting up recently), unfortunately I made a mistake the first time and typed /sdcard instead of /sdcard/ and got an error saying it is a directory...
I fixed the mistake and got the ROM pushed and flashed. It's working normally except now the apps can't read the SD card. FC explorer says "access denied" even when given root privileges.
When in recovery, I can still see the internal SD contents using the TWRP built in explorer. (Latest version, I had to update in order to be able to flash the rom)
It's a pretty troublesome issue. Any help would be greatly appreciated.
Jandyman said:
Hi,
Today decided to flash a rooted Google play edition ROM (because I had some issues with my current rom). I had to push the ROM to the phone with adb(because my phone has been acting up recently), unfortunately I made a mistake the first time and typed /sdcard instead of /sdcard/ and got an error saying it is a directory...
I fixed the mistake and got the ROM pushed and flashed. It's working normally except now the apps can't read the SD card. FC explorer says "access denied" even when given root privileges.
When in recovery, I can still see the internal SD contents using the TWRP built in explorer. (Latest version, I had to update in order to be able to flash the rom)
It's a pretty troublesome issue. Any help would be greatly appreciated.
Click to expand...
Click to collapse
I would try:
Code:
adb shell
su
restorecon -FR /data/media/0
exit
Then reboot and see if its ok, if not I would wipe everything and format /data and reflash the rom.
alray said:
I would try:
Code:
adb shell
su
restorecon -FR /data/media/0
exit
Then reboot and see if its ok, if not I would wipe everything and format /data and reflash the rom.
Click to expand...
Click to collapse
Thanks for the reply! I just managed to sort it out.
For anyone else with this issue.
There is a script on this site in a thread by osm0sis ("osm0sis' odds and ends...") Which has a flashable script which fixes it.
You must boot into recovery before pushing it via adb if you've a case like mine where the sdcard cannot be accessed when phone is booted into the OS.
Your abd suggestion might work just the same but I'd used the flsshabke script first. Thank you.
Jandyman said:
Thanks for the reply! I just managed to sort it out.
For anyone else with this issue.
There is a script on this site in a thread by osm0sis ("osm0sis' odds and ends...") Which has a flashable script which fixes it.
You must boot into recovery before pushing it via adb if you've a case like mine where the sdcard cannot be accessed when phone is booted into the OS.
Your abd suggestion might work just the same but I'd used the flsshabke script first. Thank you.
Click to expand...
Click to collapse
Glad you got it sorted :good:
That script is also doing a "restorcon" but looks like its a much more complete solution.
Code:
#!/sbin/sh
# sdcard Fix Permissions: Recovery Flashable Zip
# osm0sis @ xda-developers
OUTFD=/proc/self/fd/$2;
ui_print() {
echo -ne "ui_print $1\n" > $OUTFD;
echo -ne "ui_print\n" > $OUTFD;
}
set_perm() {
files=$(echo $* | awk '{ print substr($0, index($0,$4)) }');
for i in $files; do
chown $1.$2 $i; chown $1:$2 $i;
chmod $3 $i;
done;
}
set_perm_recursive() {
dirs=$(echo $* | awk '{ print substr($0, index($0,$5)) }');
for i in $dirs; do
chown -R $1.$2 $i; chown -R $1:$2 $i;
find "$i" -type d -exec chmod $3 {} +;
find "$i" -type f -exec chmod $4 {} +;
done;
}
show_progress() { echo "progress $1 $2" > $OUTFD; }
set_progress() { echo "set_progress $1" > $OUTFD; }
[B][COLOR="red"]restore_con() { test -e /sbin/restorecon && restorecon -R $* || /system/bin/toolbox restorecon -R $*; }[/COLOR][/B]
ui_print " ";
ui_print "sdcard Fix Permissions Script";
ui_print "by osm0sis @ xda-developers";
show_progress 1.34 0;
ui_print " ";
ui_print "Mounting...";
busybox mount /data;
busybox mount /system;
set_progress 0.2;
ui_print " ";
ui_print "Setting /data/media to media_rw and fixing...";
set_perm_recursive 1023 1023 0775 0664 "/data/media";
set_perm 1023 1023 0770 "/data/media" "/data/media/0" "/data/media/obb";
[B][COLOR="Red"]restore_con /data/media/0[/COLOR][/B];
set_progress 0.6;
if [ -d /data/media/clockworkmod -o -d /data/media/0/clockworkmod ]; then
ui_print " ";
ui_print "Setting CWM directory perms...";
set_perm_recursive 0 0 0777 0777 "/data/media/clockworkmod";
set_perm_recursive 0 0 0777 0666 "/data/media/0/clockworkmod";
fi;
set_progress 0.7;
if [ -d /data/media/0/TWRP ]; then
ui_print " ";
ui_print "Setting TWRP directory perms...";
set_perm_recursive 0 0 0777 0666 "/data/media/0/TWRP";
fi;
set_progress 0.8;
if [ -d /data/media/multirom -o -d /data/media/0/multirom ]; then
ui_print " ";
ui_print "Setting MultiROM directory perms...";
set_perm_recursive 0 0 0755 0755 "/data/media/multirom" "/data/media/0/multirom";
set_perm 0 0 0770 "/data/media/multirom" "/data/media/0/multirom";
set_perm 1023 1023 0777 "/data/media/multirom/roms" "/data/media/0/multirom/roms";
set_perm 1023 1023 0666 "/data/media/multirom/.nomedia" "/data/media/0/multirom/.nomedia";
set_perm 0 0 0750 "/data/media/multirom/trampoline" "/data/media/0/multirom/trampoline";
set_perm 0 0 0666 "/data/media/multirom/multirom.ini" "/data/media/0/multirom/multirom.ini";
set_perm 0 0 0644 "/data/media/multirom/adbd" "/data/media/0/multirom/adbd" \
"/data/media/multirom/mrom.fstab" "/data/media/0/multirom/mrom.fstab" \
"/data/media/multirom/ubuntu-init/local" "/data/media/0/multirom/ubuntu-init/local" \
"/data/media/multirom/ubuntu-touch-init/scripts/touch" "/data/media/0/multirom/ubuntu-touch-init/scripts/touch" \
"/data/media/multirom/ubuntu-touch-sysimage-init/scripts/touch" "/data/media/0/multirom/ubuntu-touch-sysimage-init/scripts/touch";
ui_print "Note: You will need to dirty flash your secondary ROMs to ensure their permissions are correct";
fi;
set_progress 1.1;
ui_print " ";
ui_print "Unmounting...";
umount /data;
umount /system;
set_progress 1.2;
ui_print " ";
ui_print "Done!";
set_progress 1.34;
exit 0;
Hello. I found same questions in other topics, but couldn't find answer.
I would like run script from /system/su.d folder:
Code:
#!/system/bin/sh
echo 0 > /sys/fs/selinux/enforce
or
Code:
#!/system/bin/sh
setenforce 0
and I even tried to run test script:
Code:
#!/system/bin/sh
touch /data/local/tmp/test.txt
echo "test" >> /data/local/tmp/test.txt
But no one of them works. I tried different names for files, gave different chmod (644,700,755). Nothing helps me to run script.
Mb somebody can give me advice what's problem can be?
Phone: Xperia Z3c, MM, systemless SuperSU
On other phone (Xperia M5) this all works fine.
I have a the same problem with a different file in /system/su.d,
Code:
#!/system/bin/sh
logfile0=/data/local/tmp/exfat_mount.log
#logfile=$logfile0
logfile=/dev/null
if [ -e $logfile0 ]; then
logfile=$logfile0
fi
echo '******' $(date) '******' >> $logfile
echo 'id: ' $(id) >> $logfile 2>&1
if [ x$SECONDARY_STORAGE == x ]; then
SECONDARY_STORAGE=/storage/sdcard1
fi
device=/dev/block/mmcblk1p1
echo "Starting for $device" >> $logfile
while read line; do
words=($line)
if [ ${words[0]} == $device ]; then
echo "Error: $device already mounted:" >> $logfile
echo "$line" >> $logfile
exit 1
fi
if [ ${words[1]} == $SECONDARY_STORAGE ]; then
echo "Error: SECONDARY_STORAGE already in use:" >> $logfile
echo "$line" >> $logfile
exit 1
fi
done < /proc/mounts
binpath=/system/xbin
probe=$binpath/probe
if [ ! -e $probe ]; then
echo "Error: $probe not found!" >> $logfile
exit 1
fi
FS=($($probe $device))
echo "$device file system:" ${FS[0]} >> $logfile
# ***** Setup tools for different file systems:
if [ ${FS[0]} == "exFAT" ]; then
echo "$device is exFAT" >> $logfile
mount=$binpath/mount.exfat
if [ -f $mount ]; then
links=( "mkfs.exfat" "fsck.exfat" "dumpexfat" "exfatfsck" "exfatlabel" "mkexfatfs" "mount.exfat-fuse" )
for l in "${links[@]}"
do
if [ ! -e $binpath/$l ]; then
mount -o remount,rw /
ln -s $mount $binpath/$l
echo "Created symlink $binpath/$l" >> $logfile
fi
done
fi
fsck=$binpath/exfatfsck
fsck_ops=
elif [ ${FS[0]} == "NTFS" ]; then
echo "$device is NTFS" >> $logfile
mount=$binpath/ntfs-3g
fsck=$binpath/ntfsfix
fsck_ops='-n'
else
echo "Error: $device is not supported!" >> $logfile
exit 1
fi
# ***** Check if we have required tools.
if [ ! -e $mount ]; then
echo "Error: $mount not found!" >> $logfile
exit 1
fi
if [ ! -e $fsck ]; then
echo "Error: $fsck not found!" >> $logfile
exit 1
fi
# ***** Mount for rw only if the file system is not damaged.
options_ro="ro,uid=1023,gid=1023,umask=0000"
options_rw="rw,uid=1023,gid=1023,umask=0000,noatime"
mnt_cmd="$mount -o $options_rw $device /mnt/media_rw/sdcard1"
$fsck $fsck_ops $device >> $logfile 2>&1
if [ $? != 0 ]; then
mnt_cmd="$mount -o $options_ro $device /mnt/media_rw/sdcard1"
fi
echo "$mnt_cmd" >> $logfile
if [ -e /sys/fs/selinux/enforce ]; then
if [ -e /system/xbin/supolicy ]; then
# ***** Set permissions for fuse. Instead, our mounts would be RO for others.
echo "Using supolicy to provide permissions to fuse." >> $logfile
/system/xbin/supolicy --live "allow sdcardd unlabeled dir { append create execute write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon rmdir audit_access remove_name add_name reparent execmod search open }"
/system/xbin/supolicy --live "allow sdcardd unlabeled file { append create write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon audit_access open }"
/system/xbin/supolicy --live "allow unlabeled unlabeled filesystem associate"
/system/xbin/supolicy --live "allow sdcardd unlabeled filesystem { getattr mount remount unmount }"
/system/xbin/supolicy --live "allow vold unlabeled filesystem { getattr mount remount unmount }"
/system/xbin/supolicy --live "allow init unlabeled filesystem { getattr mount remount unmount }"
else
# ***** Turn SELinux to Permissive. Instead, our mounts would be RO for others.
echo "Using setenforce 0 to provide permissions to fuse." >> $logfile
setenforce 0
fi
fi
# ***** Try to mount:
if [ 0 != 0 ]; then
$mount -o $options_rw $device $SECONDARY_STORAGE
echo "Mounted directly" >> $logfile
else
mount -o remount,rw /system
rm -f /system/bin/debuggerd.mine
echo '#!/system/bin/sh' > /system/bin/debuggerd.mine
echo "$mnt_cmd" >> /system/bin/debuggerd.mine
echo 'start fuse_sdcard1' >> /system/bin/debuggerd.mine
chmod 777 /system/bin/debuggerd.mine
stop debuggerd
mv /system/bin/debuggerd /system/bin/debuggerd.its
mv /system/bin/debuggerd.mine /system/bin/debuggerd
start debuggerd
sleep 2
stop debuggerd
mv /system/bin/debuggerd /system/bin/debuggerd.mine
mv /system/bin/debuggerd.its /system/bin/debuggerd
start debuggerd
mount -o remount,ro /system
vdc volume mount $SECONDARY_STORAGE
echo "Mounted via debuggerd" >> $logfile
fi
The file is called 00mountsd and is used to give access to exfat microsd on stock android 5.1 running on a Chuwi Hi10pro tablet with cherry trail z8350 cpu. I used this on a previous version of the tablet and it worked fine although that tablet came with RemixOS.
The file runs without errors when run manually and succeeds at it task
ls -lZ returns this -rwxr-xr-x root root u: object_r:system_file:s0 00mountsd
I'm running SuperSU Free v2.79 everything else works fine.
Any ideas?
The script has been adapted for CM13: https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
Since many things have been changed to get Xposed working on Nougat I guess this script has to be adapted again.
Please share if you find something
Thank you.
I second this. The addon.d script was a godsend in the good 'ol days
Something as this?:
Code:
#!/sbin/sh
#
#
# /system/addon.d/81-Xposed.sh
# During a LineageOS 14.1 upgrade, this script backs up Xposed framework files.
# /system is formatted and reinstalled, then the files are restored.
# Based on Xposed "flash-script.sh" script and https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
export C=/sdcard/xposed_backupdir-1234
backup_file() {
if [ -e "$1" ]; then
if [ ! -L "$1" ]; then
local F="${1##*/}"
local D="${1%/*}"
mkdir -p "$C/$D"
cp -dp "$1" "$C/$D/$F"
else
ui_print "Skipping symbolic link $1"
fi
else
ui_print "NE: $1"
fi
}
restore_file() {
local FILE="${1##*/}"
local DIR="${1%/*}"
if [ -e "$C/$DIR/$FILE" ]; then
if [ "$FILE" == "xposed.prop" ] || [ "$FILE" == "XposedBridge.jar" ]; then
restore_nobackup "/$DIR/$FILE" 0 0 0644
elif [ "$FILE" == "app_process64_xposed" ] || [ "$FILE" == "app_process32_xposed" ]; then
restore_and_link "/$DIR/${FILE%_xposed}" 0 2000 0755 u:object_r:zygote_exec:s0
elif [ "$FILE" == "dex2oat" ] || [ "$FILE" == "patchoat" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755 u:object_r:dex2oat_exec:s0
elif [ "$FILE" == "oatdump" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755
else
restore_overwrite "/$DIR/$FILE" 0 0 0644
fi
else
ui_print "NE: $C/$DIR/$FILE"
fi
}
cp_perm() {
cp -f "$1" "$2" || exit 1
set_perm "$2" $3 $4 $5 $6
}
set_perm() {
chown $2:$3 "$1" || exit 1
chmod $4 "$1" || exit 1
if [ "$5" ]; then
chcon $5 "$1" 2>/dev/null
else
chcon 'u:object_r:system_file:s0' "$1" 2>/dev/null
fi
}
restore_nobackup() {
cp_perm "$C/$1" "$1" $2 $3 $4 $5
}
restore_and_link() {
TARGET="${1}"
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "$C/$XPOSED" ]; then
return
fi
cp_perm "$C/$XPOSED" "$XPOSED" $2 $3 $4 $5
if [ ! -f "$BACKUP" ]; then
mv "$TARGET" "$BACKUP" || exit 1
ln -s "$XPOSED" "$TARGET" || exit 1
chcon -h 'u:object_r:system_file:s0' "$TARGET" 2>/dev/null
fi
}
restore_overwrite() {
TARGET=$1
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f "$TARGET" ]; then
touch "$NO_ORIG" || exit 1
set_perm "$NO_ORIG" 0 0 600
elif [ -f "$BACKUP" ]; then
rm -f "$TARGET"
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" ] && [ ! -f "$NO_ORIG" ]; then
mv "$TARGET" "$BACKUP" || exit 1
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm "$C/$TARGET" "$TARGET" $2 $3 $4 $5
}
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
list_files() {
cat <<EOF
/system/xposed.prop
/system/framework/XposedBridge.jar
# For 32bits
/system/bin/app_process32_xposed
/system/bin/dex2oat
/system/bin/oatdump
/system/bin/patchoat
/system/lib/libart.so
/system/lib/libart-compiler.so
/system/lib/libart-disassembler.so
/system/lib/libsigchain.so
/system/lib/libxposed_art.so
# For 64bits
/system/bin/app_process64_xposed 64bit
/system/lib64/libart.so 64bit
/system/lib64/libart-compiler.so 64bit
/system/lib64/libart-disassembler.so 64bit
/system/lib64/libsigchain.so 64bit
/system/lib64/libxposed_art.so 64bit
EOF
}
OSA="32bit"
OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3`
API=$(sed -n "s/^ro.build.version.sdk=//p" /system/build.prop | head -n 1)
ABILONG=$(sed -n "s/^ro.product.cpu.abi=//p" /system/build.prop | head -n 1)
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ] || [ "$ABILONG" = "x86_64" ]; then OSA="64bit"; fi;
fi
case "$1" in
backup)
ui_print "Starting to backup Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
backup_file "$FILE"
fi
done
ui_print "Ending to backup Xposed"
;;
restore)
ui_print "Starting to restore Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
restore_file "$FILE"
fi
done
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
rm -rf "${C:?}/"
ui_print "Ending to restore Xposed"
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
MariferC said:
Something as this?:
Code:
#!/sbin/sh
#
#
# /system/addon.d/81-Xposed.sh
# During a LineageOS 14.1 upgrade, this script backs up Xposed framework files.
# /system is formatted and reinstalled, then the files are restored.
# Based on Xposed "flash-script.sh" script and https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
export C=/sdcard/xposed_backupdir-1234
backup_file() {
if [ -e "$1" ]; then
if [ ! -L "$1" ]; then
local F="${1##*/}"
local D="${1%/*}"
mkdir -p "$C/$D"
cp -dp "$1" "$C/$D/$F"
else
ui_print "Skipping symbolic link $1"
fi
else
ui_print "NE: $1"
fi
}
restore_file() {
local FILE="${1##*/}"
local DIR="${1%/*}"
if [ -e "$C/$DIR/$FILE" ]; then
if [ "$FILE" == "xposed.prop" ] || [ "$FILE" == "XposedBridge.jar" ]; then
restore_nobackup "/$DIR/$FILE" 0 0 0644
elif [ "$FILE" == "app_process64_xposed" ] || [ "$FILE" == "app_process32_xposed" ]; then
restore_and_link "/$DIR/${FILE%_xposed}" 0 2000 0755 u:object_r:zygote_exec:s0
elif [ "$FILE" == "dex2oat" ] || [ "$FILE" == "patchoat" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755 u:object_r:dex2oat_exec:s0
elif [ "$FILE" == "oatdump" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755
else
restore_overwrite "/$DIR/$FILE" 0 0 0644
fi
else
ui_print "NE: $C/$DIR/$FILE"
fi
}
cp_perm() {
cp -f "$1" "$2" || exit 1
set_perm "$2" $3 $4 $5 $6
}
set_perm() {
chown $2:$3 "$1" || exit 1
chmod $4 "$1" || exit 1
if [ "$5" ]; then
chcon $5 "$1" 2>/dev/null
else
chcon 'u:object_r:system_file:s0' "$1" 2>/dev/null
fi
}
restore_nobackup() {
cp_perm "$C/$1" "$1" $2 $3 $4 $5
}
restore_and_link() {
TARGET="${1}"
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "$C/$XPOSED" ]; then
return
fi
cp_perm "$C/$XPOSED" "$XPOSED" $2 $3 $4 $5
if [ ! -f "$BACKUP" ]; then
mv "$TARGET" "$BACKUP" || exit 1
ln -s "$XPOSED" "$TARGET" || exit 1
chcon -h 'u:object_r:system_file:s0' "$TARGET" 2>/dev/null
fi
}
restore_overwrite() {
TARGET=$1
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f "$TARGET" ]; then
touch "$NO_ORIG" || exit 1
set_perm "$NO_ORIG" 0 0 600
elif [ -f "$BACKUP" ]; then
rm -f "$TARGET"
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" ] && [ ! -f "$NO_ORIG" ]; then
mv "$TARGET" "$BACKUP" || exit 1
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm "$C/$TARGET" "$TARGET" $2 $3 $4 $5
}
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
list_files() {
cat <<EOF
/system/xposed.prop
/system/framework/XposedBridge.jar
# For 32bits
/system/bin/app_process32_xposed
/system/bin/dex2oat
/system/bin/oatdump
/system/bin/patchoat
/system/lib/libart.so
/system/lib/libart-compiler.so
/system/lib/libart-disassembler.so
/system/lib/libsigchain.so
/system/lib/libxposed_art.so
# For 64bits
/system/bin/app_process64_xposed 64bit
/system/lib64/libart.so 64bit
/system/lib64/libart-compiler.so 64bit
/system/lib64/libart-disassembler.so 64bit
/system/lib64/libsigchain.so 64bit
/system/lib64/libxposed_art.so 64bit
EOF
}
OSA="32bit"
OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3`
API=$(sed -n "s/^ro.build.version.sdk=//p" /system/build.prop | head -n 1)
ABILONG=$(sed -n "s/^ro.product.cpu.abi=//p" /system/build.prop | head -n 1)
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ] || [ "$ABILONG" = "x86_64" ]; then OSA="64bit"; fi;
fi
case "$1" in
backup)
ui_print "Starting to backup Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
backup_file "$FILE"
fi
done
ui_print "Ending to backup Xposed"
;;
restore)
ui_print "Starting to restore Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
restore_file "$FILE"
fi
done
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
rm -rf "${C:?}/"
ui_print "Ending to restore Xposed"
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
Click to expand...
Click to collapse
Did you create it? Did you try it on Nougat?
Anyway my custom ROM is no longer updated for Nougat. Hopefully it will work on Oreo.
OSheden said:
Did you create it? Did you try it on Nougat?
Anyway my custom ROM is no longer updated for Nougat. Hopefully it will work on Oreo.
Click to expand...
Click to collapse
Yes I've created it.
Yes I've tested on Nougat (LineageOS 14.1) on a Xiaomi Mi4 and a Moto G 2014, and it works.