[TUTORIAL] Self-assembly of Android Firmwares - GT540 Optimus Android Development

I just saw a tutorial in 4PDA by R0iz and wanted to share it here!
The link to the original post translated:
http://tinyurl.com/self-assembly-androidOS
Extract the files *. img
To extract system.img, used unyaffs (http://code.google.com/p/unyaffs/)
I have compiled under Ubuntu 64. With Unyaffs can only be extracted system.img.
To extract boot.img use extract-kernel.pl and extract-ramdisk.pl
# extract-kernel.pl boot.img
# extract-ramdisk.pl boot.img
Click to expand...
Click to collapse
Rebuilding boot.img
After extracting boot.img with the enclosed extract-*. pl
In order to collect boot.img with Custom kernel in the same folder run:
# mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Click to expand...
Click to collapse
Rebuilding system.img
At first glance it seems that you can simply mount the image and format it with YAFFS, but it's not because, as SPL Hero does not allow flash system.img directly.
You must use the format update.zip packages for this. (читайте ниже) (See below)
Write update.zip quite simple really. For example, to add the package test.apk in your rum:
- Create an empty folder <workdir>
- Create a folder structure for test.apk (<workdir> / system / app) and copy test.apk
- Create a folder structure for the update-script (<workdir> / META-INF/com/google/android)
- Edit <workdir> / META-INF/com/google/android/update-script
- Insert the following:
show_progress 0.1 0 show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM: copy_dir PACKAGE: system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app set_perm_recursive 0 0 0755 0644 SYSTEM: app
show_progress 0.1 10 show_progress 0.1 10
- Pack the contents <workdir> in zip (not the folder itself <workdir>, only its contents)
Now you have to sign a zip file. Testsign.zip download and copy it to your <SDK> / tools.
Unzip it there, thus creating a sub-folder sign with a file testsign. in it.
Then in the folder <workdir>, run this command:
java-classpath "<SDK> / tools / sign / testsign.jar" testsign file.zip file-signed.zip
Everything is now ready for your update.zip pouring into the apparatus by a modified recovery.
Click to expand...
Click to collapse
Change. Apk package
apk can just unpack an archive, change what you need and pack it back. But in the end you have to sign it as well as update.zip packages.
ODEX files
- What is it? Answer
- How to get rid of them?
For deodex ODEX files, use this howto
Then you can create classes.dex file by running smali from your "out". Then rename it to classes.dex and add it to apk.
- How to create them?
Use dexopt-wrapper on the device.
Click to expand...
Click to collapse
Porting ROM with other devices.
Well, this part is simple smile_good.gif
- Extract system.img
- Extract boot.img
- Replace boot.img-kernel of the original Roma HTC Hero.
- Rebuild boot.img
- Collect update.zip (see how it's done in any Custom rum for Hero)
- Sign and flash.
Device should start, and even be able to call, but probably will not work WiFi, BT, trackball.
Androsign script (Linux)
Androsign allows you to quickly sign the zip and apk. Just put it in <SDK> / tools, then CHMOD + X. If the path to the folder \ tools registered in the PATH, then you can run this script by typing:
androsign /dev/folder1/folder2/update.zip
He will Update-signed.zip (or App-signed.apk, etc.) in the same folder where the original file.
THANKS ARE WELCOMED!

Can we actually use this to port Sense or MIUI ?

this explains part of the process, the steps to do fo that purpose extracting and rebuilding but of course not about the code. i've heard MIUI is complex than sense

Most of us know this allready but nice to see it being said instead of learning the hard way
Sent from my GT540 using XDA Premium App

Related

[Solved] How to edit /dev/mtd3 (System Image)

Hi,
I would like to edit an official system rom.
I can have it in 2 format a NBH file, but i did not found a way to extract it or the file directly extracted from the phone with the command line:
cat /dev/mtd/mtd3 > /sdcard/mtd3.img.
It seems there is a way to extract it with a command line like:
gunzip -c mtd3.img | cpio -i
but i always have errors when laucnh it, like not in gzip format etc...
Does anybody has any clue about this?
Bye
Herc. 8)
hercule18 said:
Hi,
I would like to edit an official system rom.
I can have it in 2 format a NBH file, but i did not found a way to extract it or the file directly extracted from the phone with the command line:
cat /dev/mtd/mtd3 > /sdcard/mtd3.img.
It seems there is a way to extract it with a command line like:
gunzip -c mtd3.img | cpio -i
but i always have errors when laucnh it, like not in gzip format etc...
Does anybody has any clue about this?
Bye
Herc. 8)
Click to expand...
Click to collapse
unyaffs it?
Just tried and it gave:
Segmentation Fault
bye
Herc.
Try using nandroid to back it up, copy system.img to your nix box (cygwin might work), and unyaffs it. The contents will be extracted to the current directory, so set yourself up a working directory. Just a guess, but I think your image is becoming corrupted.
It Worked.
Thank you.
Herc.

