yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] osm0sis:
New nano build up in the OP, with improved UI reflowing so it works better on all sizes of screen (much better for mobile)! Also, [MENTION=3292224]franciscofranco[/MENTION] and I did some testing the other night and worked out some important details with toybox mount in Nougat, so he's got our booted AK2 auto-flashing working again in (the next release of) franco.Kernel updater, and I've got some fixes for gappsintegrator. :highfive: :)

Yesterday I had originally uploaded v9.5 with a forced fallback integration method (extracted libs in directories beside the APK in /system) on Nougat so the new, more strict, signature v2 would pass, but [MENTION=6404745]MastahF[/MENTION] tells me so far they don't seem to be enforcing the new document like they say they would, so I've removed that as the main Marshmallow method should still work. :good:

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

UPDATE-nano.Terminal.Editor.v2.7.0-signed.zip:

- update to latest nano official source.

gappsintegrator: v9.5 - fix Nougat support, fix long boot with new su.d implementation:

- update mount commands to accomodate toybox mount not being as forgiving of syntax as the deprecated toolbox implementation; -t is necessary now and the -o order is more finicky

- explicitly run in an asynchronous subshell to work better with su.d (on SuperSU 2.78-SR1 and above)

https://github.com/osm0sis/gappsintegrator/commit/d1ea6d5f03c62f589671e9c95ca411b9afc7a3f3

Download via GitHub's raw copy of the latest version, or extract it from the repo zip. :good:

GN Synapse Injector also saw a small update to bring it up to speed with my main AnyKernel2 repo.

Edit

: Force-pushed one more time with the su.d fix for SuperSU v2.78-SR1. ;)
[Android Software/Hacking General [Developers Only]] Wolfbreak:
Hey [MENTION=4544860]osm0sis[/MENTION],

I created a Script to odex Apps stored in app & priv-app. I want to make it for framewok too but i have a main Problem with odexing.

The Problem i have is the boot.oat & boot.art Files in arm & arm64 stored in framework folder.

I need to combine that to get working apk and jar Files out of this Script.

Do you have any Idea how i could solve that? I leave you my Script here for Example

#!/tmp/busybox sh

# This Script is created by Wolfbreak and is not allowed to use without Permissions
# Thanks to zman0900 and androidphone2012 for their sample codes

export PATH=/tmp:$PATH

# odex app
APP="/system/app/*/*.apk"
ODEXAPP="/system/app/*/*.odex"
ODEXAPPLOC="/system/app/*"

# odex priv-app
PRIVAPP="/system/priv-app/*/*.apk"
ODEXPRIVAPP="/system/priv-app/*/*.odex"
ODEXPRIVAPPLOC="/system/priv-app/*"

# Set up busybox symlinks
for i in $(busybox --list)
do
ln -s busybox /tmp/$i
done

# mount system
mount -o remount,rw rootfs
mount -o remount,rw /system

# system app
for i in $APP
do
odex=`echo $i | sed -e 's/.apk/.odex/g'`
dex2oat --dex-file=$i --oat-file=$odex
zip -d $i classes.dex
done

# system priv-app
for i in $PRIVAPP
do
odex=`echo $i | sed -e 's/.apk/.odex/g'`
dex2oat --dex-file=$i --oat-file=$odex
zip -d $i classes.dex
done

