Scriptor - perm2metadata, metadata2perm, updater-script checker/converter - Android Software/Hacking General [Developers Only]

Scriptor is a utillity i build to convert an upater-script from metadata to perm, from perm to metadata, to simultaneously swap the syntax, and to check against files not found
here's the usage
Code:
Usage: scriptor -p/m/s/c [inputfile] [outputfile/checkdir]
-p convert to set_perm syntax
-m convert to set_metadata syntax
-s convert metadata to perm and perm to metadata
-c check script for errors against filesystem
-b build updater-script from #not implemented yet#
[inputfile] input updater-script filename
[outputfile/checkdir] output file or if checking for errors input directory to root of rom
DOWNLOAD1.78kb
your welcome
XDA:DevDB Information
Scriptor, Tool/Utility for all devices (see above for details)
Contributors
Ricky Divjakovski
Version Information
Status: Testing
Created 2015-10-20
Last Updated 2015-10-19

Great
That is a thing which I need
Thank you hehe
Sent from my Nexus 5 using Tapatalk

Enjoy, this is only a beta version but works fine as far as i know
ill be adding EOL conversion in the next update and make it a commandline tool
then gonna add a few more things like convert it to simplyfy language( a language im writing to simplify reading updater-scripts, im almost done to be honest and its much easier to read, gonna compile update-binary to support the language aswell and a few more options to it like deodexing, but that wont be for a while
also gonna add a debloating utillity and an option to activate/deactivate aroma from the script itself

The edify2simplyfy converter is almost ready

could you please give an example on how to use that script to convert perm to metadata, and thanks in advance

yakie47 said:
could you please give an example on how to use that script to convert perm to metadata, and thanks in advance
Click to expand...
Click to collapse
scriptor -m updater-script new-updater-script

thank you man, but i'm getting this error: echo. was unexpected at this time.

yakie47 said:
thank you man, but i'm getting this error: echo. was unexpected at this time.
Click to expand...
Click to collapse
ill look into it mate thanks for feedback
edit: i got that error too on windows 8.1, ill fix and re-upload V2

Updater Sript Converter
I have also build a tool that will covert the updater-script to support lower version cwm and twrp. CWM version less than 5 and TWRP version less than 3 will support the script. This tool converts all set_metadata and set_metadata_recursive to set_perm and set_perm_recursive respectively and remove 5th argument from mount.
Tool is made of javascript so can be run in any html5 supported browser like firefox, chrome and in any OS like windows, mac, linux, android, iphone. Fully OS independent.
Just download the zip file attached below and extract. Then click and open index.html file in your browser. Dont forget to use the update-binary linked in that page. Tool can also be surfed online visit http://minify.cf/usc
100% working and tested.​

aniruddhabag3 said:
I have also build a tool that will covert the updater-script to support lower version cwm and twrp. CWM version less than 5 and TWRP version less than 3 will support the script. This tool converts all set_metadata and set_metadata_recursive to set_perm and set_perm_recursive respectively and remove 5th argument from mount.
Tool is made of javascript so can be run in any html5 supported browser like firefox, chrome and in any OS like windows, mac, linux, android, iphone. Fully OS independent.
Just download the zip file attached below and extract. Then click and open index.html file in your browser. Dont forget to use the update-binary linked in that page. Tool can also be surfed online visit http://minify.cf/usc
100% working and tested.​
Click to expand...
Click to collapse
please do not post your software in the comments section of my work, make a new thread for your tool dont clutter mine with crap

Ricky Divjakovski said:
please do not post your software in the comments section of my work, make a new thread for your tool dont clutter mine with crap
Click to expand...
Click to collapse
Ok sorry. I am new here.

@Ricky Divjakovski
Is there any chance for /system/bin script?

HemanthJabalpuri said:
@Ricky Divjakovski
Is there any chance for /system/bin script?
Click to expand...
Click to collapse
This is long obsolete, i didnt have the time to maintain it or turn it into a console application

Related

[Q] Creating CWM-compatible zip files

I've found a few tutorials on how to make Edify scripts, but nothing on the actual packaging and signing...
http://forum.xda-developers.com/showthread.php?t=936175
http://forum.xda-developers.com/showthread.php?t=994940
It looks like it's just a regular JAR file with extra code added to it. Is it more similar to an APK?
Any help/links are appreciated.
Bumping my own thread.
I was telling Raver about this script, it's pretty handy, it signs and creates the zip files for you, and if you don't want to learn how to make edify scripts, it'll even create them for you. I think it's easier to learn by example (looking into update-scripts for CWM ROMs), but you can make them without knowing the syntax with this
http://forum.xda-developers.com/showthread.php?t=717437
This winds up making a proper manifest file with checksums and signs the zip file.
Nice find.. so if I'm reading this right, I can make a theme, and then use this program to sign my zip file after I'm finished, sot that it flashes correctly in cwm, correct?
mike-y said:
Nice find.. so if I'm reading this right, I can make a theme, and then use this program to sign my zip file after I'm finished, sot that it flashes correctly in cwm, correct?
Click to expand...
Click to collapse
Yup. Really handy.
I won't quite call it a "pointless bump" but the script mentioned above appears to have been a Windows script. Additionally, the original link is not longer providing the expected content.
You can get the Windows script from http://forum.xda-developers.com/showpost.php?p=11078426&postcount=194
I'm more than comfortable with `Nix command line and have the Android SDK, NDK, and AOSP build environment installed.
Like FB, I can figure out Edify, but how can the signing be done using `Nix tools?
Edit -- from build/core/definitions.mk
Code:
# Sign a package using the specified key/cert.
#
define sign-package
$(hide) mv [email protected] [email protected]
$(hide) java -jar $(SIGNAPK_JAR) \
$(PRIVATE_CERTIFICATE) $(PRIVATE_PRIVATE_KEY) [email protected] [email protected]
$(hide) mv [email protected] [email protected]
endef
From AOSP/AOKP build output:
Code:
running: openssl pkcs8 -in build/target/product/security/testkey.pk8 -inform DER -nocrypt
running: java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpEkFZAx out/target/product/galaxys4gmtd/aokp_galaxys4gmtd-ota-eng.jeff.zip
Wow LOL almost a year since last post...
Not busting balls....just something I noticed
You don't need to sign CWM/TWRP packages...
Yeah it's been a while since I started messing with edify . It's sad that there isn't much out there that will teach you about cwm 3+ edfiy. Lots of amend tutorials but edify is more complex. I still want to write a guide about this.
Like airfluip said, the zips don't need to be signed.

[Tool]File(1) command for Android (ver 5.11)

After wandering around looking for an android build of the file command, I finally went ahead and compiled it myself.
The attached package contains the file binary (v5.11), the libmagic.so shared library, the associated magic files and the build specific files that I needed (over and above the source) to build it. The paths of the files are relative to '/'.
Refs:
source: file website (www_darwinsys_com/file/)
compiling: Native Vim on Android (gdr_geekhood_net/gdrwpl/vim-android.php)
Note: Add the location of libmagic.so to LD_LIBRARY_PATH to get rid of the "CANNOT LINK EXECUTABLE" error. (I use /data/local/lib)
Compiled a dynamically linked library and associated binary instead of the monolithic binary built earlier.
samveen said:
After wandering around looking for an android build of the file command, I finally went ahead and compiled it myself.
The attached package contains the file binary (v5.11), the libmagic.so shared library, the associated magic files and the build specific files that I needed (over and above the source) to build it. The paths of the files are relative to '/'.
Refs:
source: file website (www_darwinsys_com/file/)
compiling: Native Vim on Android (gdr_geekhood_net/gdrwpl/vim-android.php)
Note: Add the location of libmagic.so to LD_LIBRARY_PATH to get rid of the "CANNOT LINK EXECUTABLE" error. (I use /data/local/lib)
Click to expand...
Click to collapse
I followed your instructions and it works perfectly.
Code:
$ echo $LD_LIBRARY_PATH
/data/local/lib:/data/local/lib:/data/local/lib:/system/lib:/vendor/lib
$ file
Usage: file [-bchikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
[-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
file -C [-m magicfiles]
file [--help]
$ getprop | grep device
[ro.cm.device]: [jordan]
[ro.product.device]: [umts_jordan]
I have been looking for this for a while. Man!! This post needs some serious attention. Great work.
Sent from my MB525 usiIng XDA
@samveen Any chance you could compile it with libmagic statically linked again to make it portable? Thanks for your time.
osm0sis said:
@samveen Any chance you could compile it with libmagic statically linked again to make it portable? Thanks for your time.
Click to expand...
Click to collapse
@osm0sis Sure. I'll add in a statically linked binary, but it'll take a little time (2-3 days).
samveen said:
@osm0sis Sure. I'll add in a statically linked binary, but it'll take a little time (2-3 days).
Click to expand...
Click to collapse
I was just looking for this. Great tool.
Thanks for your work.
samveen said:
@osm0sis Sure. I'll add in a statically linked binary, but it'll take a little time (2-3 days).
Click to expand...
Click to collapse
Any luck? I think it only needs libmagic statically linked to be portable; the other NDK/Bionic stuff can probably stay dynamic to keep the filesize down. I see file 5.17 source is available now too if you wanted to update your builds to the latest.
osm0sis said:
Any luck? I think it only needs libmagic statically linked to be portable; the other NDK/Bionic stuff can probably stay dynamic to keep the filesize down. I see file 5.17 source is available now too if you wanted to update your builds to the latest.
Click to expand...
Click to collapse
If you want only the system file type, the workaround i use is this (eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE)
In a script just add a var like this
TYPE=$(eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE) and you will have the FS type in $TYPE.
Phone: Samsung Galaxy SII - GT-I9100
Kernel: Dorimanx kernel v10.43v99-mv3
1st ROM : SlimSaber 4.4.2 Maliv3 by fusionjack build of 20140320 (Online)
2nd ROM :
MODEM: UHMS1
MODS: Partition Fix, Hue Blue v4.4 by Kroz :good:
Computoncio said:
If you want only the system file type, the workaround i use is this (eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE)
In a script just add a var like this
TYPE=$(eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE) and you will have the FS type in $TYPE.
Click to expand...
Click to collapse
Interesting but nope; I need file to determine a filetype. Compressed archives via a script, to be specific.
@osm0sis I got the code compiled (both with a dynamic libmagic.so, and libmagic compiled into file) but I need a little more time to compile the magic data (it requires running file on the target device to compile the magic data into a binary datafile). Once I have that figured out (either by compiling it or by creating a script to allow the users to do it themselves, I'll post it all in one go (need one more day).
samveen said:
@osm0sis I got the code compiled (both with a dynamic libmagic.so, and libmagic compiled into file) but I need a little more time to compile the magic data (it requires running file on the target device to compile the magic data into a binary datafile). Once I have that figured out (either by compiling it or by creating a script to allow the users to do it themselves, I'll post it all in one go (need one more day).
Click to expand...
Click to collapse
Awesome! Thanks so much. The magic file isn't terribly important since you can grab one a lot of places and specify it with the -m parameter; keeps the file size down too if you were thinking of including it in the binary somehow!
Alright. I just wanted to thank you again for your work but I managed to make a static native compile (~440kb) of file-5.17 using my N7 and a kbox build environment I set up. It's available in my ARM Android Image Kitchen linked in my sig. Cheers!
osm0sis said:
Alright. I just wanted to thank you again for your work but I managed to make a static native compile (~440kb) of file-5.17 using my N7 and a kbox build environment I set up. It's available in my ARM Android Image Kitchen linked in my sig. Cheers!
Click to expand...
Click to collapse
@osm0sis - Can you please share how did you static compile this? I have setup the Ubuntu 13.10 image on Android using Complete Linux Installer (with all the necessary build tools setup).
I am able to compile this, but it's linking the shared library "libmagic.la".
Need to pass --static to ./configure and have a cross compiler set up, for ARMv7.
ericlnu said:
Need to pass --static to ./configure and have a cross compiler set up, for ARMv7.
Click to expand...
Click to collapse
I don't think that's a valid option.
Code:
$ ./configure --static
configure: error: unrecognized option: `--static'
Try `./configure --help' for more information
amit.bagaria said:
I don't think that's a valid option.
Code:
$ ./configure --static
configure: error: unrecognized option: `--static'
Try `./configure --help' for more information
Click to expand...
Click to collapse
Nope, seems not ^_^. Sorry, it usually is with autoconf derived configure scripts.
amit.bagaria said:
@osm0sis - Can you please share how did you static compile this? I have setup the Ubuntu 13.10 image on Android using Complete Linux Installer (with all the necessary build tools setup).
I am able to compile this, but it's linking the shared library "libmagic.la".
Click to expand...
Click to collapse
Haven't tried it using a full Linux image on Android, just made it native compile in KBox2 on my N7'13 for awhile by editing in the gettext functions it was complaining about, and have since moved on to cross-compiling on my Windows 7 desktop in Cygwin using the NDK. There were still a few tricks to getting it to be a true static compile. It's all linked in my post here:
http://forum.xda-developers.com/showthread.php?p=54510825
My latest compile included in my AIK-mobile package is file 5.20. :good:
I don't suppose you could do a quick compile with the -fPIE flag? Trying to use this on 5.0 + and don't want to patch my linker.
Tried to compile it myself (it sort-of worked, file --version is operational) but when I try to actually use it for something my terminal borks out and switches to some weird font after about 20 warnings. (configure also seems to be using the -rpath flag apparently, linker complains about it) hmm
EDIT: I've got it working after some trial and error. If anyone requests I'll post it
EDIT 2: android 6.0's linker seems less forgiving than 5.0/5.1, need to compile without -rpath (so no just using ./configure) will keep posted
Can you please post the file binary you built with -pie ?

[TOOL][OTA][Delta Updates] DeltaJen [CyboLabs]

What is DeltaJen?
DeltaJen is a tool for quickly making an incremental update based on two update zips. It is simple to use, and easy to extend for devices that don't use a straight up method of flashing a rom.
Click to expand...
Click to collapse
Why should I use it?
Have you ever hated having to download a full rom just to do a simple update? This tool can take a 200mb rom, take out all the changes, and squish the final package to less than 10mb.
Click to expand...
Click to collapse
But what if I use CWM instead of TWRP?
No issues here. DeltaJen produces updates that even your stock recovery can apply.
Click to expand...
Click to collapse
The Geeky parts
The script uses two binaries to efficiently build an update zip. bsdiff and imgdiff. bsdiff can also be replaced by the python module bsdiff4.
No threading or multiprocessing is used currently. as it stands, barely any cpu is used, so threading will be a huge bonus.
Hooks have been added to allow you to easily change how the script adds files, or to add extra lines in the updater-script
Click to expand...
Click to collapse
How do I use this?
For a straight update zip, which has no extra files or scripts other than what is in /system and boot.img, you run this.
Note that this will change when I update the cli function.
Code:
python DeltaJen.py -b <base_zip> -i <new_zip> -o <output_zip>
# Or from python
from DeltaJen import DeltaJen
dj = DeltaJen("<old_zip.zip>", "<new_zip.zip>", "<output_zip.zip>")
dj.generate()
Click to expand...
Click to collapse
I want to include this in the build steps of a custom rom
I'm working on it for a team already
Click to expand...
Click to collapse
Requirements
Linux (untested on OSX but should work)
python 2.7 or python 3.2+ (all other versions are untested and may not work)
imgdiff (supplied below or build from source)
bsdiff (sudo apt-get install bsdiff) or python module bsdiff4 (sudo pip install bsdiff4)
at least 500mb free ram (sorry, it dumps the files to ram. sorting it out soon).
Click to expand...
Click to collapse
It does NOT fully support windows yet, due imgdiff not supporting it. You can still run it, but it will only use bsdiff
More detailed instructions will be included soon, and the docs will be improved.
If you want direct help/to contribute/generally chat, come on down to the freenode channel #CyboLabs
last but not leased.
The source
XDA:DevDB Information
DeltaJen, Tool/Utility for all devices (see above for details)
Contributors
cybojenix, @GermainZ
Version Information
Status: Alpha
Created 2014-08-06
Last Updated 2014-08-09
Reserved
Dependencies
Linux
Python
bsdiff or bsdiff4
imgdiff
DeltaJen
Windows
Python
bsdiff or bsdiff4
imgdiff
DeltaJen
System Requirements
A supported OS
Enough ram to hold both zips (two 100mb zips would need 200+mb ram)
Enough storage to hold both zips
Amazing work mate!
I guess that ROM is SlimRoms. Would be glad to see this kinda awesomeness in Slim.
OMG, another @cybojenix project!!! :victory:
Have become your fan lately...
updates
automatic system and boot info detection has been added, the script is less verbose, and you can execute it directly now.
Documentation still to come
Superb Work Cybojenix
You Rock sir
kudos to @GermainZ for the massive help with cleaning up documentation.
wiki on github is in progress to aid you all.
Woow, nice work man
Any chance this project can be combined with CyanDelta for CM or OpenDelta in OmniROM?
It would be really nice if Cyan/OpenDelta downloads the differential update but creates a small update.zip only containing changed files instead of creating the latest complete ROM zip file.
klenamenis said:
Any chance this project can be combined with CyanDelta for CM or OpenDelta in OmniROM?
It would be really nice if Cyan/OpenDelta downloads the differential update but creates a small update.zip only containing changed files instead of creating the latest complete ROM zip file.
Click to expand...
Click to collapse
CyanDelta: I can't comment on because I've seen no documentation from them, nor can I get access to one of their final delta's.
OpenDelta: basically, DeltaJen and OpenDelta have two entirely different methods of working. Omni is wanting a system that will ensure the output is exactly the same every time, and not fail if the system has been modified (a zip is built and the system is flattened before applying)
This looks great.
I did a quick test using my windows system, running the script gave me the following output.
Code:
C:\Download\DeltaJen>python DeltaJen.py -b SlimSaberKat-jflte-4.4.4-2
-i SlimSaberKat-jflte-4.4.4-20140807.zip -o update_zip
WARNING: boot information not supplied.
MTD boot info found
patching system/priv-app/BackupRestoreConfirmation.apk: 1 of 95
Traceback (most recent call last):
File "DeltaJen.py", line 716, in <module>
cli()
File "DeltaJen.py", line 702, in cli
dj.generate()
File "DeltaJen.py", line 469, in generate
self.create_patches(to_diff)
File "DeltaJen.py", line 378, in create_patches
p_data = self.compute_diff(b_file, n_file)
File "DeltaJen.py", line 584, in compute_diff
if not bs_diff:
NameError: global name 'bs_diff' is not defined
Any tips on what I did wrong
kantjer said:
This looks great.
I did a quick test using my windows system, abd have the following output.
Code:
C:\Download\DeltaJen>python DeltaJen.py -b SlimSaberKat-jflte-4.4.4-2
-i SlimSaberKat-jflte-4.4.4-20140807.zip -o updte_zip
WARNING: boot information not supplied.
MTD boot info found
patching system/priv-app/BackupRestoreConfirmation.apk: 1 of 95
Traceback (most recent call last):
File "DeltaJen.py", line 716, in <module>
cli()
File "DeltaJen.py", line 702, in cli
dj.generate()
File "DeltaJen.py", line 469, in generate
self.create_patches(to_diff)
File "DeltaJen.py", line 378, in create_patches
p_data = self.compute_diff(b_file, n_file)
File "DeltaJen.py", line 584, in compute_diff
if not bs_diff:
NameError: global name 'bs_diff' is not defined
Any tips on what I did wrong
Click to expand...
Click to collapse
Ah, line 44 should be 'bs_diff = None'
On windows, you must have the python bsdiff4 installed btw
cybojenix said:
Ah, line 44 should be 'bs_diff = None'
On windows, you must have the python bsdiff4 installed btw
Click to expand...
Click to collapse
I have bsdiff4-1.1.4.tar.gz extracted to the folder containing the script and python but that clearly isn't the way to go.
Code:
ERROR: python bsdiff4 is required for windows
kantjer said:
I have bsdiff4-1.1.4.tar.gz extracted to the folder containing the script and python but that clearly isn't the way to go.
Code:
ERROR: python bsdiff4 is required for windows
Click to expand...
Click to collapse
you need to compile it as it has c parts.
try this http://www.lfd.uci.edu/~gohlke/pythonlibs/#bsdiff4
@cybojenix
A good piece of code & nice idea! Just one suggestion - can you please try xdelta (based on VCDIFF) instead of bsdiff?? In MDL, we have a very good result by using it, both in terms of memory & speed. AFAIK, CyanDelta also uses it. If you want a Python wrapper, then see here.
Best of luck!!
Titokhan said:
@cybojenix
A good piece of code & nice idea! Just one thought - can you please try xdelta (based on VCDIFF) instead of bsdiff?? In MDL, we have a very good result by using it, both in terms of memory & speed. AFAIK, CyanDelta also uses it. If you want a Python wrapper, then see here.
Best of luck!!
Click to expand...
Click to collapse
the issue with xdelta is it won't support recovery out the box. I've considered running a script to apply them manually (obviously only to replace bsdiff for now), but I won't be doing it at this stage.
cybojenix said:
you need to compile it as it has c parts.
try this http://www.lfd.uci.edu/~gohlke/pythonlibs/#bsdiff4
Click to expand...
Click to collapse
Thanks, but the installer is complaining python 3.4.1 needs to be installed but can't be found in the registry.
I have reinstalled python 3.4.1 using the.msi but still the same error.
kantjer said:
Thanks, but the installer is complaining python 3.4.1 needs to be installed but can't be found in the registry.
I have reinstalled python 3.4.1 using the.msi but still the same error.
Click to expand...
Click to collapse
what can I say, windows sucks
cybojenix said:
what can you say, windows sucks
Click to expand...
Click to collapse
I will try it tomorrow on my linux build machine.
That's where I want to have it running eventually.
Great work :good:
Congratulations my friend.

[SCRIPT] Move clock to the right

I'm not responsible for damage, loss, etc cause by this script. This script lacks of situation and error management. Please read the script and understand what it does. Please backup your /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk
Tested on xiaomi.eu 11.0.4.0. Should work on any miui11, maybe even other devices with notch.
This scripts moves the system clock in the notch-enabled status bar to the right side of the notch. It does this by pulling the apk, decompiling it in tmp folder and recompiling it. I made this because I got annoyed by the fact that there is tons of space on the right side of the notch while there is no space for notification icons on the left side.
SafetyNet should pass. Reboot after execution to ensure root is read-only.
Requirements:
MIUI 11
Magisk v20+
apktool < v2.6.0 (-c option is required)
adb
a decent linux install
The patch.patch file on the same directory of where you run it. If you're dev you can edit this file to make your custom patch.
PS: xda doesn't let me upload sh, the script is script.txt, rename it into script.sh, make it executable and execute it
EDIT: Will bootloop on Android 10 MIUI 11!
Thanks, it's very useful.
But can you please explain how to run the script?
---------- Post added at 11:00 AM ---------- Previous post was at 11:00 AM ----------
Thanks, it's very useful.
But can you please explain how to run the script?
he script is script.txt, rename it into script.sh, make it executable and execute it
DP FH said:
he script is script.txt, rename it into script.sh, make it executable and execute it
Click to expand...
Click to collapse
I'd rename it. but how to execute it? dublle click on the file or how?
yamabokra1 said:
I'd rename it. but how to execute it? dublle click on the file or how?
Click to expand...
Click to collapse
Via terminal
DP FH said:
Via terminal
Click to expand...
Click to collapse
It seems that you don't have time to explain. thanks anyway
yamabokra1 said:
It seems that you don't have time to explain. thanks anyway
Click to expand...
Click to collapse
Mate, if you don't know how to execute scripts from terminal you probably shouldn't mess around with them.
JaSomTy said:
Mate, if you don't know how to execute scripts from terminal you probably shouldn't mess around with them.
Click to expand...
Click to collapse
Please, spend 10 second to tell here if it worked, so we know on which systems it works
DP FH said:
Please, spend 10 second to tell here if it worked, so we know on which systems it works
Click to expand...
Click to collapse
I'm not getting it right.
Can you assist?
https://ibb.co/N7GXpcS
https://ibb.co/XDMZSv9
I run it, but it says apktool not found?
Please check the link for the picture. Do i have the correct APK tool there? I see you said < 2.6.0, but the highest i can find is 2.4.1
Dude... Running Windows binaries from Linux ain't gonna work. Just install everything from apt.
V2.6.0 does not yet exist, I wrote it for the time being
Rooted phone?
Maybe an obvious question, but does the phone need to be rooted to allow that manipulation?
duplicate message lol
josephlegrand33 said:
Maybe an obvious question, but does the phone need to be rooted to allow that manipulation?
Click to expand...
Click to collapse
Requirements: Magisk v20+ so yes. You can unroot after a successful installation, but if the mod goes away (ota update) you need root to reinstall it
Hey, I think I set up everything right, but when I run it I get
Input file (MiuiSystemUI.apk) was not found or was not readable.
Script: modding
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /tmp/miuis/res/layout/drip_status_bar_contents_container.xml 2020-01-04 20:09:39.224390176 +0100
|+++ /tmp/miuis/res/layout/drip_status_bar_contents_container.new 2020-01-04 20:09:56.504390102 +0100
--------------------------
File to patch:
Am I missing something?
I'm attaching the output
Thx for your work
I also think I did it right, but get "MiuiSystemUI.apk was not found or was not readable".
(Redmi Note 8 Pro, MIUI Global 11.0.3)
I've also tried to move that stupid clock with Substratum, but overlays seem not affecting system stuff in statusbar and, sadly, CustoMIUIzer doesn't include this setting.
Hi, sorry if I didn't read it straight away. That means MiuiSystemUI.apk couldn't be read. Do you have correct permissions to write files in /tmp?
Try to execute the commands in the script manually. for example, adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /tmp/
Can you manage to read the file? Do you see it in /tmp?
If it is, apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
should work right away
Tancredus said:
I'm attaching the output
Click to expand...
Click to collapse
I've read the log, the apktool decompilation gets straight away skipped for some reason. I'm using 2.4.1 as well.
What happens when you run apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
manually?
Oh right! My fault. replace
apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
with
apktool d -p /tmp -o /tmp/miuis/ -s /tmp/MiuiSystemUI.apk
And try again.
Also, don't try using it on android 10. will bootloop.
Do you know why it will bootlop in android 10 miui 11?
Because it's only a change on one line of xml... Maybe it's a invalid positioning, let me see it...

Software Development FYT Firmware Workbench 2.0

# FYT-Firmware-Workbench
PLEASE DO NOT USE WITH T'EYES CC3 FIRMWARE
Scripts intended to mount the FYT UIS7862 firmware, make modifications and reassemble it back
They can retrieve the firmware from specified location and after modification, they can put the packed and signed firmware into another specified location
Files:
1-) config.ini = A file to setup parameters, paths for the original firmware and patched firmware, temp directory to work with firmware files and mount point to edit the firmware
2-) import_original.sh = Retrieves the ZIP file from the location specified in config.ini
3-) import_patched.sh = Retrieves the same files that 'import_original.sh' but from the patched location specified in the config.ini (normally a firmware that you've already patched before)
4-) unpack.sh = (autorun after import*) Unpack the imported firmware and create the mount moints (as specified in the config.ini file) to work with the firmware
5-) tweaker.sh = Allows change Locale, Language, Country and allows enabling ADB and OTG (if hardware supports it)
6-) inject_mods = Copies all contents of "_mods" folder into system partition, like gps.conf or even bootanimation, up to you to creat the same folder structure with your own files to inject
7-) repack.sh = Unmount the modified firmware from the mount points, delete the mount points, assembly the new ZIP file, sign it and move it to the patched directory as specified in config.ini
clean_local.sh = This script will unmount the firmware and delete it, it will also delete temporary files. as its name says, it cleans the local workbench !
N'joy it !
[CHANGELOG]
2.0 Introduces a different ZIP signature method
1.0 Initial release
Did you already try to flash it? I seed that you sign with the test keys but does that now work on the 7862?
On the previous architectures the recovery did not allow self signed zips.
Yes it works well, of course I flashed a modified 6315_1 befor make this post. You can trust the scripts, take a look at the tweaker.sh who allow you to modify some settings, Locale,Region, Coutry, and more to come !
Hi,
I tried your tools. Nice work.
I first did the "import_original.sh" and then the "unpack.sh". I did use this on a RPi4 running Debian Linux. All my Linux machines are currently RPi boxes and I use my headless server RPi4 for most stuff I do myself on images. (Next to that I have a Chromebook running Linux as well, but that one doesn't allow me to mount images in the linux sandbox.)
In the unpack.sh I get errors after brotli on the resizing of all the images:
Bash:
**********************************************
Processing 'system' image ...
BROTLI -- Handling system.new.dat.br...
Converting system.new.dat file into system.img file
When tring the "Converting .." is where it goes wrong without error message. The sdat2img is using "#!/usr/bin/env python" which, on an python3 only system gives "/usr/bin/env: ‘python’: No such file or directory"
When I change the call to "python3 sdat2img.py <etcetera>" it works. It might be better to use something like
Code:
if [ `which python` ]; then
./tools/sdat2img.py
elif [ `which python3`]; then
python3 ./tools/sdat2img.py
else
printf "\n\nNo python found!!\n\n"
exit 1
fi
Otherwise your created dat file is 0 bytes (simply an echo of 0 bytes to a new file), then giving corrupt empty images of 128 MB when trying to resize them.
And about the resizing/shrinking of the images: Why do you do that?
Simply leave the img as is and mount it read-write, not read-only.
Please use
Code:
mount -t ext4 -o loop,rw $unzippedPath$i.img $MOUNTPOINT/$i
and then simply copy (as root) your stuff in or make the modifications directly (as root). After unmounting you can immediately repack and brotli-compress it again. No extra intermediate steps necessary.
****
And some other remarks (actually a bit of nit-picking, please don't feel offended. I think you did a great job):
You use and pack a 64bit jdk with it, which is of course very convenient in most cases but doesn't work on my ARM raspberry pi.
I would put something in the shell script like
Bash:
echo "Singning '${FIRMWAREZIPFILENAME}' file..."
if [ -n `which java` ]; then
# Not found. Use packed version and hope it is a 64bit system
tools/jdk64/bin/java -jar tools/SignApkv2.jar <etcetera>
else
# Use system version
java -jar <etcetera>
fi
You also use
Bash:
echo " "
echo "READY !!!."
echo " "
Why not use
Code:
printf "\n\nREADY !!!\n\n"
Don't feel offended at all fellow, that's normal you're improving the scripts so suit your needs, that's normal, and your code (above) seems much more adapted than mine, I packed a 64bit java 8 cause java 11 does not sign the ZIP, (or at least I didn't reach the sign correctly)
Y have a giltab at home with that projects (FYT, TS10 etc....) y you want to participate and pull-request your changes, os help me improving that scripts, you're welcome and I'll send you the link via PM
mariodantas said:
I packed a 64bit java 8 cause java 11 does not sign the ZIP, (or at least I didn't reach the sign correctly)
Click to expand...
Click to collapse
Yes, you are right. the signapkv2 is already very old. I forgot that. I just tested and java V11 comes without the sun packages.
Will add and arm64 java 8 and detect the proc architecture by scripts to select the right java
@surfer63 I forgot to tell you that I released FYT Firmware Workbench 2.0 which includes another 6315_1 signature method (no more signapkV2), (as required with lsec6315update after Jul/2/22) thos signs well the new 6315_1 files, so we can still modify their contents and repack again and flash without the message: "Please use legal system"
I finally got my images to mount. (had to sudo)
I used the modifications @surfer63 suggested. (python3 was the trick here)
edit: are the mountpoints supposed to be RO? I'm getting "no space.." error running the tweaker.
j-5 said:
I finally got my images to mount. (had to sudo)
I used the modifications @surfer63 suggested. (python3 was the trick here)
edit: are the mountpoints supposed to be RO? I'm getting "no space.." error running the tweaker.
Click to expand...
Click to collapse
No, they shoud have 128Mb + each uhntil repack
NOTE: before running FYT Firmware Workbench do a "sudo su" (you must run as ROOT) that's why it didn't work flawlessly, I'll modify the scripts to ask for sudo su if needed !
@mariodantas : Your FYT workbench was still in the Android head units section. I had it moved to the FYT forum.
mariodantas said:
No, they shoud have 128Mb + each uhntil repack
NOTE: before running FYT Firmware Workbench do a "sudo su" (you must run as ROOT) that's why it didn't work flawlessly, I'll modify the scripts to ask for sudo su if needed !
Click to expand...
Click to collapse
OK, got it.
I had commented out the "expand' part, my bad .
Is there a github repo for the latest scripts? I'd love to try this out.
No Github, I'll release some fixes soon !
mariodantas said:
I'll release some fixes soon !
Click to expand...
Click to collapse
this is very good, thanks for your hard work!
I am also having trouble parsing the system.new.dat.br file (I only chose to edit it in config). After changing to python3, file began to be mounted and repack. But I get an error on the device in the middle of installation related to "dynamic_partitions_op_list" even though I didn't change anything
Where are the 2.0 tools?
Andy826 said:
Where are the 2.0 tools?
Click to expand...
Click to collapse
In the OP
surfer63 said:
And about the resizing/shrinking of the images: Why do you do that?
Click to expand...
Click to collapse
@surfer63 I do that to allow me to add content inside, if not, the free size is 0Kb after mount
@mariodantas The CC3 Firmware Tools don't seem to work with the January firmware. The error when using them on the January firmware is:
Code:
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open _tmp/_firmware/elable.img
Any chance of this being fixed please?
ahmed123 said:
Any chance of this being fixed please?
Click to expand...
Click to collapse
Not compatible with CC3 anymore

Categories

Resources