[Q] Odex before compression

Is it possible to odex a system before I compress it into a androidinstall and send it to my device to install?
If so how?
only way i have found to odex is through the phone
How do people release odex'ed builds then?
2 ways
1. if adb works push the odex script to /data run the scrpit (search odex donut or dzo's instructions on how to use it), then do an adb pull of /system then repack it into a .tar and go
2 adb doesnt work for me so here is how i do it, i load up my build and in the /data folder i have the odex script, i run the script using terminal emulator, then i restart after its finished and put in a blank sd card then i copy the app and framework folders from /system to the SD and replace those folders in the original .tar with the newly odex'd ones
I put the odex script into data and then added it to init
jholtom said:
Is it possible to odex a system before I compress it into a androidinstall and send it to my device to install?
If so how?
Click to expand...
Click to collapse
I asked dzo once and he answered me, in the Fresh Froyo thread. The search function isn't working right now, but when you read this it might be working. Another thread described things in more detail, but I long ago forgot where that thread is. I never got odexing to work outside the phone, but here is the script I have tried. Note that the dexpreopt.py python script has to be edited to mount system as read/write, or it completely fails. I run this after a complete build.
Code:
#! /bin/sh
. build/envsetup.sh
lunch us_vogue-userdebug
rm out/target/product/vogue/obj/PACKAGING/systemimage_unopt_intermediates/system.img
ONE_SHOT_MAKEFILE=/home/devel/android/build/tools/dexpreopt/Android.mk make -C /home/devel/android/ files
make
mkdir /tmp/system-odex
rm -rf /tmp/system-odex/system
cp -ra out/target/product/vogue/system /tmp/system-odex
dexpreopt.py --outsystemdir=/tmp/system-odex/system
for i in /tmp/system-odex/system/app/*.apk; do zipalign -f 4 $i /tmp/zip; mv /tmp/zip $i; done
tar -C /tmp/system-odex -czf odex.tgz system
n2rjt said:
I asked dzo once and he answered me, in the Fresh Froyo thread. The search function isn't working right now, but when you read this it might be working. Another thread described things in more detail, but I long ago forgot where that thread is. I never got odexing to work outside the phone, but here is the script I have tried. Note that the dexpreopt.py python script has to be edited to mount system as read/write, or it completely fails. I run this after a complete build.
Code:
#! /bin/sh
. build/envsetup.sh
lunch us_vogue-userdebug
rm out/target/product/vogue/obj/PACKAGING/systemimage_unopt_intermediates/system.img
ONE_SHOT_MAKEFILE=/home/devel/android/build/tools/dexpreopt/Android.mk make -C /home/devel/android/ files
make
mkdir /tmp/system-odex
rm -rf /tmp/system-odex/system
cp -ra out/target/product/vogue/system /tmp/system-odex
dexpreopt.py --outsystemdir=/tmp/system-odex/system
for i in /tmp/system-odex/system/app/*.apk; do zipalign -f 4 $i /tmp/zip; mv /tmp/zip $i; done
tar -C /tmp/system-odex -czf odex.tgz system
Click to expand...
Click to collapse
ok thanks
I'll work with it
Also there is a script I use to odex files as they are downloaded from the market or installed on the phone. It is inside of my barebones build and if you look inside my userinit from my build you will see the call to the file.
Edit: I do not take credit for it, I just claim to be a source of the file as I already have it.

[TUTORIAL] Extract Contents Inside Of SMGs

Hi there,
Here how I extract contents including folders and files from smg files.
I didn't find any real tutorial about this, I hope it will help you guys to better develop.
This following may soft brick your device, anyway you can recovery it by flashing it back with rsd lite.
always remember, use at your own risks...
Requirement:
- rsd lite \ sbf_flash
- sdcard
- 1,5gb android application free space
- gingerbreak (rooted phone)
- adb (android sdk)
- atrix phone
- no need of desktop linux
1) Extract the smg files from the sbf, to do you can use Rsd Lite or use Sbf_flash, google search is your friend.
link for sbf_flash
Code:
http://blog.opticaldelusion.org/2010/05/sbfflash.html
2) copy the smg files you extracted into the sdcard
2 *) optionally copy shellscript.sh to your sdcard if you don't want to type all those commands.
3) root your phone, easy with gingerbreak
4) set the phone to development mode and open adb shell
5) type the following commands :
* get su access, type su:
Code:
adb shell# su
* remount main block device to have write access to mnt directory:
Code:
mount -o rw,remount -t ext3 /dev/block/mmcblk1 / ;
* create two temporary loop devices:
Code:
/osh/bin/mknod /dev/loop0 b 7 0
/osh/bin/mknod /dev/loop1 b 7 1
* create two new mount directories for example:
Code:
mkdir /mnt/retail ;
mkdir /mnt/att ;
* mount smg files: ( in this example smg files are in smgs directory of your sdcard /smgs, I will copy the contents of retail smg to att smg, that's mean att smg contents will be overwritten )
Code:
/osh/bin/mount -o loop /mnt/sdcard-ext/smgs/olyfr_u4_1.5.7_signed_olpsattspe_p012_hwolympus_1g_1ffCG57.smg /mnt/att ;
/osh/bin/mount -o loop /mnt/sdcard-ext/smgs/olyem_u4_2.1.1_signed_ucaolyportfr_p014_a004_m001_hwolympus_1g_1ffCG57.smg /mnt/retail;
* make clean the att smg
Code:
/osh/bin/rm -rf /mnt/att/* ;
* copy contents from retail smg to att smg:
Code:
cp -dpRf /mnt/retail/* /mnt/att/;
* umount the previous mount directories we created
Code:
/osh/bin/umount /mnt/retail;
/osh/bin/umount /mnt/att ;
you're all done, congratulation!!
here is the script to automate the job, edit it as you want.
Code:
#!/system/bin/sh
mount -o rw,remount -t ext3 /dev/block/mmcblk1 / ;
/osh/bin/mknod /dev/loop0 b 7 0
/osh/bin/mknod /dev/loop1 b 7 1
mkdir /mnt/retail ;
mkdir /mnt/att ;
/osh/bin/mount -o loop /mnt/sdcard-ext/smgs/olyfr_u4_1.5.7_signed_olpsattspe_p012_hwolympus_1g_1ffCG57.smg /mnt/att ;
/osh/bin/mount -o loop /mnt/sdcard-ext/smgs/olyem_u4_2.1.1_signed_ucaolyportfr_p014_a004_m001_hwolympus_1g_1ffCG57.smg /mnt/retail;
/osh/bin/rm -rf /mnt/att/* ;
cp -dpRf /mnt/retail/* /mnt/att/;
/osh/bin/umount /mnt/retail;
/osh/bin/umount /mnt/att ;
there are 3 smgs that you can mount
1) system directory ...CG57.smg
2) data & preinstall directory CG62.smg
3) osh directory CG58.smg
Looks interesting thanks.
Sent from my MB860 using XDA Premium App
This is pretty awesome. I was wondering if something like this can be done. Is there an actual way to edit the cg smgs, so you could repack your own sbf and flash it?
You can also just take the SMG and mount it on any Linux box. Saves a lot of trouble. Of course, if you don't have a virtual machine or don't use Linux, this could be faster.
im sorry but what can we accomplish with the SMG files?
samcripp said:
im sorry but what can we accomplish with the SMG files?
Click to expand...
Click to collapse
SMG is smg, LOL...
that was a joke!!!
Get serious, I really don't know exactly what it is, for now I know that only motorola is using it, so this is just a filename extension and nothing more.
Inside the smg you have contents that you can use to build a custom roms, anyway there are many ways to do this.
Code:
Is there an actual way to edit the cg smgs, so you could repack your own sbf and flash it?
yes there is, but there smg checksums verification when you load the sbf in rsd lite, I never successfully created a fully flashable sbf. Unfortunately there is no full tutorial about this.
briggie108 said:
This is pretty awesome. I was wondering if something like this can be done. Is there an actual way to edit the cg smgs, so you could repack your own sbf and flash it?
Click to expand...
Click to collapse
You can by editting a single code group, and flashing it via fastboot. You'll need linux to mount and edit the image though.

[GUIDE][i9100g/i9100] HOW TO DEODEXED ICS STOCK ROMS

The general API level for odexed apps and framework in ICS and Jellybean is higher (15) than the Gingerbread so the apps in ICS and Jelly bean need to be deodexed differently. Here's is a much general and 100% successful way of deodexing those apps and pushing them into system. I know some of you might suggest dsixda kitchen but thats just limited to Linux or cygwin users. So i am gonna talk fully about how to deodex them samsung apps.
First of all what is deodexing:
Here's a good guide:
http://www.wugfresh.com/guides/deodex/ (do not use the guide to deodex you might brick your device)
Now let us actually proceed with deodexing system files:
1. Gain the actual .odex files be it by copying from actual system files or by extracting the firmware fresh
2. Download the following tool (auto deodex tool 1.0.3): (thanks to xavierjohn22)
http://forum.xda-developers.com/showpost.php?p=13254199&postcount=3
3. Extract it inside a folder.
4. Place the respective system/app files to be deodexed in _app
and system/framework files to be deodexed in _framework
5. Run Autodeotoolmain.bat
6. First deodex jar files (ie _framework files) ress 5
7. It will take some time.
8. Your deodexed files will be in deodexed_jar folder
9. Deodexing apps requires some extra steps
10. Download the attached file java.awt.jar
11. Place the java.awt.jar file in deodexed_jar folder
12. Now to deodex .apk files press 4.
13. Use the following as your boot class path:
Code:
am.jar:android.policy.jar:android.test.runner.jar:apache-xml.jar:bmgr.jar:bouncycastle.jar:bu.jar:com.android.future.usb.accessory.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.google.android.media.effects.jar:com.google.widevine.software.drm.jar:com.samsung.device.jar:core.jar:core-junit.jar:ext.jar:filterfw.jar:framework.jar:framework2.jar:GlobalConfig.jar:ime.jar:input.jar:javax.obex.jar:libvtmanagerjar.jar:minimode.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:secframework.jar:sechardware.jar:secmediarecorder.jar:services.jar:svc.jar:twframework.jar:java.awt.jar
14. Press enter and drink some coffee or do something else it takes very long time.
15. After completion those apps will be stored in deodexed_apk
16. Now some jars and apks remain in _framework those do not need to be deodexed. Copy those files in deodexed_jar
17. Now copy deodex_jar folder and deodexed_apk folder to your phone (make sure unknown sources and usb debugging are on)
18. Unplug your phone once and let media scanning run
19. Plug you phone again and in windows command prompt fire in adb and type in following code:
adb shell
su
stop
mount -o remount,rw /dev/block/mmcblk0p9
/system rm
/system/app/*.odex
rm /system/framework/*.odex
busybox cp /sdcard/deodexed_APK/* /system/app/
busybox cp /sdcard/deodexed_JAR/* /system/framework/
chmod 644 /system/app/*
chmod 644 /system/framework/*
mount -o remount,ro /dev/block/mmcblk0p9 /system
sync
reboot recovery
Click to expand...
Click to collapse
20. In recovery wipe cache, dalvik and do a factory reset. Reboot (initially may take some time be patient)
21. Congratulations you are deodexed
thats nice
nice....
Thankyou ( +1 :good: )im looking this one!
Thnx ^^
thanks...
I found an options to optimize app, is it helpfull?
samyam2002000 said:
The general API level for odexed apps and framework in ICS and Jellybean is higher (15) than the Gingerbread so the apps in ICS and Jelly bean need to be deodexed differently. Here's is a much general and 100% successful way of deodexing those apps and pushing them into system. I know some of you might suggest dsixda kitchen but thats just limited to Linux or cygwin users. So i am gonna talk fully about how to deodex them samsung apps.
First of all what is deodexing:
Here's a good guide:
http://www.wugfresh.com/guides/deodex/ (do not use the guide to deodex you might brick your device)
Now let us actually proceed with deodexing system files:
1. Gain the actual .odex files be it by copying from actual system files or by extracting the firmware fresh
2. Download the following tool (auto deodex tool 1.0.3): (thanks to xavierjohn22)
http://forum.xda-developers.com/showpost.php?p=13254199&postcount=3
3. Extract it inside a folder.
4. Place the respective system/app files to be deodexed in _app
and system/framework files to be deodexed in _framework
5. Run Autodeotoolmain.bat
6. First deodex jar files (ie _framework files) ress 5
7. It will take some time.
8. Your deodexed files will be in deodexed_jar folder
9. Deodexing apps requires some extra steps
10. Download the attached file java.awt.jar
11. Place the java.awt.jar file in deodexed_jar folder
12. Now to deodex .apk files press 4.
13. Use the following as your boot class path:
Code:
am.jar:android.policy.jar:android.test.runner.jar:apache-xml.jar:bmgr.jar:bouncycastle.jar:bu.jar:com.android.future.usb.accessory.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.google.android.media.effects.jar:com.google.widevine.software.drm.jar:com.samsung.device.jar:core.jar:core-junit.jar:ext.jar:filterfw.jar:framework.jar:framework2.jar:GlobalConfig.jar:ime.jar:input.jar:javax.obex.jar:libvtmanagerjar.jar:minimode.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:secframework.jar:sechardware.jar:secmediarecorder.jar:services.jar:svc.jar:twframework.jar:java.awt.jar
14. Press enter and drink some coffee or do something else it takes very long time.
15. After completion those apps will be stored in deodexed_apk
16. Now some jars and apks remain in _framework those do not need to be deodexed. Copy those files in deodexed_jar
17. Now copy deodex_jar folder and deodexed_apk folder to your phone (make sure unknown sources and usb debugging are on)
18. Unplug your phone once and let media scanning run
19. Plug you phone again and in windows command prompt fire in adb and type in following code:
20. In recovery wipe cache, dalvik and do a factory reset. Reboot (initially may take some time be patient)
21. Congratulations you are deodexed
Click to expand...
Click to collapse
thanks mate now i used it XD
ICS_XD said:
thanks mate now i used it XD
Click to expand...
Click to collapse
so that means the GAME HAS BEGUN
incarnation95 said:
so that means the GAME HAS BEGUN
Click to expand...
Click to collapse
Yeah XD
Sent from my GT-I9100G using xda premium
delete java.awt.jar from deodexed_JAR after DEODEXED?
Can someone help me? i dont know why i get permission denied
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\user>adb shell
[email protected]:/ # su
su
[email protected]:/ # stop
stop
[email protected]:/ # mount -o remount,rw /dev/block/mmcblk0p9
mount -o remount,rw /dev/block/mmcblk0p9
[email protected]:/ # /system rm
/system rm
sh: /system: cannot execute - Is a directory
126|[email protected]:/ # /system/app/*.odex
/system/app/*.odex
sh: /system/app/AccuWeatherDaemonService.odex: cannot execute - Permission denie
d
126|[email protected]:/ #
Click to expand...
Click to collapse
I solved it already.
need help
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\user>adb shell
[email protected]:/ # su
su
[email protected]:/ # stop
stop
[email protected]:/ # mount -o remount,rw /dev/block/mmcblk0p9
mount -o remount,rw /dev/block/mmcblk0p9
[email protected]:/ # /system rm
/system rm
sh: /system: cannot execute - Is a directory
126|[email protected]:/ # /system/app/*.odex
/system/app/*.odex
sh: /system/app/AccuWeatherDaemonService.odex: cannot execute - Permission denie
d
126|[email protected]:/ #
i'm stock in this one..can someone tell me how to resolve it?
Refer to the guide by superatmos...this guide has typos...but can't remember exactly...
Use dsixda kitchen
Sent from my GT-I9100G using Tapatalk 2
this metod can be used to deodex leaked JB XXLSJ rom !?
Can I also deodex leaked Jellybean XXLSJ stock ROMS?
Not sure but why take the trouble? Legendk95 already released a deodexed version of that ROM...
I keep getting
I keep getting this error message when running the .bat: Java was not found, you will not be able to sign apks or use apktool
Press any key to continue . . .
I have the newest JAVA and even Java dev tools on my laptop. What should I do?
Java is not set in your home path...

Where does the original boot.img for magisk restore needs to be put

I put the boot.img to the MagiskManager folder but this does not work. What do I need to do? I read something about gzipping but I'd be grateful for instructions
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data
You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
ckpv5 said:
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data
You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
Click to expand...
Click to collapse
Oh I forgot to say I used your images and fastboot but fastboot doesn't work currently for me so i tried to use the normal method.
Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.
No idea how to fix your fastboot issue.
Benjamin_L said:
Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Click to expand...
Click to collapse
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
ckpv5 said:
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.
No idea how to fix your fastboot issue.
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
Click to expand...
Click to collapse
Fixed it with another laptop. Thank you for the time
How did you fix it ?
usernome said:
How did you fix it ?
Click to expand...
Click to collapse
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
JDKerados said:
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
Click to expand...
Click to collapse
I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.
Other than that it worked like a charm, thanks!
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
JDKerados said:
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
Click to expand...
Click to collapse
lap0 said:
I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.
Other than that it worked like a charm, thanks!
Click to expand...
Click to collapse
rophiroth said:
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
Click to expand...
Click to collapse
I'm in the same boat - I read that Magisk was supposed to autocreate a backup, if it did; it doesn't know where it went and I've tried a number of places (boot.img and gz zipped) and still nothing.
Android 12, Magisk 25.1
Thanks for any help!
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
This wanted me today on the Nothing Phone 1. Thanks so much!
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.
how to get past this?
v.konvict said:
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
Click to expand...
Click to collapse
That set of instructions didn't work for me - the one below that did (I'll quote it here):
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
JustinChase said:
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.
how to get past this?
Click to expand...
Click to collapse
Honestly, I'm not sure. It sounds like ADB Debugging may not be enabled on the phone's Developer Settings(?)
b_fizzle said:
That set of instructions didn't work for me - the one below that did (I'll quote it here):
Click to expand...
Click to collapse
I fixed the problem with just making sure i root my phone by letting magisk patch the boot image as it backs up the stock one while making the patched one.
I dug a bit deeper and discovered that shell was disallowed from within Magisk for some reason. I have no recolleciton of it asking me, but once i enabled it in magisk, I was able to su in a prompt and get my problem solved.

Categories

Resources