# create folder for app
for i in $ODEXAPPLOC
do
mkdir -p $i/oat/arm64
chmod -R 755 $i/oat/arm64
odex=`echo $ODEXAPP | sed -e 's/.apk/.odex/g'`
cp -a $i/*.odex $i/oat/arm64
rm -rf $i/*.odex
done

# create folder for priv-app
for i in $ODEXPRIVAPPLOC
do
mkdir -p $i/oat/arm64
chmod -R 755 $i/oat/arm64
odex=`echo $ODEXPRIVAPP | sed -e 's/.apk/.odex/g'`
cp -a $i/*.odex $i/oat/arm64
rm -rf $i/*.odex
done

# wipe dalvik-cache
rm -rf /data/dalvik-cache
rm -rf /cache/dalvik-cache
[Android Software/Hacking General [Developers Only]] :
Does this work on 5.0+?
[Android Software/Hacking General [Developers Only]] Wolfbreak:
If i can fix it then yes. Im not that good at Scripting so i need help from osm0sis
[Android Software/Hacking General [Developers Only]] :
I actually have a Java file that'll do it, I just don't know how to make it into shell.
[Android Software/Hacking General [Developers Only]] osm0sis:
Nice work! I'm honestly not too up-to-date with how ART dexopting differs from Dalvik, but on my Nexus 5, boot.art and boot.oat seem to be just literally copied from /system/framework/arm to /data/dalvik-cache/arm with the appropriate renaming. So I don't think they need to be deodexed/combined?
[Android Software/Hacking General [Developers Only]] jacomail95:
Hi [MENTION=4544860]osm0sis[/MENTION], i'm back from exams an i have a bit of free time these days, so i want to try to do as you said about combining the opengapps reodexing script with your tools, but first can you kindly point me to this script? I haven't found it googling, i am a bit a novice in commits and stuff like this :) thank you :D
[Android Software/Hacking General [Developers Only]] osm0sis:
OP. :eek:
[Android Software/Hacking General [Developers Only]] jacomail95:
Pardon just seen now sorry :p
[Android Software/Hacking General [Developers Only]] xdadroidabc:
sir need help.

I have Note 5 Marshmallow stock with root access and cwm recovery installed.

I have flashed cwm-odex.Script.Installer.zip from page 1.

I have deodexed service jar with modification and I want to re-odex same. Put deodexed on sdcard and ran command with adb shell

root@lte:/sdcard # odex services.jar
odex services.jar

Returns with error

odex: odexing supplied files...
services.jar is a core framework file, skipping
root@lte:/sdcard #

Thanks in advance.
[Android Software/Hacking General [Developers Only]] osm0sis:
Why are you trying to use it on Marshmallow? It very clearly says Dalvik runtime only, and Marshmallow uses ART (Android RunTime) only. Even on Dalvik (KitKat and below) the instructions state core framework files needed to be done at the same time. :confused:
[Android Software/Hacking General [Developers Only]] Wolfbreak:
See my Script some Posts back for Marshmallow Sample on how to do it. Only Problem is it doesnt seem to work correctly. I mean all files get odexed right but system dont boot after it. Didnt had Time to fully fix it, also having some Problems with framework.
[Android Software/Hacking General [Developers Only]] gothicVI:
Am I understanding the intention of your script correctly w.r.t. the fact that it is meant to move all google apps to system, including eventual future updates at boot time? Does this also include chrome, gmail etc. or only stuff like play store and play services?

Gesendet von meinem Moto G 2014 LTE mit Tapatalk
[Android Software/Hacking General [Developers Only]] osm0sis:
Everything that has a counterpart in system. :good:
[Android Software/Hacking General [Developers Only]] gothicVI:
Thanks. Will give it a try [emoji106]

Gesendet von meinem Moto G 2014 LTE mit Tapatalk
[Android Software/Hacking General [Developers Only]] DirkStorck:
hi,

ADBsync sdcard Backup is absolutely what I was looking for...gonna switch to the S7 this weekend and wanted to backup my sdcard

unfortunately the script stops with

A 2016-08-06 11:38 obb
A 0 2014-01-01 00:10 obb/.nomedia
A 2015-12-05 17:26 obb/com.antutu.ABenchMark
A 2015-11-27 12:52 obb/com.ea.game.simcitymobile_row

<- 0 2013-03-14 12:43 0/.DataStorage - 0.003
<- 0 2013-03-14 12:43 0/.DataStorage\ - Path already exists, but not as directory C
Could not create directory "C:\ADBsync sdcard Backup\sdcard\0\.DataStorage"

I have added .DataStorage to longfilenames-ignore-list.ini

# Enter Android sdcard directory paths to ignore, then zip (due to long filenames); no wildcards allowed, one per line.
# Note: This will also push a .noadbsync file to each of these directories.
# eg. /data/media/0/Android/data/com.alphonso.pulse/files/catalogImageCache
/data/media/0/.DataStorage

EDIT: Found the problem....somehow there was an .DataStorage file on my sdcard. Don't know if it was there before or if it was created by this script because there have been other files starting with and dot which have an corresponding directory too. :confused:

Another question, can this be used to push the files to the sdcard if the card is empty?

Thank you!
[Android Software/Hacking General [Developers Only]] smeejaytee:
Hi great work your doing here mate truly awesome stuff, I have sent you a pm, I'm really hoping you might be able to help me with something, I've explained in the message, I look forward to hearing from you, thanks for you time.

Sent from my brain to my finger to my phone to xda
[Android Software/Hacking General [Developers Only]] osm0sis:
Nothing in the script would create random .files... and it's only for the backup, but I think somewhere in the documentation (links.. so many links.. :p) I mention how to push things back to the sdcard from a local backup. My sdcard fix permissions script zip should be used to correct things once pushed back since adb doesn't really know where it's pushing to. :good:

Sorry, can you repost the issue here? Per my signature I only respond when things are posted in an appropriate thread. Thanks for understanding. :)
[Android Software/Hacking General [Developers Only]] smeejaytee:
No problem, basically I make a booster MOD but in this I use a setprop to tweak dex2oat lines contained within getprop, by changing the values boot time is faster as well as installing apps take a fraction of the time,

My problem is I currently have to set a wait 50 command for them to take effect.

I saw your minfree script that changes the values during the boot sequence rather than after and I was wondering if something similar could be done with build prop lines,

This would be really helpful as the tweak really makes a difference.

Thank you again for your time and I really hope you can help.

Sent from my brain to my finger to my phone to xda
[Android Software/Hacking General [Developers Only]] osm0sis:
Sure! If I recall correctly, the lmk script basically just applies the tweak repeatedly until it actually sticks, so something similar could definitely be worked out for dex2oat.
[Android Software/Hacking General [Developers Only]] smeejaytee:
Ah man that is really great news can I pm you my setprop for you to take a look or do you know already what I'd need to add to it that you could post here, if it's not too much trouble, I really appreciate your help on this I've been trying things with this for weeks now

Sent from my brain to my finger to my phone to xda
[Android Software/Hacking General [Developers Only]] osm0sis:
Here's the lmk snippet I was referring to:

# lmk tweaks
minfree=6144,8192,12288,16384,24576,40960;
lmk=/sys/module/lowmemorykiller/parameters/minfree;
minboot=`cat $lmk`;
while sleep 1; do
if [ `cat $lmk` != $minboot ]; then
[ `cat $lmk` != $minfree ] && echo $minfree > $lmk || exit;
fi;
done&

What you'd want is more like...

blah2=whatevs;
while sleep 1; do
if `getprop blah` != $blah2 ]; then
setprop blah $blah2;
else
break;
fi;
done&

You could also do that as an until [ `getprop blah` == $blah2 ], and have sleep 1 somewhere in the subshell, leaving out the break, but really anything like that should work. You've probably got multiple setprops, so just pick one to act as the canary for the rest/test.
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thank you so much, I'll try.

Sent from my brain to my finger to my phone to xda
[Android Software/Hacking General [Developers Only]] Maxr1998:
Thanks, sent a donation your way :)
[Android Software/Hacking General [Developers Only]] osm0sis:
Thank you sir! Very much appreciated! :D
[Android Software/Hacking General [Developers Only]] PiggyFlooper:
[MENTION=4544860]osm0sis[/MENTION]

Hi sir, I'm on 4.4.2KK going to a 5.1.1 CyanogenMod Rom. When I wipe everything in twrp all wipes except /data/app. No problems across platform with these apps.

I'm in need of a script to copy all these apps to a subsequent folder matching each app... For example, /data/app/ AwesomePopupVideo.apk to /data/app/AwesomePopupVideo/AwesomePopupVideo.apk, and so on

To start with-

#!/system/bin/sh

BUSYBOX="/system/xbin/busybox"

OS=`getprop ro.build.version.release | $BUSYBOX awk -F\. '{ print $1$2 }'`

if [ "$OS" -gt 44 ]; then

for $i in /data/app; do

mkdir $i;

cp -p /data/app/$i /data/app/$i.apk;

done

else

echo KK or below detected

fi

I know that this is wrong way to get it done, but the idea is in the right direction

**But I don't know how to get the folder made without adding the .apk extension**

Please help me write a script to get the apps copied to appropriate folder. Or if any blessed person could help I'd be much obliged
[Android Software/Hacking General [Developers Only]] Maxr1998:
You could try to use basename or sed, something like:

basename $i

Or

name = `echo $i | sed 's/\.apk$//'`

Source: http://unix.stackexchange.com/a/44742/60699
[Android Software/Hacking General [Developers Only]] fadedout:
Something like this should work:

#!/system/bin/sh

BUSYBOX='/system/xbin/busybox'

OS=$(getprop ro.build.version.release | "$BUSYBOX" awk -F. '{ print $1$2 }')

if (( OS > 44 )); then
"$BUSYBOX" find /data/app -type f -name '*.apk' -print0 | while read -rd $'\0' app_file; do
app_dir=${app_file%.apk}
mkdir "$app_dir"
mv "$app_file" "$app_dir"
done
else
echo 'KK or below detected'
fi
[Android Software/Hacking General [Developers Only]] smeejaytee:
Hi I wonder if you might be able to help me once more, would it be possible please to point me in the right direction for a sqlite3 optimizing script please, I would really appreciate your help thank you in advance.
[Android Software/Hacking General [Developers Only]] veez21:
well, I'm not osm0sis but i can help and probably think of something, what are your ideas for it
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thank you I just want it to optimize and vacuum the binary at every 3rd boot or something, I read it's better not to have it optimize at every boot, if it's not too much trouble mate thank you again.
[Android Software/Hacking General [Developers Only]] veez21:
It's not that complicated though, here what i want it to be:

#!/system/bin/sh

counter="/data/local/counter"
if [ -z $counter ]; then
echo 0 > $counter
exit
fi

if [ $(cat $counter) = "3" ]; then
vac="1"
else
echo "$(($(cat $counter) + 1))" > $counter
vac="0"
fi
if [ $vac = "1" ]; then
for db in $(find /data -iname "*.db"); do
sqlite3 $db 'VACUUM;'
# its up to you if want to add anything
done
fi
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thank you mate, I appreciate it I'll give it a run to test,

Also I'm very new to scripting I'm just learning what do you mean by add anything can it do more then? Thanks again.
[Android Software/Hacking General [Developers Only]] veez21:
i mean like a logging mechanism :good:
[Android Software/Hacking General [Developers Only]] smeejaytee:
Oic thank you
[Android Software/Hacking General [Developers Only]] veez21:
No problem :highfive:
[Android Software/Hacking General [Developers Only]] smeejaytee:
I set it up and it ran successfully as I've been having problems with sqlite optimizing scripts I ran it again to double check and again it was successful, I ran it a third time to be sure and got a fail, is this because of running it 3 times, I'm in confusion if I did actually run the vwrong script lol
[Android Software/Hacking General [Developers Only]] _that:
My guess is that more CPU cycles are burnt by these "optimizations" than saved.
[Android Software/Hacking General [Developers Only]] veez21:
sorry, but i made a mistake, try this :fingers-crossed:

#!/system/bin/sh

counter="/data/local/counter"
if [ -z $counter ]; then
echo 0 > $counter
exit
fi
count=$(cat $counter)

if [ $count = "3" ]; then
vac=1
echo 0 > $counter
else
vac=0
echo "$(($count + 1))" > $counter
fi

if [ $count = "3" ]; then
for db in $(find /data -iname "*.db"); do
sqlite $db 'VACUUM;'
done
fi

---------- Post added at 09:51 AM ---------- Previous post was at 09:50 AM ----------

But it's fun to do these kinds of things :)
[Android Software/Hacking General [Developers Only]] smeejaytee:
Sorry mate error
[Android Software/Hacking General [Developers Only]] veez21:
oh yeah, never tried it yet, im gonna look at it :silly:
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thanks man sorry
[Android Software/Hacking General [Developers Only]] veez21:
eureka!! it's the freakin shebang header :D:D

change #!/systen/bin/sh to #!/system/bin/sh

and also sqlite to sqlite3 :good:
[Android Software/Hacking General [Developers Only]] smeejaytee:
Unfortunately didn't help
[Android Software/Hacking General [Developers Only]] veez21:
just rename it to sqlite.sh
[Android Software/Hacking General [Developers Only]] veez21:
[MENTION=5463312]smeejaytee[/MENTION] it should show something like this
[Android Software/Hacking General [Developers Only]] smeejaytee:
Ah man I'm starting to think this script doesn't like my room.
[Android Software/Hacking General [Developers Only]] veez21:
delete the counter file
[Android Software/Hacking General [Developers Only]] smeejaytee:
In my rom?

Should I reboot after?
[Android Software/Hacking General [Developers Only]] veez21:
[/COLOR]

i mean /data/local/counter, and no, try to run the script again after deleting
[Android Software/Hacking General [Developers Only]] smeejaytee:
Done it didn't work first run but I checked the file and it was on 1 so I ran the script again and it was successful.

I think that means I'm good now lol thank you again man really appreciate it
[Android Software/Hacking General [Developers Only]] veez21:
no prob:good:, good luck on your mod
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thank you it's coming along nicely actually and you've just helped a lot, I've tried loads of scripts for sqlite3 without success until now thank you so much.
[Android Software/Hacking General [Developers Only]] smeejaytee:
Is there a command to run a script after boot completed? Please
[Android Software/Hacking General [Developers Only]] Dethfull:
http://xdaforums.com/showthread.php?t=2641227
[Android Software/Hacking General [Developers Only]] veez21:
here one i know

complete=$(getprop sys.boot_completed)

( while [ $complete != "1" ]; do
sleep 0.5
done
# the thing you want to execute goes here after done

) &

exit 0
[Android Software/Hacking General [Developers Only]] smeejaytee:
If this works your my hero thank you
[Android Software/Hacking General [Developers Only]] veez21:
it probably will since i use it:good:

---------- Post added at 12:07 AM ---------- Previous post was at 12:07 AM ----------

to run my scripts
[Android Software/Hacking General [Developers Only]] smeejaytee:
Afraid it didn't work but thank you anyway
[Android Software/Hacking General [Developers Only]] veez21:
what, it's working for me, how do you know it doesn't work
[Android Software/Hacking General [Developers Only]] veez21:
this script is working perfectly
[Android Software/Hacking General [Developers Only]] veez21:
oh wait, it was probably that the getprop was outside of the loop, look at the screenshot and copy it, do this

while [ $(getprop sys.boot_completed) != 1 ]

instead of

while [ $complete != 1 ]
[Android Software/Hacking General [Developers Only]] smeejaytee:
I'll give it a try thanks.
[Android Software/Hacking General [Developers Only]] veez21:
what do you want to execute it with? just curious:confused:
[Android Software/Hacking General [Developers Only]] smeejaytee:
Getting error when executing mate

---------- Post added at 06:51 AM ---------- Previous post was at 06:50 AM ----------

Su.d mate
[Android Software/Hacking General [Developers Only]] veez21:
screenshot the script
[Android Software/Hacking General [Developers Only]] smeejaytee:
I did lol look up
[Android Software/Hacking General [Developers Only]] veez21:
oh, haha, ill look at it then:D
[Android Software/Hacking General [Developers Only]] veez21:
[MENTION=5463312]smeejaytee[/MENTION] , download the pdf then try to change it like your script
[Android Software/Hacking General [Developers Only]] smeejaytee:
Does my script still go after done?
[Android Software/Hacking General [Developers Only]] veez21:
yes, because it waits until sys.boot_completed is equal to 1 then proceeds to the things you made after done
[Android Software/Hacking General [Developers Only]] smeejaytee:
Damn still didn't work

When I run the script manually it seems like its looping.
[Android Software/Hacking General [Developers Only]] veez21:
it's not looping, its normal, if it's executing on init.d/su.d its just like other scripts. Thats normal :good::laugh:

I thought your problem was something else:silly:
[Android Software/Hacking General [Developers Only]] smeejaytee:
OK but it's still not changing the values on boot

Notice the dex2oat lines, they still say 2 after booting.
[Android Software/Hacking General [Developers Only]] veez21:
i replicated your script and rebooted, and got the expected values, does the values change if you run the script on terminal emulator?
[Android Software/Hacking General [Developers Only]] smeejaytee:
Well this latest test just looped but usually if I manually execute I use rom toolbox and the values change successfully,

I used to have a sleep 50 command in front and it worked fine but after editing and swapping out different versions it stopped,

I added another 10 seconds then it worked but now it won't even work at 60 I've tried as far as 80 seconds with original but it just won't work, only if I run it manually after booting.
[Android Software/Hacking General [Developers Only]] veez21:
Did the values change after executing? Mine is working
[Android Software/Hacking General [Developers Only]] smeejaytee:
This version won't execute manually just sticks on executing

Did I do it right?
[Android Software/Hacking General [Developers Only]] veez21:
Did the log file changed or created and if you enter this on terminal emu getprop | grep dex2oat , does the values change? If yes then :good:

One thing, try executing the script in terminal emulator
[Android Software/Hacking General [Developers Only]] smeejaytee:
OK can't see a log and I entered that command in terminal and values are still at 2

I'm not sure how to run the script in terminal sorry Im learning lol.
[Android Software/Hacking General [Developers Only]] veez21:
its in su.d right?

if it's in su.d then

sh /system/su.d/(name of the script)
[Android Software/Hacking General [Developers Only]] smeejaytee:
Can't seem to execute it

---------- Post added at 10:43 AM ---------- Previous post was at 10:41 AM ----------

It loses the beginning
[Android Software/Hacking General [Developers Only]] :
Try using Termux
[Android Software/Hacking General [Developers Only]] smeejaytee:
Still not executing
[Android Software/Hacking General [Developers Only]] :
Request su
[Android Software/Hacking General [Developers Only]] smeejaytee:
Still didn't work

---------- Post added at 12:21 PM ---------- Previous post was at 11:58 AM ----------

I executed the script with root explorer and it worked.

But doesn't explain why it's not working at boot
[Android Software/Hacking General [Developers Only]] :
Upload script, I've got an m8 too I'll test it
[Android Software/Hacking General [Developers Only]] smeejaytee:
http://cloud.tapatalk.com/s/57ed0996a4f14/aa.pdf
[Android Software/Hacking General [Developers Only]] :
Why are you trying to run once boot complete?
[Android Software/Hacking General [Developers Only]] smeejaytee:
Because it won't change during boot mate
[Android Software/Hacking General [Developers Only]] Dethfull:
http://xdaforums.com/showthread.php?t=2641227

You can use sleep after boot receiver, but the sleep command will stay eating ram, because androed shell is rustic (incomplete and bad encoded), you can try this app

http://xdaforums.com/showthread.php?t=2641227
[Android Software/Hacking General [Developers Only]] smeejaytee:
The app looks good but I'm trying to achieve this for a MOD not just personal use thanks anyway.
[Android Software/Hacking General [Developers Only]] smeejaytee:
Finally fixed it sweet thank you everyone for your help
[Android Software/Hacking General [Developers Only]] veez21:
nice, i wasn't able to reply cause i was sleeping, good luck to you smee
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thank you for all your help