SOLVED! (Solution below)
Alright, so I tried everything I could, and spent almost my day trying to fix this. First of all what I did so far (it's maybe not the right method, so I let you know):
- Tried smali patcher
- Deodex error
- Google for hours, find a solution
- Search for /system folder, couldn't find NOWHERE, even with ES file explorer (root was checked)
- Downloaded "File explorer root browser"
(it's when the interesting part begins)
- Found system folder, copied to the storage, but somehow it didn't copy everything, only the apps an 2 empty folders
- So I copied the framework folder too into the system, and the build.prop
- Connecting phone, the folder is not even there
- Opened TWRP, because I read that I have to use that too, file manager, found the folders, copied them there into ANOTHER folder, and somehow it was there when I checked from the PC
- Finally finishing the deodexing, everything was okay, smali-blaksmali browsed etc.
- Opening smali patcher again, trying to browse services.jar, and of course it wasn't there, somehow it didn't copy that one (but I believe everything else was there)
- Searching for it via TWRP, copy-paste, PC, copy-paste into the framework, deodexer, bootclasspath not found
- I thought it's because the other files already deodexed, so I copied them from the phone again, put services.jar into the right folder, deodexing, done.
- Browsing in smali patcher, click on Path jar, I was so happy, I thought it's over, I did it, I'm the king.....
- "Target JAR must be deodexed"
- (UPDATE) I was able to copy the system folder properly with TWRP, deodexed, now smali patcher says "Mock location class not found".
Sorry for the long post, but I thought I share every information. I'm really sad. And really desperate. I read this forum too for help, and saw some really helpful people, I really hope someone can help me too.
For the TWRP part, I read about some adb sideload, read a llllot of things about it, but all of them was about copying files TO the phone, not FROM it, that's why I did it like this.
So again please help, because at this point I really don't know what to do.
As the device: Android version 7.0, Xiaomi redmi note 4.
Deodexer version 1.6, smali patcher 0.3.7 and 0.4.0
Solution
So apparently I'm blind. First of all I did everything by a reddit guide named "[mini Guide] [Android] [ROOT] Smalli Patcher: Deodexing services.jar "
It didn't really help, and even if I read some comments, I missed the most important to me, the comment of ajdroid270, who linked the correct, deodexed files to the phones Redmi note 4 (MIUI 10 - 8.12.20) and OnePlus 6T with 9.0.11 version. So if you have one of these devices, just simply download the files he mentioned, copy them to your phone, and flash with magisk. If not but you're stuck... well... praying helps sometimes.
Related
Hi all,
Apologies if this has been covered elsewhere but searching has done me no good.
I'm trying to do a bit of theming by modifying framework-res.apk with apkmanager 4.9. As I understand it, you're supposed to:
1. Decompile (9) the APK
2. Modify files in .\projects\framework-res.apk
3. Compile (11)
4. Answer Yes to this being a system apk
5. Answer Yes to keeping unmodified files
6. Delete the files from keep that have been modified
7. Press a key to continue
At this point, if I rename the new apk to file to .zip and look inside the files I've deleted from keep are simply not there.
If I don't delete the files from keep, the old files are there, not the new files I'm replaced them with.
If I replace the files in keep with the modified versions again instead of deleting them, they do appear in the final apk and show up on my phone correctly. This only work for images though and this isn't working for XML files - only images.
After step 5 I get a line in the apk manager log saying "The system cannot find the file specified."
Can someone tell me what I'm doing wrong?
Thanks
I've done my searching and experimenting to try to get this to work, but I'm stuck.
I've got a font (Rockwell) that I'd like to package up into a nice .apk so I can just install it now, and have something simple to reinstall in the future should I need to.
What I've done so far is to pull a font .apk out of my phone already (Armani font, in this case), decompiled it with apktools, and then edited the following files:
/assets/fonts -> replaced fonts with rockwell.ttf files
/assets/xml -> updated xml file with appropriate filenames
/res/values ->updated strings.xml only with new app name
/res/layout & /res/drawable -> did not touch these folders
/smali/com/monotype/android/font/Armani ->replaced all references to Armani with Rockwell
/AndroidManifest.xml ->updated package name
/apktool.yml ->updated to show correct output name for apk
I then used apktools to package up the files into an .apk file, and then transfer it to my phone. When I attempt to install it, it sees the file, tries the installer, but then says "package not installed successfully" (or something similar).
My questions are:
1. Did I edit something incorrectly?
2. Did I follow the wrong steps to package up the files?
3. Is it possible that Rockwell just isn't a .ttf file that can be used?
4. Did I install the .apk wrong? (i.e. is it a system file and needs to be installed in a root environment/pushed with adb)?
Thanks in advance - I'll post any additional information that is needed.
(Oh, and I do realize this is a question - I didn't post in Q&A because everything I've seen posted font-wise has been in this section. If I'm mistaken, please move this.)
Update:
I retraced my steps through this post, and realized that I hadn't signed the file in APK Manager.
I was able to install the font file, and it's all better now.
Back a year ago I rooted my nexus one phone, but the thing is I uninstalled a few stock apps. I had no idea that my updates would be a pain.
What I found out is that each new google update does a ton of asserts on files that it expects to be there. I had a problem with google books when I tried to update from 2.3.3 to 2.3.4, but someone on this forum hack a cracked version that allowed me to do so.
Now the annoying problem is back again, and this time, it's saying something about assert_failed: apply patch check ("system/app/EmailGoogle.apk...
I tried to find an EmailGoogle.apk out there, and I was able to find it, but if I was to use it, it wouldn't connect at all, then it would crash. I also placed it in system/app folder, and still same problem.
Is there a way for me to hack the update.zip so I can tell it to ignore these assertions?
AHH! I figured it out!
After much searching for updating scripts, I found out that there is indeed a file that tells your phone how to perform a patch update.
This involved me rebooting the phone 7 times (with about 5 times prior with previous experimentation)
Okay what I had were the following items
-Dropbox
-Root Explorer
-Laptop
Initially I got the error after running anon ra recovery, but I lost it when I accidently updated 2.3.4 again (I stupidly named my files as update.zip, update1.zip, update2.zip). Actually, I lost root (the phone still had the unlocked thing on it, but it was fooled). So I used this website (to root my phone again):
http://chensun.net/android-development/root-nexus-one-with-android-2-3-3-gingerbread/8/
So to get the specific error
1.you shut down your phone
2. reboot by pressing power button and down volume and hold it
3. Select recovery by navigating using the down volume, and select it by pressing power button.
4. After it reboots again, scroll down using your trackball and select Flash zip from sdcard
5. make sure you toggle signature verification to disable
6. select your update.zip
thats how you get your error
to fix:
1. So I took the signed zip file, and uploaded it to my dropbox
2. I opened the file using winrar (DO NOT UNZIP THIS FILE TO EDIT) the reason you do not want to unzip is because if you zip it up again you lose the signature, and your phone won't find the script
3. I used winrar to navigate to the following:
META-INF-->com-->google-->android
4. Open update-script using notepad
5. crtl-f on each package-name searching through the file:
emailgoogle.apk
GenieWidget.apk
Mms.apk
Talk.apk
Twitter.apk
VoiceDialer.apk
(ugh.. I forgot I uninstalled all those)
they existed twice. Once to assert to make sure the file exists, and the second to apply the patch
You have to remove both, you can keep the progress bar command there, that's just to update the progress of your update on your screen
example
;assert(apply_patch_check("/system/app/Twitter.apk", "48dcef1792760138acb1c10e2a2341dfbee69258", "e3e34aa0a72d0eaf76d80a06828bd14ea8450d34"))
apply_patch("/system/app/Twitter.apk", "-",
48dcef1792760138acb1c10e2a2341dfbee69258, 1596937,
e3e34aa0a72d0eaf76d80a06828bd14ea8450d34, package_extract_file("patch/system/app/Twitter.apk.p"));
so after repeating this over and over, it finally updated
anyways, going to sleep
Unzip the file on your phone with eStrongs file manager.
Edit the update script (eStrongs again).
Rezip (eStrongs again).
Sign with ZipSigner, or toggle signature verification in recovery.
Flash.
Note, if you use the "flash zip from SD" option, you don't need to name the file "update.zip"
thanks danger-rat, seen your posts many times before, I saved lots of your comments in my evernote
I already knew about renaming update.zip, I just got into a dumb naming habit, the last 5 tries I just kept the name as it was
my root explorer (file manager) by speed software does what eStrongs does, I can edit, zip, tar, unmount folders, set permissions etc, maybe you should check it out
but i've learned two new things about your post
never heard of zipsigner, and eStrongs
thanks for showing the quicker way of doing this, the dropbox thing was a bit of a hassle, but I love editting this on my computer rather than my phone using the trackball touchpad combo :-|
I'm wondering why a solution wasn't even there when I was looking for answers around the web? I searched for hours too. I'm also glad I didn't brick my phone!
Yeah, I use Root Explorer a lot. I prefer the interface on eStrongs and love the LAN capabilities and Dropbox interface, but Root Explorer is much better when you need root permission.
Does anyone know how to enable USB Mass Storage on our phones under CM10.1? I've searched around and found this thread. But since I'm not familiar with changing build.prop I don't dare to do it myself. There are some CWM .zip files around to enable it, but they are on other phone's forums and I'm sure they just replace/change the build.prop so it's definitely not a good idea to flash those on a different phone than the ones they were intended for....
Long story short, does anyone know how to enable it on ours?
TIA!
Update on the process:
I was able to edit the build.prop according to the instructions, but that alone doesn't seem to do anything.
So I decided to try the next step, but where it tells me to do the changes below I wasn't sure what to do.
Thom75 said:
in framework-res.apk/res/xml/storage_list.xml
where oryginal line look like this:
Code:
<storage android:mountPoint="/storage/sdcard0" android:storageDescription="@string/storage_sd_card" android:primary="true" android:removable="true" android:maxFileSize="4096" />
after change look like this:
Code:
<storage android:mountPoint="/storage/sdcard0" android:storageDescription="@string/storage_sd_card" android:primary="true" android:removable="true" android:allowMassStorage="true" android:maxFileSize="4096" />
Click to expand...
Click to collapse
I was able to find the framework-res.apk file, copied to my computer and tried to open it with an XML editor... looked too complicated so I left it alone.
Does anyone know how to mess with that?
Open the .apk file with WinRar
-Drag the file you want to edit on your computer
-Edit the file on your computer
-Delete the old file in Winrar from the apk file
-Put the new file from your computer back in Winrar and save the "new" apk file
-Put the new .apk file on your smartphone
Before you install the new .apk file take a Root Explorer and look at the permissions of the old .apk file and set this permission on the new once...
I hope i could help you
Sivvis said:
Open the .apk file with WinRar
-Drag the file you want to edit on your computer
-Edit the file on your computer
-Delete the old file in Winrar from the apk file
-Put the new file from your computer back in Winrar and save the "new" apk file
-Put the new .apk file on your smartphone
Before you install the new .apk file take a Root Explorer and look at the permissions of the old .apk file and set this permission on the new once...
I hope i could help you
Click to expand...
Click to collapse
Thank you very much for your help! I didn't know apk files were just a compressed library of other files.
Now I am stuck trying to edit the "storage_list.xml" file... I tried to open with a few different xml editors, but could not get clean text like the example before. Any sugestions?
I attached the file below:
Apoena said:
Now I am stuck trying to edit the "storage_list.xml" file... I tried to open with a few different xml editors, but could not get clean text like the example before. Any sugestions?
Click to expand...
Click to collapse
Well, how about decompiling the .apk file with APK Tools instead of just opening it with WinRar? :laugh:
Yes, now I get a clean, editable, decompiled xml file.
I'll try editing both when I get home tonight and will post the results.
I guess this is a problem because of the emulated layout. There is a trick with setprop sys.usb.storage.config mass_storage but it does not work.
Keep me informed if you find something valuable (i'm on original CM10.1, latest nightly 0423 actualy).
Ok, here's the update from last night:
I started over since I flashed the nightly, which is good so I restarted with a clean slate.
- Edited build.prop - OK
- Copied framework-res.apk to my computer
- Decompiled framework-res.apk
- Edited storage_list.xml
- Recompiled framework-res.apk with new storage_list.xml
- Copied framework-res.apk back to my phone
- Deleted original framework-res.apk
- ...... instant restart & bootloop before I could paste the new framework-res.apk in its place
No big deal, just restored a nandroid backup I made before messing with anything and I'm back in business.
Apparently you can't mess with the framework-res.apk while your phone is on (with the OS running)... so now I need to research the right way to push/pull these files from ADB while on CWM recovery. I appreciate if someone could point me in the right direction since I'll be busy at work today.
To be honest, my gut feeling tells me that this is not going to work anyway. But look at what I learned so far... two days ago I wouldn't even think of compiling/decompiling anything... this is what XDA is all about, right?
Imho, the framework_res.apk and various tricks are all enabling or disabling a sys.usb.storage.config key. I'm not understanding nor finding informations about CM10.1 emulated layout, and if there are any reasons to forbid mass storage (because, yes, it seems it is disabled because it is not compatible).
This is something i have hard time with. On Android, you have tons of improvement for rom or kernel XY, but generally undocumented. If you apply this 'per device', the information is very fragmented and difficult to grab.
I was looking for a simple brief on base MTD partitions layout for LG P880, it seems the only way to have this is to dig KDZ files. Perhaps a Wiki would help the wannabe contributers like me to start ?
Any Solution For This Problem ??? I Can't Transfer Any Files To My O4X , What's The Point Of Cyanogenmod Then ??????????????
Nooby305 said:
Any Solution For This Problem ??? I Can't Transfer Any Files To My O4X , What's The Point Of Cyanogenmod Then ??????????????
Click to expand...
Click to collapse
Flash the latest nightly. MTP is working and you cab transfer files that way.
Sent from my tree using a ladder
effectively, if you are flashing for USM, you should stay on LG stock.
I know that the topic got a little old but I'd like to refresh it since more people (e.g. Ubuntu users) could be interested in enabling Mass Storage.
What I've done is:
1) pulled /system/framework/framework-res.apk
2) decompiled it with APKtool
3) added
Code:
android:allowMassStorage="true"
in storage_list.xml
4) builded a new apk
then I've rebooted my phone into recovery and (@Apoena you may be interested in it - there is a possibility to access /system through adb connected with phone in recovery mode) pushed the new framework-res.apk. I've also changed the entry in build.prop to
Code:
persist.sys.usb.config=mass_storage,adb
Everything seemed fine until I've tried to reboot the phone: instead of CM boot logo I got a black screen. Anybody has an idea what went wrong (maybe something during recompilation of the apk)?
And of course sorry for any language mistakes, I'm not a native speaker
Hello guys, I'm here to show you how to fix it without repeatedly turning it on and off. (I provided the stock bluetooth for you guys, that don't have it)
This is only for LTE jem, sorry for any convenience. (For bluetooth.)
1. Download this https://www.dropbox.com/s/29pw4nm27pgl8aj/Bluetooth fix.rar?dl=0
2. Extract it.
3. Replace /System/etc/Bluetooth/bcm2076_20mhz.hcd with BCM2076_26MHZ.HCD
4. Replace /System/vendor/firmware/bcm2076_20mhz.hcd with bcm2076_20mhz.hcd (The one I provided for you)
Then tada! Bluetooth works, you can only connect to compatible devices it seems but bluetooth finally works.
Now onto how to fix amazon jem not being recognized, on your pc/laptop.
I'm going to be honest here, this will be very short lol.
So anyways, go to this link https://windows10skill.com/kindle-fire-not-recognized-on-windows-10/#2 and follow the steps provided. Method 2 helped me, so try that first if you want. (This can work on windows 7 too, I forgot where I found it at but you can try following it still.)
That's all I have, for now. I hope all of you guys get everything fixed! Please let me know if this was helpful for you, I would appreciate it.
This RAR file won't open
Out of curiosity, I tried this with the latest CRdroid 3.8.7 from @transi1 in the other thread (which is useless because the ROM has functional bluetooth out of the box, at least with keyboards and mice). I was able to download and unpack the RAR, and install the files as described (had to remount /system for read-write in an adb shell in order to write in those directories). However, after replacement, the bluetooth didn't work any more, completely dead. When I restored the original files, it started working again. Maybe this is only for the LTE variant of the Jem (which reportedly has another Bluetooth chipset)?
EDIT : I checked that the HCD file above differs from the original one built into the ROM.
bapi28 said:
Out of curiosity, I tried this with the latest CRdroid 3.8.7 from @transi1 in the other thread (which is useless because the ROM has functional bluetooth out of the box, at least with keyboards and mice). I was able to download and unpack the RAR, and install the files as described (had to remount /system for read-write in an adb shell in order to write in those directories). However, after replacement, the bluetooth didn't work any more, completely dead. When I restored the original files, it started working again. Maybe this is only for the LTE variant of the Jem (which reportedly has another Bluetooth chipset)?
EDIT : I checked that the HCD file above differs from the original one built into the ROM.
Click to expand...
Click to collapse
Oh my god, I'm so sorry I forgot to mention this is only for lte devices. Sorry!
Understood step 4. But on step 3 when it states replace a file with a file having a different name, does that mean 1) delete original file and put new file in that folder, or 2) rename new file to existing files name and copy over top of existing file replacing it?
Ok, answered my own question and figured it out.
I did not have such a file in the /System/etc/Bluetooth folder.
I renamed the 26mhz file to 20mhz and replaced (overwrote) the file in the /System/vendor/firmware folder.
It is working great finally after issues for the past few years. Awesome. Thanks.