[GUIDE] A bugfix for WordsWithFriends using apktool - Android Software/Hacking General [Developers Only]

This guide is a great example of how to hack a third-party, closed-source application using apktool and smali. The first goal is to fix an annoying UI lag bug in Words With Friends by inserting a call to Thread.yield() at the top of a tight loop before acquiring a global lock. The second goal is to turn off the advertisements that display after every move.
Table of Contents
1. Install Words With Friends from Google Play
2. Extract the APK file from device onto PC
3. Decompile the APK file
4. Edit Smali: add Thread.sleep() to animation loop
5. Edit Smail: remove addActivity() call for ads
6. Reassemble the APK file
7. Sign the Reassembled APK File
8. Zipalign the reassembled APK file
9. Uninstall Words With Friends from the device
10. Install the fixed Words With Friends APK to the device
Appendix A: Troubleshooting
1. Install Words With Friends from Google Play
Words With Friends is a free application provided by Zynga and is available for install from the Google Play store. Simply search for Words With Friends and install it. More information about the app is available at http://www.wordswithfriends.com.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Extract the APK file from device onto PC
In order to modify the Words With Friends application the APK file needs to be obtained. There are several different ways to extract an APK file from your device. The method outlined here is using Astro File Manager from the Google Play store.
Install Astro File Manager from the Google Play store
Launch Astro File Manager from home screen
Select "Application Backup" *
Checkmark "Words Free"
Click "Backup"
Copy the Words With Friends APK file from /sdcard/backups/apps to your PC
* If the screen does not have an "Application Backup" item but rather goes straight into the file browser, open the menu and select "Application Backup" from the there instead.
Astro File Manager will create the folder "backups/apps" on the SDCard if it does not exist and put the Words With Friends APK file in it. The file name may vary, and in my case it was "Words Free-4811.apk".
If you have root access to your device, it may be easier to simply copy the APK file from /data/app to /sdcard and then copy it off the device from the SDCard. To do this I like to use a program called "Terminal Emulator", which can be installed from the Google Play store. Then you can just run the "su" command followed by "cp /data/app/com.zynga.words-1.apk /sdcard" to copy the APK file to the SDCard.
3. Decompile the APK file
The next step is to decompile the Words With Friends APK file using "apktool". The apktool application is freely downloadable from http://code.google.com/p/android-apktool and requires the Android SDK and Java Development Kit (JDK) to be installed. The steps that follow assume that the directory with the "apktool" command is in the PATH environment variable and may be called without having to give the absolute path. I will not cover the steps to install the Android SDK nor apktool here, as there are numerous good instructions on the Internet. The apktool application works on Windows, Mac, and Linux. I will be using Ubuntu Linux 12.04 64-bit (not that it really matters!).
Open a terminal/command prompt into the directory where the Words With Friends APK file is located. In my case, the name of the APK file was "Words Free-4811.apk", but I have renamed it to "WordsWithFriends-original.apk" for simplicity.
Run the following command to decompile the APK. The "-d" command-line argument decompiles the application in "Debug mode". I am not entirely sure what this does, but many instructions recommend its usage. Since it has worked for me, I use it unconditionally. If you get any errors with this commoand, try removing "-d" to see if that works.
apktool decode -d WordsWithFriends-original.apk decoded​
This command will create a directory named "decoded" with the decompiled contents of the APK.
4. Edit Smali: add Thread.sleep() to animation loop
One of the bugs in Words With Friends is that there is a tight loop that spins, acquiring the graphics lock, checking if there are any animations to draw, then performing the animations if there are any. The problem is that sometimes this thread "thrashes" or "spins", causing the UI of the application to become temporarily unresponsive. This bug is especially noticable when a blank tile is played: after selecting the letter for the tile, the app appears to hang for several seconds. The fix for this is simple: put a call to Thread.yield() at the top of the loop before acquiring the graphics lock.
To fix this, open the file decompiled/smali/com/zynga/words/ui/game/as.smali in a text editor. Find the "run" method and then the line that follows that looks like:
iget-object v0, p0, Lcom/zynga/words/ui/game/as;->c:Landroid/view/SurfaceHolder;​(for me this was at line 136). The two lines above it should be ":try_start_0" and ".line 2569" ("2569" may be different). Insert the following line *above* the ".line 2569" line:
invoke-static {}, Ljava/lang/Thread;->yield()V​
Save the changes to the file then exit.
5. Edit Smail: remove addActivity() call for ads
Do you ever get annoyed at the advertisements that are displayed after each move you make? Although this may not be legal, it is quite simple to stop those ads from displaying. All you need to do is remove the command that displays them.
To do this, open the file decompiled/smali/com/zynga/toybox/ads/f.smali in a text editor. Find the line with the text "startActivity" (for me this was line 181) and either delete it or add a '#' as the first character of the line (to turn it into a comment). Then, comment or delete the ".line" line immediately above the startActivity line. Save the changes to the file then exit.
6. Reassemble the APK file
Now we need to rebuild the APK file from the modified smali sources. To do this, run the following apktool command:
apktool build -d decompiled WordsWithFriends-unsigned.apk​
This should create the APK file WordsWithFriends-unsigned.apk in the current directory.
7. Sign the Reassembled APK File
Before the modified APK file can be loaded onto a device it must be signed. The instructions below are adapted from the official "Signing Your Applications" page at http://developer.android.com/tools/publishing/app-signing.html.
If you are already setup for APK signing, then this paragraph may be ignored. Otherwise, run the following command to create a code signing key:
keytool -genkey -keystore keystore -alias MyReleaseKey -keypass password -storepass password -keyalg RSA -keysize 2048 -validity 10000​This will create a file named "keystore" in the current directory, protected by the password "password". Obviously, this is a terribly insecure password, so I wouldn't recommend using this key for anything else (unless you choose a better key). If you use different values for the -keystore, -alias, -keypass, or -storepass be sure to make the corresponding adjustments to the instructions that follow.
Run the following command to sign your APK file:
jarsigner -keystore keystore -storepass password -keypass password -sigalg MD5withRSA -digestalg SHA1 -signedjar WordsWithFriends-signed.apk WordsWithFriends-unsigned.apk MyReleaseKey​
Of course, replace the values of the -keystore, -storepass, -keypass, and MyReleaseKey with the corresponding values on your system.
This should create a file named WordsWithFriends-signed.apk in the current directory, which is the signed version of the modified application.
8. Zipalign the reassembled APK file
Although it is not strictly required, as a performance increase the signed APK file can be "zipaligned". Simply run the following command:
zipalign 4 WordsWithFriends-signed.apk WordsWithFriends.apk​
This will create a file named "WordsWithFriends.apk" in the current directory which is both signed and zipaligned. This is the "final" APK file that is ready to be installed.
9. Uninstall Words With Friends from the device
Since the modified APK file is signed with a different key than the one used to sign the APK that was installed from Google Play, the Android OS will refuse to load the modified APK. So before loading it Words With Friends must be uninstalled from the device. This can either be done from the device (eg. from the home screen or Settings -> Applications screen) or by connecting the device to the computer via the USB cable and running the following command:
adb uninstall com.zynga.words​
10. Install the fixed Words With Friends APK to the device
Finally, install the signed and (optionally) zipaligned APK to the device connecting the device to the PC via the USB cable and running the following command:
adb install WordsWithFriends.apk​
And you're done! Enjoy a better Words With Friends experience.
Appendix A: Troubleshooting
If you encounter any problems, check this section before reporting it.
A1. Cannot sign into Words With Friends using Facebook
It seems that sometimes after replacing the Words With Friends application from Google Play with the custom one that Facebook authentication does not work. Specifically, when the Words With Friends application starts up and prompts for either a Facebook account or email address to sign in, when Facebook is selected it briefly starts loading the Facebook page then returns to the Words With Friends application without having logged in.
This may be because the signature on the APK has changed. The workaround is to uninstall the Facebook application, log into Words With Friends with Facebook, then re-install the Facebook application from Google Play. This will cause Words With Friends to use the facebook.com web page to log in instead of the Facebook application that is installed locally, which does not check APK signatures.
A2. Words With Friends no longer updates from Google Play
Yep, that's unavoidable. To upgrade you will need to go through this entire process again, first uninstalling the modified Words With Friends and starting over with installing from Google Play.
A3. adb install fails with error "INSTALL_PARSE_FAILED_NO_CERTIFICATES"
If "adb install" fails with the error "INSTALL_PARSE_FAILED_NO_CERTIFICATES" then be sure that you are attempting to install the signed APK, as the OS will refuse to load unsigned APKs.
If you are using JDK 7 (as opposed to JDK 6 or 5), which can be tested by running "javac -version" then make sure to include "-sigalg MD5withRSA -digestalg SHA1" in the command-line arguments to jarsigner. The default signing algorithm changed in JDK 7, requiring that these arguments be explicitly specified (see http://developer.android.com/tools/publishing/app-signing.html#signapp for details)

Related

[TIP] [FROYO] How to change the carrier name

Here's how to change the carrier name in the Triumph. I ran across this while looking for some other strings.
You will need to decompile framework-res.apk, make your changes, and then recompile it. If you don't know how to decompile the file, I recommend that you read this great thread on XDA written by KBanause; he gives you links to the tools that you will need as well as walking you through making theming edits:
http://forum.xda-developers.com/showpost.php?p=9066440&postcount=1
The steps below will assume that you are using apkmanager:
1. Decompile framework-res.apk using apkmanager.
1a. To do that, place the framework-res.apk file into the place-apk-here-for-modding folder.
1b. Start apkmanager. In Windows, double-click on the script.bat file in the main apkmanager folder. I'm not sure what you would type to start apkmanager in another OS since I haven't used this in any other OS at this time.
1c. In APKMANAGER, hit 22 and select the number for your framework-res.apk file -- if it is the only file in the place-apk-here-for-modding folder, it should be 1.
1d. Back on the main menu, select 9 to decompile framework-res.apk.
2. Once, the decompile is complete, browse to the projects folder in apkmanager and you should now have a new folder inside named framework-res.apk. Look inside the framework-res.apk folder and you should now be able to find the subfolder \res\values . This folder ONLY shows up if you decompile framework-res.apk.
3. Find strings.xml in that folder and open it in a text editor such as notepad++ or such. I don't recommend using the built-in Notepad in windows.
4. Find the line:
<string name="roamingText1">Virgin Mobile</string>
Change the "Virgin Mobile" to whatever you want. For example, changing this to:
<string name="roamingText1">Save the tatas</string>
5. After making your changes, recompile framework-res.apk.
5a. In apkmanager, use option 11 to recompile.
5b. When asked if this is a system file, select Yes.
5c. When asked if you want to copy over additional files, click Yes and it will extract the files into a folder named Keep in apkmanager and then pause.
5d. Go into the Keep folder and delete any files that you changed, in this case you only need to delete the resources.arsc since the only thing you changed was the strings.xml file.
5d. Back on the apkmanager screen, hit the space bar or Enter to continue.
5e. A file named unsignedframework-res.apk will be created in the place-apk-here-for-modding folder. You'll need to rename it back to framework-res.apk.
6. Either adb push the new framework-res.apk back into your phone or put it in a flashable Zip file and flash it in recovery.
6a. For anyone wanting to put their new file into a flashable zip, I've attached an empty Zip file in this thread. Add your new framework-res.apk file into the \system\framework folder. Make sure that you have your Zip utility set to just use the Store or No Compression method. You do not need to change anything in the META-INF folder for just this simple flash. Note: the updater script in the zip file mounts the file system as ext3 so I don't know how well that will work if your file system is ext4.
This results in the changes on the lockscreen and the extended status screen:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So would this allow me to change your ROM's carrier text? Because I haven't found a version of apktool (or a deodexed ROM) that has allowed me to decompile and recompile a framework-res.apk yet.
primetechv2 said:
So would this allow me to change your ROM's carrier text? Because I haven't found a version of apktool (or a deodexed ROM) that has allowed me to decompile and recompile a framework-res.apk yet.
Click to expand...
Click to collapse
It depends on what version of apktool/apkmanager that you're using. Without knowing that, I can't say if you'll be successful or not.
I'm doing all of this on Windows.
Edit: Apparently APK Manager has a version 5.0 released. Linking it here instead of the original 4.9 that was linked before (thanks to one_love on sdx for pointing that out to me):
http://forum.xda-developers.com/showpost.php?p=16831998&postcount=1
However, I was always getting an error with the version of apktool 1.4.1 built into that APK Manager. I upgraded the APKTOOL to an unreleased version 1.4.2.26970b.jar which you can download from brut.all on his google code site. He provides it in one of the issues that somebody reported here:
http://code.google.com/p/android-ap... Type Status Priority Milestone Owner Summary
Just download the apktool1.4.2.269870b.jar from the link brut.all provides and then rename it to apktool.jar and then replace the version in apkmanager in the OTHER folder with the updated one.
I also downloaded the latest version of appt.exe and apktool.bat that is on brut.all's download area (they are contained in the apk install downloads (download the appropriate one for your os) and replaced the respective files in the "other" folder of apk manager:
http://code.google.com/p/android-apktool/downloads/list
That took care of all of my errors decompiling/recompiling framework-res.apk (except of course for user errors).
If that doesn't solve your issue, post your log file of errrors here or on the apk manager thread and perhaps somebody can help you/give you suggestions.
o.o
I didn't know all that was there... it should keep me busy for a little while, at least. Many many thanks. It sounds like 1.4.2 should be the build that fixes all my problems.
how or where do you get the framework?
You can either get it from a root file manager (like File Expert, Astro, Root Explorer), by navigating to /system/framework and getting framework-res.apk,
or by executing the following command from your command line (provided you have Android SDK and its platform tools installed):
Code:
adb pull /system/framework/framework-res.apk
Either of these will give you a working framework resource file to work with. (Umm... if it's not framework-res.apk, do this with the different filename.)
From there, use APKTool to decompile the whole file via the command line again...
Code:
apktool d framework-res.apk (or whatever the file be).
Once you've edited the contents to your liking, run the following to build the folder back into a workable framework-res...
Code:
apktool b framework-res framework-res.apk
If you changed the source (you did), also make sure you sign the new apk file... in this case find testsign.bat (and testsign.jar etc) and run the following:
Code:
testsign framework-res.apk
From there, getting framework-res.apk back can be a bit of a hassle. I have no evidence it can be done just by returning the file to the /system directory, and a few people have recommended throwing it into an update.zip package. If you find this to be an effective method, I'd recommend stealing b_randon14's stock Triumph ROM, opening it, replacing the framework-res.apk with your own, and then rezipping it (no signature is necessary here).
Need more info? lol. If you're confused feel free to PM me or one of the real gurus here.
Thank you kind sir, i successfully changed the carrier name.
boomersooner25 said:
Thank you kind sir, i successfully changed the carrier name.
Click to expand...
Click to collapse
Congrats! I probably shoulda just asked if you wanted me to do it for ya instead of writing a mini-tutorial. But it was fun.
You see to know a lot primetech..u should make your own rom
Thank you for this
Hello I am francais and I do not manage to make this tuto could use me?
Thank you
http://forum.xda-developers.com/attachment.php?attachmentid=850833&stc=1&d=1326227385
Carrier NICOLAS
UP ?
Please help
niconoel said:
Hello I am francais and I do not manage to make this tuto could use me?
Thank you
http://forum.xda-developers.com/attachment.php?attachmentid=850833&stc=1&d=1326227385
Carrier NICOLAS
Click to expand...
Click to collapse
Is this for the Motorola Triumph? or another phone?
Is for htc sebsation
Thank you
I don't think these instructions will work for the HTC Sensation. I would recommend that you go to the HTC Sensation forum and check with somebody there.
These instructions are specific to the Motorola Triumph.
Thank you
But I have to go to see(visit) where then thank you
Thanks
it was really helpful, i did it on my Mac BP.
I couldn't use ADB to push framework-res.apk back to system/framework,
Terminal never listed my phone on the "adb devices" (I spent the whole afternoon trying to do it this way). I used the zip file instead and was a lot easier.
NOw i have a custom carrier name, THANKS A LOT, you are a life saver
Help
I get a an error everytime i try to abd push my framework-res into my phone..
And when i tried to flash it with the flashable zip, i got md5 mismatch
BiHFSA said:
I get a an error everytime i try to abd push my framework-res into my phone..
And when i tried to flash it with the flashable zip, i got md5 mismatch
Click to expand...
Click to collapse
When doing the adb push, did you first do "adb remount" without quotes of course? If you don't then, your os will still be read only and you'll get an error. So you need to do:
adb remount
adb push framework-res.apk /system/app/
Assuming that you're in the same directory as your modified framework-res.apk file.
As for why you're getting an md5 mismatch, I'm not sure what's causing that. I've not heard of anyone else having that issue. You're aware that this guide is meant for the Motorola Triumph, correct and it is only for FROYO roms? So I assume that you have an MT?
Hey Guys
Does it work on the Samsung Galaxy S2 on Android 4.0.3 too? Does anyone know this ?
Greetings
Deadboy

[GUIDE] hOw TO Deodex JB firmware (I9070)

GUIDE
This is a guide to help you de-odex your Jellybean odexed firmware.
As X-ultimate is not working on jellybean firmwares and @Agadoo spends a lot of time deodexing every firmware, I thought this guide can help a lot of people including @Agadoo.
THINGS TO REMEMBER :-
1. I AM “ NOT AT ALL RESPONSIBLE” FOR ANY SOFT-BRICKS OR ANY OTHER DAMAGES TO YOUR PC OR PHONE
2. WHEN YOU DEODEX YOUR FIRMWARE, SYSTEM WILL WRITE “.dex” FILES IN /data/dalvik-cache, WHICH WILL REDUCE SPACE IN THAT FOLDER.
3.YOU WILL READ THE WHOLE THREAD CAREFULLY BEFORE DOING ANYTHING.
There is a simple way to deodex your firmware i.e. using universal deodexer (http://forum.xda-developers.com/showthread.php?t=2213235). Here, when I say simple, I mean the download and setup of this program is simple.
But a few features are missing in it. Firstly it cannot zipalign after deodexing the firmware. The second problem is a major problem , as far as I think. We have preload partition and a system partition in our phone. The “.apk” and “.odex” files stored in the preload partition, have symlinks in the system folder. It means there are a few “.apk” and “.odex” files in the system folders which are not actually applications but symlinks of those apps in preload folder. So you need to manually sort them out, which is a real pain in your a**. But don’t worry, the below mentioned method is different.
ANOTHER way to deodex, like Universal deodexer....... Carbonite tool (credits- adityaf) --- http://forum.xda-developers.com/showthread.php?t=2226160 (ty kingbabasula)
***********************************************************************************************************************************************************************************************************************************************************
This method uses android kitchen (by dsixda) to deodex the firmware. SO ALL THE CREDITS GO TO HIM. Original thread ------- http://forum.xda-developers.com/showthread.php?t=633246
Setup looks complex because I have given a detailed explanation on how to do it.
The guide is in two parts. First part in first post and the second in the second post.
PART - 1
PREREQUISITES :- (installing cygwin and android kitchen)
1.LATEST VERSION OF JAVA SHOULD BE INSTALLED ON YOUR PC.
2.CYGWIN……….
Go to (http://www.cygwin.com) and download the LATEST setup.exe file TO AVOID ERRORS. (Remember to install in C:\cygwin) SEE BELOW, HOW TO INSTALL.
************************************************************************************************************
Cygwin instructions for dsixda's Android Kitchen
-------------------------------------------------
1) Run the Cygwin setup.exe and select the defaults for the installation paths, such as:
- install from internet
- install to C:\cygwin
2) At the 'Select Packages' screen, go to the 'Search' box to look for the following package:
* gcc4 (found under 'Devel')
- Click on the '+' symbol at the section it's found under
NOTE:- IN THE SELECT PACKAGE SCREEN, UNTICK "HIDE OBSOLETEPACKAGES" IN BOTTOM LEFT CORNER, AND THEN SEARCH FOR "gcc4".
..................Now it would be found under "_obsolete" and not under DEVEL...... (thanks bob for pointing)
- Then find this single package (only the one with this exact name, not multiple similarly-named ones!) and click 'Skip' once so that it changes to show a version number
Go back to the Search box and repeat the above steps for the rest of the packages:
* libmpfr4 (found under 'Libs')
* perl (found under 'Interpreters')
* cpio (found under 'Utils')
* util-linux (found under 'Utils')
* ncurses (found under 'Utils')
* zip (found under 'Archive')
* unzip (found under 'Archive')
* wget (found under 'Web')
3) Press Next to proceed installing these packages.
4) When installation has been completed, click on your new Cygwin desktop shortcut. This will open a terminal session that will run some initialization.
5) With the Cygwin terminal still open, we need to configure the path to the Java application so that it can be executed within Cygwin.
In the terminal, type the command 'java' (without quotes). If it says 'command not found', then read the below. Otherwise, skip this section.
First, make a backup of your .bash_profile file in case you make a mistake later in this procedure.
Enter the following in the terminal:
cp .bash_profile .bash_profile.backup
Next, find out where your java.exe file is and run the appropriate command to add it to your Cygwin path.
For example, my java.exe is found under C:\Program Files\Java\jre7\bin, so I had to type:
echo "PATH=/cygdrive/c/Program\ Files/Java/jre7/bin:\${PATH}" >> .bash_profile
Modify the command above so that it matches the actual path to your installed Java.
Remember to add a "\" character before any spaces in your path, as shown above.
Type the following so that the file gets loaded (you only need to do this once):
source .bash_profile
There should not be any errors displayed if successful.
(Otherwise, if you made an error in the .bash_profile file, restore your backup by typing: cp .bash_profile.backup .bash_profile, and then try the procedure again)
If done correctly, then when you type 'java' it should display some help information.
6) Your Cygwin is now ready for the kitchen!
************************************************************************************************************
3. Now download the kitchen from dsixda’s github https://github.com/dsixda/Android-Kitchen/tags. (Click the zip option.)
4. Now create a folder kitchen inside C:\cygwin\home\ and extract the kitchen’s zip in that folder. Your kitchen is setup now.
View the next post for deodexing
Credits:
1. Cygwin
2. dsixda
3. BOBFRANTIC FOR REPORTING
PART -2
HOW TO DEODEX :-
Requirements……………….
1. Download this zip file which contains two windows application files and updater script. LINK------ http://db.tt/T9Tooxy8
a. Linux disk internals - Install this file.
b. SGS2ext - Just keep it.
c. META-INF - Just keep it.
2. WinRAR
Procedures…………………….
1.Download the Samsung firmware that you want to deodex and Extract the “system.img.md5” and “hidden.img.md5” from the firmware(.tar.md5) with WinRAR. I suggest you extract it in new clean folder. Just minimize this folder.
2.Now right click SGS2ext.jar and open it with java. A window will open. Now drag the system.img.md5 (that you have extracted) from the minimized folder to this window. Let it complete fully. After that reopen SGS2ext do the same with hidden.img.md5. You will get two files in that folder i.e. “system.img.ext4.img” and “hidden.img.ext4.img”.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
3.Make a folder by name “WORKING_deodex” inside C:\cygwin\home\****\kitchen\. The word “WORKING_” should be in capital letters. Copy the META-INF folder that you downloaded to the “WORKING_deodex” folder. Create two new folders inside “WORKING_deodex” folder namely “system” and “preload”.
4.Search and Open the application “DiskInternals Linux Reader”. Select mount image from the left pane. Select raw disk images and click next. Browse and select “system.img.ext4.img”. This file will then be mounted. Inside the mounted folder, click only the “app” and “framework” folder and save it inside C:\cygwin\home\****\kitchen\WORKING_deodex\system
Do the same with with “hidden.img.ext4.img” file. But this time after mounting, save only the symlink folder to C:\cygwin\home\****\kitchen\WORKING_deodex\preload.
5. Now open cygwin terminal from desktop. Remember to run this as an administrator.
Then type “cd kitchen”.
Now type command “./menu”. You will enter android rom kitchen.
Go to “advanced options” and select deodex files.
IN THIS SCREEN SELECT THE OPTION "v" TO SET API.
SET API TO "16" as we are deodexing 4.1.2 firmware. (THANKS BOB AGAIN)
Then Deodex both app and framework folders.
Android kitchen will do the rest automatically. It will take a few minutes to complete.
6. After that go to
C:\cygwin\home\****\kitchen\WORKING_deodex\META-INF\com\google\android and open the updater script with notepad++.
In this file check if all the “.apk” files in preload partition are symlinked. Otherwise just add following line with the apk name from preload.
For example if there is Gmail.apk inside preload, then to symlink it write :-
symlink("/preload/symlink/system/app/Gmail.apk", "/system/app/Gmail.apk");
7. Now select the option to create a rom from working folder and select interactive mode.
It will first zipalign rom, compress it and sign the zip file.
Then transfer it to your sdcard and flash the file.
8. You can also push the files via adb
If you face any problem report it…………
Save @Agadoo’s data plan……
Reserved
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
bobfrantic said:
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
View attachment 2087910
Click to expand...
Click to collapse
Wait, the gcc4 has become obsolete. Wait till i update the post. thanks for reporting.
EDIT:- In the screenshot you posted, untick the hide obsolete packages and then search for gcc4. But it wont be under devel, it will be under obsolete package. (remember that)
bobfrantic said:
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
View attachment 2087910
Click to expand...
Click to collapse
Updated 1st post. See the steps again.
Deodex working ok, but with the SecEmail there is a problem and can't deodex that. So haven't been able to go further than deodexing so far.
Error occured while disassembling class Lcom.android.email.activity.setup.AccountSettingsHtmlSignatureFragment; - skipping class
java.lang.RuntimeException: regCount does not match the number of arguments of the method
at org.jf.dexlib.Code.Format.Instruction35c.checkItem(Instruction35c.java:160)
at org.jf.dexlib.Code.Format.Instruction35c.<init>(Instruction35c.java:69)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3681)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1106)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:294)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
Assembling into classes.dex ...
java -Xmx512m -jar smali.jar -a 17 -o classes.dex out
out\com\android\email\activity\MessageCompose.smali[0,-1] no viable alternative at input '<EOF>'
out\com\android\email\activity\setup\AccountSettingsHtmlSignatureFragment.smali[0,-1] no viable alternative at input '<EOF>'
WARNING: Unable to produce classes.dex!
that's where I am at so far
Ok not able to deodex. Tried moving SecEmail files from preload to apps. Spent enough time today so will try another day. Your guide is most appreciated. This problem is the result of something else going on.
Sent from my GT-I9070 using xda app-developers app
bobfrantic said:
Ok not able to deodex. Tried moving SecEmail files from preload to apps. Spent enough time today so will try another day. Your guide is most appreciated. This problem is the result of something else going on.
Sent from my GT-I9070 using xda app-developers app
Click to expand...
Click to collapse
bobfrantic said:
Deodex working ok, but with the SecEmail there is a problem and can't deodex that. So haven't been able to go further than deodexing so far.
Error occured while disassembling class Lcom.android.email.activity.setup.AccountSettingsHtmlSignatureFragment; - skipping class
java.lang.RuntimeException: regCount does not match the number of arguments of the method
at org.jf.dexlib.Code.Format.Instruction35c.checkItem(Instruction35c.java:160)
at org.jf.dexlib.Code.Format.Instruction35c.(Instruction35c.java:69)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3681)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1106)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:294)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
Assembling into classes.dex ...
java -Xmx512m -jar smali.jar -a 17 -o classes.dex out
out\com\android\email\activity\MessageCompose.smali[0,-1] no viable alternative at input ''
out\com\android\email\activity\setup\AccountSettingsHtmlSignatureFragment.smali[0,-1] no viable alternative at input ''
WARNING: Unable to produce classes.dex!
that's where I am at so far
Click to expand...
Click to collapse
I AM EXTREMELY SORRY. I FORGOT ONE IMPORTANT THING. IN THIS SCREEN SELECT THE OPTION "v" TO SET API.
SET API TO "16".
THEN TRY TO DEODEX.
anantttt said:
I AM EXTREMELY SORRY. I FORGOT ONE IMPORTANT THING. IN THIS SCREEN AFTER SELECT THE OPTION "v" TO SET API.
SET API TO "16".
THEN TRY TO DEODEX.
Click to expand...
Click to collapse
That was gonna be my next question. I saw something in the build.prop saying sdk 16 so wondered. thanks for the info. guess you will update things.
bobfrantic said:
That was gonna be my next question. I saw something in the build.prop saying sdk 16 so wondered. thanks for the info. guess you will update things.
Click to expand...
Click to collapse
Already updated. See OP.
It worked. will finish rest tomorrow but deoxed fine.
Sent from my GT-I9070 using xda app-developers app
Oh that is great!!! So I think the guide is complete now.
Tell me if the updater script is working properly.
Finished. Made the deodexed zip, followed the prompts in kitchen. Zipaligned, checked the update-script all was good. Signed zip took a bit of time, renamed it and put into my sd card. Started from scratch on phone with fresh install of XXLQG firmware, installed cocafe's 6.8 kernel/cwm, installed my deodexed firmware zip and phone rebooted fine and is deodexed. Preload, symlinks, apps, framework all are correct. Thanks for the guide and I can't think of anything else to add other than be patient, some steps take a while.
$ echo"PATH=cygdrive/c/Program\Files/Java/jre7/bin:\${PATH}">>.bash_profile
cygwin warning:
MS-DOS style path detected: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}
Preferred POSIX equivalent is: echoPATH=cygdrive/c/Program/Files/Java/jre7/bin:${PATH}
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
-bash: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}: No such file or directory
when I try to put the address of java appears the inscription above, and when I go into the kitchen and I type. / menu says that java is not installed.
what am I missing?
lobotwister said:
$ echo"PATH=cygdrive/c/Program\Files/Java/jre7/bin:\${PATH}">>.bash_profile
cygwin warning:
MS-DOS style path detected: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}
Preferred POSIX equivalent is: echoPATH=cygdrive/c/Program/Files/Java/jre7/bin:${PATH}
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
-bash: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}: No such file or directory
when I try to put the address of java appears the inscription above, and when I go into the kitchen and I type. / menu says that java is not installed.
what am I missing?
Click to expand...
Click to collapse
Do you have java installed?????
If not install the latest version of java and then try this command.
bobfrantic said:
Finished. Made the deodexed zip, followed the prompts in kitchen. Zipaligned, checked the update-script all was good. Signed zip took a bit of time, renamed it and put into my sd card. Started from scratch on phone with fresh install of XXLQG firmware, installed cocafe's 6.8 kernel/cwm, installed my deodexed firmware zip and phone rebooted fine and is deodexed. Preload, symlinks, apps, framework all are correct. Thanks for the guide and I can't think of anything else to add other than be patient, some steps take a while.
Click to expand...
Click to collapse
Well yes. Signing takes a bit of time. You can skip signing if you want.
Now, one more question. Totally off topic
Will you challenge Agadoo, in uploading the deodexed firmware.
anantttt said:
Well yes. Signing takes a bit of time. You can skip signing if you want.
Now, one more question. Totally off topic
Will you challenge Agadoo, in uploading the deodexed firmware.
Click to expand...
Click to collapse
Actually I have pretty well every deodexed firmware on my puter. I was thinking of starting a thread with all in one location instead of how it is now with them spread all over the place LOL. Whatcha think? Good idea or not...
bobfrantic said:
Actually I have pretty well every deodexed firmware on my puter. I was thinking of starting a thread with all in one location instead of how it is now with them spread all over the place LOL. Whatcha think? Good idea or not...
Click to expand...
Click to collapse
Good idea. But frapeti already has a thread in the dev forum.
And one more thing, after deodexing in the build.prop add these lines. Saw it in frapeti's thread.
LINK--- http://forum.xda-developers.com/showthread.php?t=1437799
anantttt said:
Do you have java installed?????
If not install the latest version of java and then try this command.
Click to expand...
Click to collapse
I do have java installed, but I can not make the program recognize the path to the folder of it, with all methods we have deodex forum I always have this problem with java, I do not know what else to do, just will not.
Uploaded with ImageShack.us

[GUIDE] How to enable adb backup for any app changing android:allowBackup

Some applications can't be backed up by adb backup because the option is disabled on the AndroidManifest.xml of the apk. To workaround this, it is required to set android:allowBackup to true in the AndroidManifest.xml.
The application I will be patching is Signal Private Messenger, which by default doesn't allow adb backups (security reasons, I guess). Also, it's an open source application:
Signal Private Messenger (Play Store)
Signal Private Messenger (GitHub)
CHECKING FLAG_ALLOW_BACKUP
The first step is to check if the flag FLAG_ALLOW_BACKUP is present. It can be done several ways, but the easiest one is to use System Info for Android or System Info Pro for Android to check the flags of any desired application. Of course using Windows or Linux you can use script to auto-check for any number of apks.
You will see that in the app "Signal Private Messenger" the flag is missing with the official version:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Analyst also displays FLAGS per app. In this screenshot you can see Signal already patched:
APK EASY TOOL (WINDOWS APPLICATION)
To decompile, compile and sign the modified apk, the APK Easy Tool is the best to go, all in one with no complication. It requires java SDK installed and "java" and "javac" to be present on your PATH:
[TOOL] APK Easy Tool v1.2 for Windows (GUI tool, friendly)
Once you've executed "APK Easy Tool v1.2.exe", go to Options and configure "Decompiled directory" and "Compiled directory". You can just hit "Setup directories for me" and the folders will be set automatically to default locations:
Then go to the main tab of the program and leave checked "Sign APK after compile". Hit "Select" on "APK File to work on" and Decompile:
Now on your "Decompiled APKs" folder (you can use directly the button on the main windows of the program), open the file AndroidManifest.xml with a text editor. Notepad++ is highly recommended.
Then replace
android:allowBackup="false"
with
android:allowBackup="true"
After that, save the file and close the text editor. Now go back to APK Easy Tool and hit Compile to build the modified version of Signal Private Messenger. It will be present on the "Compiled directory".
APK EDITOR PRO (ANDROID APPLICATION)
APK Editor Pro is the way to go if you want to edit the file directly on the smartphone. First, you need to get the Signal apk from the smartphone, with some app like APK Extractor Pro.
Open the extracted Signal apk with the apk editor and edit the AndroidManifest.xml. Save and it will automatically compile and sign the new version.
Note that APK Editor Pro is very prone to errors, so it's highly recommender to use the APK Easy Tool instead. Just try and error.
REINSTALL APP
To install on android the patched apk, you must first uninstall your previous version, and this is because the key used to sign the apk is different. If you try to install one app itself with a different signing key, you will get this error: [INSTALL_FAILED_ALREADY_EXISTS]
Now you can see that FLAG_ALLOW_BACKUP is present:
There are some things to have in mind when using apks signed with unofficial keys:
The app will no be updated anymore automatically from Google Play Store or any other store, because you are using a custom key. You must surveil periodically the store where you get the updates, download the newer apk, patch it and update it. The developer may or may not modify flags with future updates.
You can uninstall the patched app at any time to reinstall the official one from Play Store, but you will lose app's data if you don't perform a valid backup before.
Signing keys have an expiration date. The one used by APK Easy Tool is valid for a lot of years so shouldn't be a worry.
The apks generated by APK Easy Tool are not zipaligned, but they will work perfectly the same. The only difference is that they will consum a little more of RAM.
If you modify several apks, it's better to use the same signing key for ease of updating.
OTHER METHODS AND LINKS
There are a lot of methods to decompile, edit, recompile, sign and zipalign apks. I will provide some useful links with other software and development information:
https://developer.android.com/studio/command-line/zipalign.html
http://stackoverflow.com/questions/19543520/zipalign-verification
http://stackoverflow.com/questions/8300822/android-how-to-find-which-platform-version-an-apk-targets
https://github.com/WhisperSystems/Signal-Android/wiki/How-to-build-Signal-from-the-sources
https://shatter-box.com/knowledgebase/android-apk-signing-tool-apk-signer/
[IDE][3.x] APK Studio - IDE for Reverse Engineering Android APKs
Decompile, Edit, and Recompile in One Tool with APK Studio
Idea: Hook "android:allowBackup" in AndroidManifest.xml
[XPOSED][MOD] Backup All Apps
[INDEX] Xposed Modules Collection | Post Modules' Requests Here!
ADB Backup and Restore not all it's cracked up to be.
Is there a version of APK Easy Tool for Mac OS? Thanks!
backup of apps fails despite android: allowBackup="true"
I tried to backup some apps using following ADB-Command:
adb backup -apk -obb -noshared apk.package.name -f C:\Destination\Folder\package_backup.ab
But it didn't work for all my apps.
I started searching for an explanation and a solution for my Problem. Then I found your guide and followed the instructions.
But when I decompiled some of these apps I wasn't able to create a backup, I recognized that some of them had the flag android:allowBackup="true"
Here are a few of these apps (just to name a few):
» app.WTInfoTech.WorldAroundMeLite.apk
» appplus.mobi.lockdownpro.apk
» cn.wps.moffice_eng.apk
» color.dev.com.pink
In reality, there are far more apps than just four.
There are certainly around 40-50 apps that can not be backed up using ADB (even though they have the appropriate flag in the AndroidManifest.xml)
I am using the latest Plattform Tools for Windows (r28.0.1) downloaded from here
Can someone explain to me, why I cannot backup these apps? Even if they have the android:allowBackup="true" flag?
Am I doing something wrong? Or is there some kind of a magic trick that I don't know?
I would be very happy if someone could help me with this problem.
I've been having this problem as well. I noticed that not all apps are backed up using the all flag etc.
I think it boils down to if the app uses a backup agent. Looking at the logcat when attempting to backup ConnectBot using the command adb -apk -obb -f backup.ab org.connectbot It said connect bot is Key-Value and just silently skips it. When using the command adb -apk -obb -keyvalue -f backup.ab org.connectbot It will actually backup some data, but it will not backup the apk.
I don't really have a solution just wanted to share some observations.
Praetoriani said:
I tried to backup some apps using following ADB-Command:
adb backup -apk -obb -noshared apk.package.name -f C:\Destination\Folder\package_backup.ab
But it didn't work for all my apps.
I started searching for an explanation and a solution for my Problem. Then I found your guide and followed the instructions.
But when I decompiled some of these apps I wasn't able to create a backup, I recognized that some of them had the flag android:allowBackup="true"
Here are a few of these apps (just to name a few):
» app.WTInfoTech.WorldAroundMeLite.apk
» appplus.mobi.lockdownpro.apk
» cn.wps.moffice_eng.apk
» color.dev.com.pink
In reality, there are far more apps than just four.
There are certainly around 40-50 apps that can not be backed up using ADB (even though they have the appropriate flag in the AndroidManifest.xml)
I am using the latest Plattform Tools for Windows (r28.0.1) downloaded from here
Can someone explain to me, why I cannot backup these apps? Even if they have the android:allowBackup="true" flag?
Am I doing something wrong? Or is there some kind of a magic trick that I don't know?
I would be very happy if someone could help me with this problem.
Click to expand...
Click to collapse
@dazoe
THX for sharing your knowledge :good:
I'm going to check my logcat as well for these apps adb does not back up
I can give you a short guide on how to extract/backup an apk of a specific package:
1) If you don't know the package-name, you can create a list of all installed packages (sorted in alphabetical prder without app names)
adb shell pm list packages -f | sed -e 's/.*=//' | sort
2) Now look for the desired app you want to extract/backup the apk from. Then run following command:
adb shell pm path com.example.someapp
You will get an output which will look something like the following:
package:/data/app/com.example.someapp-1/base.apk
3) With this information you can simply perform a pull-command like the following:
adb pull -a -p /data/app/com.example.someapp-1/base.apk C\LOCAL\PATH\TO\YOUR\BACKUP\com.example.someapp-1/base.apk
Hope that I could help you with this little guide
I patched the apk I want to backup, but before I uninstall the original and install the patched, are there any other methods that will allow me to restore my original appdata? Since uninstalling the original will remove that appdata. I'm not rooted.
so whats the point if you have to uninstall the app and reinstall using the new apk? itll wipe the data of the app you're trying to back up
is there any way to do this without wiping?
.
lebigmac said:
I ran all of the commands below to uninstall the app in question while keeping my data which I want to backup:
Code:
adb shell pm uninstall -k --user 0 my.app.name
adb shell pm uninstall -k my.app.name
adb shell cmd package uninstall -k my.app.name
adb uninstall -k my.app.name
These commands probably all call the same procedure under the hood but I just wanted to make sure the app really gets uninstalled. So either one of these commands should do the job.
I guess that part worked and it actually preserved most of my private data.
Now the problem:
When I try to reinstall the modded .apk file I get this error:
Code:
adb: failed to install gen_signed.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package my.app.name signatures do not match the previously installed version; ignoring!]
Click to expand...
Click to collapse
You can only reinstall app with same signature, if there is some data left. If you uninstall totally, you can install with different signature (but you lose data). If you need to get the data you can try to root without formatting.
.
lebigmac said:
Hi @scandiun
How can I root stock HTC U11+ running Oreo without formatting internal storage?
As soon as I unlock the bootloader all data gets wiped!?
I need to backup some important app data before I can unlock bootloader and then install TWRP/Magisk.
As you can see I am in a dilemma. Thanks for chiming in.
Click to expand...
Click to collapse
I have no idea about that phone. Most of times, it's now possible unless there is a bug which allows to gain root access while running android. There are 4 ways that you can try:
Try some app which allows to root the phone temporarily while it's running (without the need for any bootloader unlock). For the LG G2 there was AutoRec and Towelroot.
Request HTC a special update or feature for your device (for your specific IMEI/serial number) so they allow you to update or unlock bootloader without data format.
Contact the app developer and request an update for you with android:allowBackup enabled. If the developer is still alive and is willing to do so, because you just need his signing key. Sometimes it's done by Google servers instead of the developer itself.
Wait for your device to oficially update to android 11, since that version will ignore that flag when syncing all phone data to a new phone. There you could sync to a rooted phone with LineageOS and recover the data. Request HTC to update that device
Android 11 forces apps to support local backups but not cloud backups

[ROOT] [FRAMEWORK-RES MOD] Optimize your WiFi [MARCH 2018]

Hello everyone. I am excited to announce I've found a successful method to edit the contents of the Android System, also known as framework-res. This method has allowed me to make a massive amount of modifications to the framework system, including unlocking several features and or settings Amazon blocks us from using or accessing. The guide I am writing today, is just one example of that.
I've been contacted a few times here and there, users asking if I knew how to improve their WiFi reception as some feared Amazon may be intentionally slowing down connections. Until now, I was unable to determine all of the features or settings related to WiFi, that we have been blocked from seeing/using/accessing. This guide will show you how to unlock those settings and features to improve your WiFi reception.
!!!!*****WARNING*****!!!!
Modifying the framework can be extremely damaging to your device. Making the wrong edit, even in the slightest, can result in permanent damage to your device. DO NOT MAKE ANY OTHER EDITS TO THE FRAMEWORK, OTHER THAN THE ONES OUTLINED IN THIS GUIDE. IF YOU BRICK YOUR DEVICE, OR DAMAGE IT IN ANY WAY, I CANNOT BE HELD RESPONSIBLE. If you choose to go forward from here, you are responsible for any and all actions. If you aren't prepared for the possibility you may brick your tablet, this guide is not for you. NOTE: I've NEVER permanently bricked a device, but everyone's devices are different.
I have tested this method extensively and made extensive edits to the framework. I have bricked my tablets many times, sometimes several times a day. I risked and continue to risk losing my devices to damages by bringing you these next several guides. Please thank me when you've successfully completed this guide
Requirements:
-Rooted HD 10 or Fire 7 tablet
-Desktop PC with Android SDK installed
-APKtool
-Java (APKtool requires Java)
-Notepad++ (Install this first)
-7-Zip or like minded program
-adbd Insecure application
-A lot of patience and time
Notes:
-Works really well on the HD 10. Extensively tested.
-Works on the Fire 7, but with a much lower success rate. For some reason the Fire 7 gets very irritated very quickly, more often than not.
Instructions:
1. Go to the Java website and download the two files, JDK and JRE (not the JRE server) and install them. When doing so, make sure the installation path is just inside C:\ directory NOT C:\Program Files etc. It's much easier to have all your tools in the same directory for easy access. NOTE: You won't be able to use this guide without installing Java as it's required by APKtool.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Go to the APKtool website and download the tool and required files. They will also be placed into the C:\ directory. Installation instructions are in the same place. PLEASE READ THEM VERY CAREFULLY!
3. When you've completed the above tasks, plug your tablet into your PC. On your PC, open an ADB window. You need to pull one file from your tablet, framework-res.apk and send it to the APKtool folder in C:\APKtool (assuming that's where you installed APKtool). For this guide, your file(s) MUST be pulled from your device using ADB. DO NOT manually place them into the folder(s).
Code:
adb pull /system/framework/framework-res.apk C:\APKtool
4. Once the framework apk is in the APKtool folder, open another command prompt window from the APKtool folder by holding down shift on the keyboard + right click on the mouse and select "open command window here." In this new command window type:
Code:
APKtool
If you installed everything correctly, text will appear with a few commands you can issue APKtool.
5. Now we need to decompile the framework. In APKtool command window type the following command:
Code:
apktool d framework-res.apk
6. The framework-res.apk should then decompile into a folder inside your APKtool folder. Open the framework folder and navigate to:
Code:
/res/values/
7. Open the bools.xml file by right clicking on it and selecting Notepad++ as the editor. At this point quite a bit of code, or configurations will appear. Please look for the list of items below and change the values of them from 'false' to 'true':
Code:
"config_wifi_dual_band_support"
"config_wifi_background_scan_support"
"config_wifi_enable_disconnection_debounce"
"config_wifi_enable_5GHz_preference"
"config_wifi_framework_enable_associated_autojoin_scan"
"config_wifi_framework_enable_associated_network_selection"
"config_wifi_only_link_same_credential_configurations"
"config_wifi_batched_scan_supported"
"config_wimaxEnabled"
8. Now save the file and close Notepad++. Back in the framework folder, open the arrays.xml file. Look for the following line of code:
Code:
<string-array name="networkAttributes">
<item>wifi,1,1,2,-1,true</item>
<item>tedongle,49,49,1,-1,true</item>
9. In the first line above, wifi,1,1,2,-1,true, change the '2' to a '1'. Delete the second line completely, but leave the 'item' tags. Replace it with the following line of code:
Code:
<item>wifi_p2p,13,1,0,-1,true</item>
I have personally marked each of these configurations as true to test battery drainage, and there was very little if any at all. Though the configuration for "background" scanning is enabled, I don't believe it's the same background scanning like the aggressive ones manufacturers and providers place in the general WiFi settings.
10. Save the files and close them. Head back to the APKtool folder and open the command window again, if you closed it. Type the following command:
Code:
apktool b framework-res
11. You might see a few errors, but they can be ignored as long as the window tells you the APK was successfully created. If it was, go to the APKtool folder, tap on the framework-res folder, then tap on the 'dist' folder. Your new framework is inside. Right click on the NEW framework-res.apk and select "open archive." Go back to the main APKtool folder and right click on the ORIGINAL framework-res.apk and open it as an archive too.
12. Drag the 'res' folder from the newly generated APK to the old APK. If using 7-Zip, just click ok when the window pops up. Now do the same for the resources.arsc file and if usong 7-Zip, just select ok. If using WinRAR, you have to set the compression to STORE before you click ok.
13. Place the framework-res.apk you just dragged those files to, into your adb folder on your PC and plug your tablet into it. Download and install adbd insecure and check the box to make adbd insecure. Now open an ADB window. It's time to install the framework. In two commands, you'll be done. First type:
Code:
adb remount
adb push framework-res.apk /system/framework/framework-res.apk
After you installed the framework, if you don't go into a bootloop within 10 seconds or less, you have most likely been successful, but you still have to reboot. Once you do, You'll notice a new toggle in your advanced WiFi settings. For an added bonus, you can edit your build.prop to specify the range of WiFi channels in your country. If in the US, you will add the number '11' and if in Europe and Asia, you want to put a 13 or 14.
Code:
ro.wifi.channels=11
OR
Code:
ro.wifi.channels=13
Keep an eye on me the for the next week or more. I have a lot more goodies to share, and I keep finding more
DragonFire1024 said:
Hello everyone. I am excited to announce I've found a successful method to edit the contents of the Android System, also known as framework-res. This method has allowed me to make a massive amount of modifications to the framework system, including unlocking several features and or settings Amazon blocks us from using or accessing. The guide I am writing today, is just one example of that.
I've been contacted a few times here and there, users asking if I knew how to improve their WiFi reception as some feared Amazon may be intentionally slowing down connections. Until now, I was unable to determine all of the features or settings related to WiFi, that we have been blocked from seeing/using/accessing. This guide will show you how to unlock those settings and features to improve your WiFi reception.
!!!!*****WARNING*****!!!!
Modifying the framework can be extremely damaging to your device. Making the wrong edit, even in the slightest, can result in permanent damage to your device. DO NOT MAKE ANY OTHER EDITS TO THE FRAMEWORK, OTHER THAN THE ONES OUTLINED IN THIS GUIDE. IF YOU BRICK YOUR DEVICE, OR DAMAGE IT IN ANY WAY, I CANNOT BE HELD RESPONSIBLE. If you choose to go forward from here, you are responsible for any and all actions. If you aren't prepared for the possibility you may brick your tablet, this guide is not for you. NOTE: I've NEVER permanently bricked a device, but everyone's devices are different.
I have tested this method extensively and made extensive edits to the framework. I have bricked my tablets many times, sometimes several times a day. I risked and continue to risk losing my devices to damages by bringing you these next several guides. Please thank me when you've successfully completed this guide
Requirements:
-Rooted HD 10 or Fire 7 tablet
-Desktop PC with Android SDK installed
-APKtool
-Java (APKtool requires Java)
-Notepad++ (Install this first)
-7-Zip or like minded program
-A lot of patience and time
Notes:
-Works really well on the HD 10. Extensively tested.
-Works on the Fire 7, but with a much lower success rate. For some reason the Fire 7 gets very irritated very quickly, more often than not.
Instructions:
1. Go to the Java website and download the two files, JDK and JRE (not the JRE server) and install them. When doing so, make sure the installation path is just inside C:\ directory NOT C:\Program Files etc. It's much easier to have all your tools in the same directory for easy access. NOTE: You won't be able to use this guide without installing Java as it's required by APKtool.
2. Go to the APKtool website and download the tool and required files. They will also be placed into the C:\ directory. Installation instructions are in the same place. PLEASE READ THEM VERY CAREFULLY!
3. When you've completed the above tasks, plug your tablet into your PC. On your PC, open an ADB window. You need to pull one file from your tablet, framework-res.apk and send it to the APKtool folder in C:\APKtool (assuming that's where you installed APKtool). For this guide, your file(s) MUST be pulled from your device using ADB. DO NOT manually place them into the folder(s).
Code:
adb pull /system/framework/framework-res.apk C:\APKtool
4. Once the framework apk is in the APKtool folder, open another command prompt window from the APKtool folder by holding down shift on the keyboard + right click on the mouse and select "open command window here." In this new command window type:
Code:
APKtool
If you installed everything correctly, text will appear with a few commands you can issue APKtool.
5. Now we need to decompile the framework. In APKtool command window type the following command:
Code:
apktool d framework-res.apk
6. The framework-res.apk should then decompile into a folder inside your APKtool folder. Open the framework folder and navigate to:
Code:
/res/values/
7. Open the bools.xml file by right clicking on it and selecting Notepad++ as the editor. At this point quite a bit of code, or configurations will appear. Please look for the list of items below and change the values of them from 'false' to 'true':
Code:
"config_wifi_dual_band_support"
"config_wifi_background_scan_support"
"config_wifi_enable_disconnection_debounce"
"config_wifi_enable_5GHz_preference"
"config_wifi_framework_enable_associated_autojoin_scan"
"config_wifi_framework_enable_associated_network_selection"
"config_wifi_only_link_same_credential_configurations"
"config_wifi_batched_scan_supported"
"config_wimaxEnabled"
8. Now save the file and close Notepad++. Back in the framework folder, open the arrays.xml file. Look for the following line of code:
Code:
<string-array name="networkAttributes">
<item>wifi,1,1,2,-1,true</item>
<item>tedongle,49,49,1,-1,true</item>
9. In the first line above, wifi,1,1,2,-1,true, change the '2' to a '1'. Delete the second line completely, but leave the 'item' tags. Replace it with the following line of code:
Code:
<item>wifi_p2p,13,1,0,-1,true</item>
I have personally marked each of these configurations as true to test battery drainage, and there was very little if any at all. Though the configuration for "background" scanning is enabled, I don't believe it's the same background scanning like the aggressive ones manufacturers and providers place in the general WiFi settings.
10. Save the files and close them. Head back to the APKtool folder and open the command window again, if you closed it. Type the following command:
Code:
apktool b framework-res
11. You might see a few errors, but they can be ignored as long as the window tells you the APK was successfully created. If it was, go to the APKtool folder, tap on the framework-res folder, then tap on the 'dist' folder. Your new framework is inside. Right click on the NEW framework-res.apk and select "open archive." Go back to the main APKtool folder and right click on the ORIGINAL framework-res.apk and open it as an archive too.
12. Drag the 'res' folder from the newly generated APK to the old APK. If using 7-Zip, just click ok when the window pops up. Now do the same for the resources.arsc file and if usong 7-Zip, just select ok. If using WinRAR, you have to set the compression to STORE before you click ok.
13. Now open an ADB window. It's time to install the framework. In two commands, you'll be done. First type:
Code:
adb remount
adb push C:\apktool\framework-res.apk /system/framework/framework-res.apk
After you installed the framework, if you don't go into a bootloop within 10 seconds or less, you have most likely been successful, but you still have to reboot. Once you do, You'll notice a new toggle in your advanced WiFi settings. For an added bonus, you can edit your build.prop to specify the range of WiFi channels in your country. If in the US, you will add the number '11' and if in Europe and Asia, you want to put a 13 or 14.
Code:
ro.wifi.channels=11
OR
Code:
ro.wifi.channels=13
Keep an eye on me the for the next week or more. I have a lot more goodies to share, and I keep finding more
Click to expand...
Click to collapse
Would it be possible for you to post your modified framework-res file so those of us less skilled could just push your tested and working file. I would assume you will need a version for each OS aka one for 5600, 5601 and 5610
adm1jtg said:
Would it be possible for you to post your modified framework-res file so those of us less skilled could just push your tested and working file. I would assume you will need a version for each OS aka one for 5600, 5601 and 5610
Click to expand...
Click to collapse
I'm not so sure that a framework-res.apk from one tablet is good for another, but there's no reason that it wouldn't work.
I experience a lot of wifi issues on the 7th Gen HD 10, but I'm not sure if messing with the framework is worth the risk...
I can tell that the 5GHz range of the tablet is extremely bad, I basically have to be in the ssame room where my router is
and that 2.4GHz is sometimes very slow, while it works fine on my phone
adm1jtg said:
4. Once the framework apk is in the APKtool folder, open another command prompt window from the APKtool folder by holding down shift on the keyboard + right click on the mouse and select "open command window here." In this new command window type:
If you installed everything correctly, text will appear with a few commands you can issue APKtool.
5. Now we need to decompile the framework. In APKtool command window type the following command:
6. The framework-res.apk should then decompile into a folder inside your APKtool folder. Open the framework folder and navigate to:
7. Open the bools.xml file by right clicking on it and selecting Notepad++ as the editor. At this point quite a bit of code, or configurations will appear. Please look for the list of items below and change the values of them from 'false' to 'true':
8. Now save the file and close Notepad++. Back in the framework folder, open the arrays.xml file. Look for the following line of code:
9. In the first line above, wifi,1,1,2,-1,true, change the '2' to a '1'. Delete the second line completely, but leave the 'item' tags. Replace it with the following line of code:
I have personally marked each of these configurations as true to test battery drainage, and there was very little if any at all. Though the configuration for "background" scanning is enabled, I don't believe it's the same background scanning like the aggressive ones manufacturers and providers place in the general WiFi settings.
10. Save the files and close them. Head back to the APKtool folder and open the command window again, if you closed it. Type the following command:
11. You might see a few errors, but they can be ignored as long as the window tells you the APK was successfully created. If it was, go to the APKtool folder, tap on the framework-res folder, then tap on the 'dist' folder. Your new framework is inside. Right click on the NEW framework-res.apk and select "open archive." Go back to the main APKtool folder and right click on the ORIGINAL framework-res.apk and open it as an archive too.
12. Drag the 'res' folder from the newly generated APK to the old APK. If using 7-Zip, just click ok when the window pops up. Now do the same for the resources.arsc file and if usong 7-Zip, just select ok. If using WinRAR, you have to set the compression to STORE before you click ok.
13. Now open an ADB window. It's time to install the framework. In two commands, you'll be done. First type:
After you installed the framework, if you don't go into a bootloop within 10 seconds or less, you have most likely been successful, but you still have to reboot. Once you do, You'll notice a new toggle in your advanced WiFi settings. For an added bonus, you can edit your build.prop to specify the range of WiFi channels in your country. If in the US, you will add the number '11' and if in Europe and Asia, you want to put a 13 or 14.
OR
Keep an eye on me the for the next week or more. I have a lot more goodies to share, and I keep finding more
Would it be possible for you to post your modified framework-res file so those of us less skilled could just push your tested and working file. I would assume you will need a version for each OS aka one for 5600, 5601 and 5610
Click to expand...
Click to collapse
I can yes. But be aware if you aren't on the same version 5.6.0.1, then just reinstalling that APK may not work. I'm not entirely sure if the framework APK relies on version specific settings or not. In which case the worst that could happen is when you go to reboot you would be stuck at the boot logo and you would need to reflash stock firmware. I'll do upload it when I get home from work later.
Sent from my Samsung Galaxy S4 using XDA Labs
I'm posting the framework now. There are other tweaks as well, I just don't remember some. You can toggle the Wi-Fi GHZ in advanced Wi-Fi settings. I warn you though, this may not work. I've not tested this method so I'm not responsible for any bricks!
Sent from my Amazon KFSUWI using XDA Labs
freaky2xd said:
I experience a lot of wifi issues on the 7th Gen HD 10, but I'm not sure if messing with the framework is worth the risk...
I can tell that the 5GHz range of the tablet is extremely bad, I basically have to be in the ssame room where my router is
and that 2.4GHz is sometimes very slow, while it works fine on my phone
Click to expand...
Click to collapse
Posted above this reply. I can make a special modification for you later. As of now the setting is set to a 5ghz preference. I can change that later and I'll upload the revised framework this afternoon.
Sent from my Amazon KFSUWI using XDA Labs
adm1jtg said:
Hello everyone. I am excited to announce I've found a successful method to edit the contents of the Android System, also known as framework-res. This method has allowed me to make a massive amount of modifications to the framework system, including unlocking several features and or settings Amazon blocks us from using or accessing. The guide I am writing today, is just one example of that.
I've been contacted a few times here and there, users asking if I knew how to improve their WiFi reception as some feared Amazon may be intentionally slowing down connections. Until now, I was unable to determine all of the features or settings related to WiFi, that we have been blocked from seeing/using/accessing. This guide will show you how to unlock those settings and features to improve your WiFi reception.
!!!!*****WARNING*****!!!!
Modifying the framework can be extremely damaging to your device. Making the wrong edit, even in the slightest, can result in permanent damage to your device. DO NOT MAKE ANY OTHER EDITS TO THE FRAMEWORK, OTHER THAN THE ONES OUTLINED IN THIS GUIDE. IF YOU BRICK YOUR DEVICE, OR DAMAGE IT IN ANY WAY, I CANNOT BE HELD RESPONSIBLE. If you choose to go forward from here, you are responsible for any and all actions. If you aren't prepared for the possibility you may brick your tablet, this guide is not for you. NOTE: I've NEVER permanently bricked a device, but everyone's devices are different.
I have tested this method extensively and made extensive edits to the framework. I have bricked my tablets many times, sometimes several times a day. I risked and continue to risk losing my devices to damages by bringing you these next several guides. Please thank me when you've successfully completed this guide
Requirements:
-Rooted HD 10 or Fire 7 tablet
-Desktop PC with Android SDK installed
-APKtool
-Java (APKtool requires Java)
-Notepad++ (Install this first)
-7-Zip or like minded program
-A lot of patience and time
Notes:
-Works really well on the HD 10. Extensively tested.
-Works on the Fire 7, but with a much lower success rate. For some reason the Fire 7 gets very irritated very quickly, more often than not.
Instructions:
1. Go to the Java website and download the two files, JDK and JRE (not the JRE server) and install them. When doing so, make sure the installation path is just inside C: directory NOT C:\Program Files etc. It's much easier to have all your tools in the same directory for easy access. NOTE: You won't be able to use this guide without installing Java as it's required by APKtool.
2. Go to the APKtool website and download the tool and required files. They will also be placed into the C: directory. Installation instructions are in the same place. PLEASE READ THEM VERY CAREFULLY!
3. When you've completed the above tasks, plug your tablet into your PC. On your PC, open an ADB window. You need to pull one file from your tablet, framework-res.apk and send it to the APKtool folder in C:\APKtool (assuming that's where you installed APKtool). For this guide, your file(s) MUST be pulled from your device using ADB. DO NOT manually place them into the folder(s).
4. Once the framework apk is in the APKtool folder, open another command prompt window from the APKtool folder by holding down shift on the keyboard + right click on the mouse and select "open command window here." In this new command window type:
If you installed everything correctly, text will appear with a few commands you can issue APKtool.
5. Now we need to decompile the framework. In APKtool command window type the following command:
6. The framework-res.apk should then decompile into a folder inside your APKtool folder. Open the framework folder and navigate to:
7. Open the bools.xml file by right clicking on it and selecting Notepad++ as the editor. At this point quite a bit of code, or configurations will appear. Please look for the list of items below and change the values of them from 'false' to 'true':
8. Now save the file and close Notepad++. Back in the framework folder, open the arrays.xml file. Look for the following line of code:
9. In the first line above, wifi,1,1,2,-1,true, change the '2' to a '1'. Delete the second line completely, but leave the 'item' tags. Replace it with the following line of code:
I have personally marked each of these configurations as true to test battery drainage, and there was very little if any at all. Though the configuration for "background" scanning is enabled, I don't believe it's the same background scanning like the aggressive ones manufacturers and providers place in the general WiFi settings.
10. Save the files and close them. Head back to the APKtool folder and open the command window again, if you closed it. Type the following command:
11. You might see a few errors, but they can be ignored as long as the window tells you the APK was successfully created. If it was, go to the APKtool folder, tap on the framework-res folder, then tap on the 'dist' folder. Your new framework is inside. Right click on the NEW framework-res.apk and select "open archive." Go back to the main APKtool folder and right click on the ORIGINAL framework-res.apk and open it as an archive too.
12. Drag the 'res' folder from the newly generated APK to the old APK. If using 7-Zip, just click ok when the window pops up. Now do the same for the resources.arsc file and if usong 7-Zip, just select ok. If using WinRAR, you have to set the compression to STORE before you click ok.
13. Now open an ADB window. It's time to install the framework. In two commands, you'll be done. First type:
After you installed the framework, if you don't go into a bootloop within 10 seconds or less, you have most likely been successful, but you still have to reboot. Once you do, You'll notice a new toggle in your advanced WiFi settings. For an added bonus, you can edit your build.prop to specify the range of WiFi channels in your country. If in the US, you will add the number '11' and if in Europe and Asia, you want to put a 13 or 14.
OR
Would it be possible for you to post your modified framework-res file so those of us less skilled could just push your tested and working file. I would assume you will need a version for each OS aka one for 5600, 5601 and 5610
Click to expand...
Click to collapse
Posted. Look above this reply
Sent from my Amazon KFSUWI using XDA Labs
Thanks can't wait to try, unfortunately I won't have access to my tablet for the next 2 weeks but will definitely try first thing when I get it back.
DragonFire1024 said:
I'm posting the framework now. There are other tweaks as well, I just don't remember some. You can toggle the Wi-Fi GHZ in advanced Wi-Fi settings. I warn you though, this may not work. I've not tested this method so I'm not responsible for any bricks!
Sent from my Amazon KFSUWI using XDA Labs
Click to expand...
Click to collapse
Installed this on my tablet, it seems to have definitely fixed my issue where the tablet would stop stop loading when streaming videos. Thanks
I can't install the apk on my fire hd 10 os 5.6
endleesss said:
I can't install the apk on my fire hd 10 os 5.6
Click to expand...
Click to collapse
Are you trying to install it like a regular APK?
Sent from my Samsung Galaxy S4 using XDA Labs
In step 13, when I type 'adb remount' on adb window, it keeps showing me 'permission denied'.
I'm using os 5.6.1.0 on rooted fire hd 10 by the way.
zxcvbnm76 said:
In step 13, when I type 'adb remount' on adb window, it keeps showing me 'permission denied'.
I'm using os 5.6.1.0 on rooted fire hd 10 by the way.
Click to expand...
Click to collapse
Make sure the box is checked in adb insecure. You have to recheck the box each time you run a command, whether successful or not.
Sent from my Samsung Galaxy S4 using XDA Labs
DragonFire1024 said:
Make sure the box is checked in adb insecure. You have to recheck the box each time you run a command, whether successful or not.
Sent from my Samsung Galaxy S4 using XDA Labs
Click to expand...
Click to collapse
It worked! Thanks for your help.
@DragonFire1024 just got my hd 10 up and running with TONS of help from retyre. Currently on his 5610 img thats pre rooted and pre xposed. If you would be willing to make a 5160 framework-res for me with all your goodies I would be happy to help you test anything you like. If needed I can even upload the framework-res off my install to you for modding.
adm1jtg said:
@DragonFire1024 just got my hd 10 up and running with TONS of help from retyre. Currently on his 5610 img thats pre rooted and pre xposed. If you would be willing to make a 5160 framework-res for me with all your goodies I would be happy to help you test anything you like. If needed I can even upload the framework-res off my install to you for modding.
Click to expand...
Click to collapse
You'll likely have to send me a copy of yours to be on the safe side. There are some parts I cannot change or it gets stuck at the boot logo. If any of those are different from 5.6.0.1 to 5.6.1.0, then it would also get stuck. Send me your framework APK and I'll work on it. Almost done with the FireTabletSettings apk and then I'll overhaul my framework to include all mods instead of single mods and make it available. So my take a little time, but I'll do it
Sent from my Moto E4 using XDA Labs
DragonFire1024 said:
You'll likely have to send me a copy of yours to be on the safe side. There are some parts I cannot change or it gets stuck at the boot logo. If any of those are different from 5.6.0.1 to 5.6.1.0, then it would also get stuck. Send me your framework APK and I'll work on it. Almost done with the FireTabletSettings apk and then I'll overhaul my framework to include all mods instead of single mods and make it available. So my take a little time, but I'll do it
Sent from my Moto E4 using XDA Labs
Click to expand...
Click to collapse
https://bit.ly/2HOv0Rw (framework-res from 5.6.1.0) do you want the settings file as well? If so would it be SettingsProvider.apk you need?
Also have been toying with an idea... If I loaded RETYRE's image for system, clean, then adb pushed your settings and framework files to my system, then used flashfire for a raw system backup and posted the resulting image file, woudn't that be a good way to easily distribute your changes and his... with his and your permission to do so of course.
adm1jtg said:
https://bit.ly/2HOv0Rw (framework-res from 5.6.1.0) do you want the settings file as well? If so would it be SettingsProvider.apk you need?
Also have been toying with an idea... If I loaded RETYRE's image for system, clean, then adb pushed your settings and framework files to my system, then used flashfire for a raw system backup and posted the resulting image file, woudn't that be a good way to easily distribute your changes and his... with his and your permission to do so of course.
Click to expand...
Click to collapse
I would need FireTabletSettings.apk. I suppose it could be done like that, but I honestly don't know. You have my permission to try though. I'm almost done with Version one. I just need to do a few more things.
Sent from my Moto E4 using XDA Labs
adm1jtg said:
Also have been toying with an idea... If I loaded RETYRE's image for system, clean, then adb pushed your settings and framework files to my system, then used flashfire for a raw system backup and posted the resulting image file, woudn't that be a good way to easily distribute your changes and his... with his and your permission to do so of course.
Click to expand...
Click to collapse
While I don't have an issue with using my 5.6.1.0 image, I'm not sure merging these tweaks into the system.img and uploading a new 5.6.1.0 image would be my preferred approach. Instead, DragonFire1024 should upload his/her tweaks as a flashable .zip that one can flash with FlashFire.
Let's say you put up a modified system.img today and DragonFire1024 comes up with a couple of tweaks tomorrow. Will you create another system.img? If you have a good /system, would you want to dump an entirely new system.img just to get a few new tweaks?

[ROOT] [FRAMEWORK MOD] Enable 'Daydream' screensaver, change lock screen wallpapers!

Current as of March 29, 2018.
I've been saving this for a rainy day and it's raining at my house today I have been with XDA for about a year and a half now. I made a list of several goals I wanted to accomplish, mainly to do so without root. Though I have been successful at many tricks and hacks on these tablets WITHOUT root, sometimes, no matter how hard you try, some things can't currently be done without it. One of the goals I set was activating Android's stock Daydream screensaver. This is something that was built into Android and is a feature that is greatly underappreciated and many people just don't know it exists. It's also a feature Amazon blocks us from using. Another goal was to find a way to change the lock screen wallpapers after you got rid of Amazon Photos.
After several weeks of reading and researching, I finally discovered a working way to edit the framework and successfully install it back onto at least two of the Amazon tablets I own. In doing so I discovered how Amazon blocks the use of certain features and settings and in some cases, have been able to reverse their code and replace it with values that activate those things. As you can see in the screenshot below, the Daydream screensaver feature is installed onto the tablet. Using Activity Launcher, tap the top left pull down menu and select 'all activities. Scroll until you see the settings option and tap it. Then scroll until you see 'Daydream'. That's as far as you can go. If you tap it, the display settings is what pops up. Furthermore, if you disable or delete Amazon Photos, and you're stuck with their lock screen wallpapers for the rest of time, until now.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
In this case the settings don't redirect to another app like setting your lock screen wallpapers, which until now, required Amazon Photos to change. They simply take advantage of the framework, and block the use of the Daydream function through settings within it. That setting, among many more settings, are all allowed to be blocked and are options Android provides to manufacturers and service providers when they purchase the rights to a copy of an Android OS.
Today I am proud and very happy to announce through modding the FireOS framework on the Fire 7 and HD 10, I have successfully activated Android's stock Daydream screensaver, while at the same time, not destroying the fabric of FireOS. I have also found a way for you to once and for all, change your lock screen wallpapers WITHOUT the use of Amazon Photos.
In this TWO PART guide, I'll show you how to enable the use of the Daydream screensaver, install the 'Colors' add-on and show you how to change your lock screen wallpapers. The best part about Daydream, I have been able to track down the proper APK for Android's stock 'Colors' screensaver, also known as 'BasicDreams' and as you can see in the screenshot below, it surprisingly worked on both the Fire 7 and HD 8
The hardest part of all this, once Daydream was activated, was finding the proper APK to get this working. It took me about a week or more to track down the closest version of the 'BasicDreams' APK for our version of Lollipop and I provide it to you today as well. Follow the guide below on how to get Daydream activated and in part two, learn how to change your lock screen wallpapers WITHOUT the use of Amazon Photos.
*****WARNING*****
Editing or modifying the system framework can be very damaging to your device. I have spent an extensive amount of time studying it and ways to edit it. I am writing this guide now because I believe this method is the safest way to edit the framework without damaging your tablet. With that said, your results might not be the same. As such, from this point forward in this guide, I cannot be responsible for any damage that may occur to your device. Please only continue if 1) You are willing to risk a possible brick 2) If you are willing to flash back to the last version of FireOS that your tablet was on in case a brick does occur.
Part 1: Enable 'Daydream' Screensaver
Requirements:
- Rooted Amazon Fire 7 or HD 10.
- Windows PC with ADB installed.
- APKtool (Please note you need to install Java version 7 or greater in order to use APKtool).
- 7-Zip
- Proper 'BasicDreams' screensaver APK, provided at the bottom of this post.
- Notepad++
- ADB insecure
- Patience.
Instructions:
1. On your PC, Download and install 7-Zip, Java (INSTALL JAVA BEFORE YOU INSTALL APKTOOL!!), APKtool and Notepad++ and ADB Insecure, if you haven't done so already, from the links provided above. Download links and install instructions for APKtool can be found here. On your Fire 7 or HD 10, download and install ADB insecure from the link provided above. For APKtool, I recommend you create a folder named 'apktool' in your C:\ directory, as seen in the screenshot below:
2. Once you've installed those two things, plug your tablet into your PC and make sure you have ADB debugging enabled in developer options. (Tap settings, device options, tap serial number 7 times, tap developer opeions and enable ADB). Open an ADB window. We need to get a copy of your framework package by typing the command below into your ADB window and pressing enter. This command assumes you installed APKtool into your C:\ directory:
Code:
adb pull /system/framework/framework-res.apk C:\apktool
3. Now on your PC, you need to navigate to your APKtool folder in C:\. When the window opens, open a command window by holding down shift and right clicking on the APKtool folder window and select 'open command window here'. An example of how that command window would look is posted below:
4. Now we need to install the framework APK into APKtool so it's able to decompile it. In the APKtool command window, type the following command:
Code:
apktool if framework-res.apk
5. Time to decompile the framework so we can look inside of it and make ONLY one edit. Yes that's all it takes is one edit. Amazon only blocks out the Daydream screensaver by using one word. Type the following command in the APKtool window to decompile the framework APK:
Code:
apktool d framework-res.apk
6. Now go back to your APKtool folder on your PC. Another folder should have been created inside the APKtool folder. The folder will be called 'framework-res'. Open up the folder and double click the RES folder. Scroll down until you see the folder named 'values' and double click it. You then should then see a list of XML files, like in the screen shot posted below:
7. Right click on the file named 'bools.xml' and select 'Open with Notepad++'. Slowly scroll the page and look for the configuration setting as seen below. On my Fire 7 the configuration is on line 98:
Code:
<bool name="config_dreamsSupported">false</bool>
8. In the configuration it will say 'false'. Change it to 'true' (no quotation marks) so it looks like this:
Code:
<bool name="config_dreamsSupported">[B]true[/B]</bool>
9. Then save the file by clicking on the floppy disc icon at the top left of Notepad++. DO NOT MAKE ANY OTHER EDITS!! You can now close Notepad++ and open the command window for APKtool again. We have to recompile the framework. Do that by typing the following command into the APKtool command window:
Code:
apktool b framework-res
10. You might get an error or three as the APK recompiles. As long as APKtool builds the APK, ignore the errors. If any pop up during the rebuild process, at most there will be 3 that will say something about an 'ellipsis' and time formatting. They don't mean anything as far as I can tell. If there are more errors which are fatal for the framework APK building, APKtool will not complete the build process. If the build process successful, move onto the next step. Otherwise please repeat the process from step two and make sure you don't edit anything else.
11. Back on your PC, bring up the APKtool folder again. Open the 'framework-res' folder. A few new folders have been created by APKtool. The only one you need to worry about is 'dist'. Double click that folder. This is where APKtool puts rebuilt APKs. Right click on the 'framework-res.apk' file and choose '7-Zip' and 'open archive'. DO NOT CHOOSE UNZIP!!! (Unzipping or decompiling the APK improperly will result in undesirable consequences when you install it back on your tablet.)
12. A 7-Zip window will open up listing a few files. You can make it a little smaller and move it out of the way, but don't minimize it. Back at the APKtool folder (you should still be inside the dist folder), click the back or arrow up button until you are back in the main APKtool folder. Right click your OLD framework-res.apk file and select 7-Zip and 'open archive'. Again do NOT unzip or decompile the APK. You can make the 7-Zip window that opens, smaller if you like, but now make sure the two 7-zip windows are side by side, noting which one is the OLD and which is the NEW archive (the one with 'dist' in the directory is the NEW APK. See below):
13. Highlight the 'res' folder in the 7-Zip window containing the NEW archive. Now drag the 'res' folder from the new archive into the 7-Zip window containing the OLD archive. A window will appear asking if you "really want to copy the folder". Click yes. Now highlight the 'resources.arsc' file in the NEW archive window and then drag it to the OLD archive window and click yes when it asks you if you really want to copy it. You can now close both 7-Zip windows and navigate back to your APKtool window.
14. Now it's time to install the modified framework. Open ADB Insecure if you've already installed it. Grant it SuperUser rights and check the box next to "enable insecure adbd" and open an ADB command window. In order for this next step to be successful, you MUST have insecure adbd enabled. When you're ready, type the command:
Code:
adb remount
15. The window should reply with 'remount succeeded" as seen above. Now we are going to install the framework to the system. Don't worry about setting permissions for the framework. Because we are pushing the framework into the system via ADB and because the framework-res APK was already a system app, ADB will automatically set the proper permissions for the framework APK. This is the moment of truth! Type the following command below (this is assuming you installed APKtool into the C:\ directory). Once installed, within 5-10 seconds some buttons may appear different or be a different color. This is normal and generally signals a successfull installation. If within 5-10 seconds your tablet automatically reboots itself, that generally signals a soft brick. Here we go! Type the commands below, into your ADB command window one at a time:
Code:
adb push C:\apktool\framework-res.apk /system/framework/framework-res.apk
adb reboot
16. If your tablet rebooted successfully, congrats, you just activated Daydreams Before we install the Colors screensaver, go ahead and navigate to your display settings on the tablet. You'll notice a new tile, 'Daydream'. Tap on it and a new window opens. From here you can use the stock desk clock app for the screensaver, install 'Colors' or choose the Amazon screensaver. For Colors: Download the attached BasicDreams APK at the bottom of this post, but do NOT install it. Place the APK into your ADB folder. When done type the following command below. Again no need to worry about setting permissions to the APK as ADB will do it for us:
Code:
adb push BasicDreams.apk /system/app
adb reboot
17. When your tablet reboots, download and install Activity Launcher if you haven't done so already. Tap the pull down at the top left and select all activities. Scroll down until you see SystemUI and tap on it, then tap 'Dessert Case'. To stop the screensaver, tap and pull up near the navigation bar and swipe it closed. Navigate to your display settings again and tap on Daydream. You now have 3 screensavers!!! Tap the three dots at the top right for options on when the screensavers should turn on aka 'daydream'. You can also tap 'start now' to preview them.
So far, these are the only three I have been able to get working. I am still trying to get Photo Table to work, but I am pretty sure Gapps needs to be installed, and I haven't gotten that far to test it. I've tried other screensavers from the Play Store with no luck unfortunately. However if anyone finds anymore working ones, please post your results/finds
Thanks everyone who followed. This makes me quite happy to see this unique feature on these tablets as they are deserving of such a thing. It's disappointing Amazon lets such a great thing go to complete waste. This maybe an old feature, but a very cool and underappreciated one. I hope everyone enjoys this as much as I did unlocking it. I'll be honest; I never thought I would be able to learn basic coding. At least not enough to get this far and accomplish the things I have. Thanks for the support everyone
Watch for part two in the next couple days: Change your lock screen wallpapers...WITHOUT using Amazon photos!!
Part 2: Change your lock screen wallpapers
This guide will teach you how to change all of the stock FireOS wallpapers. This is much easier than activating Daydreams and you don't need Java or Apktool to make the edits.
This guide is mainly for individuals who want to or already disabled/uninstalled Amazon Photos. When you disable or uninstall Amazon Photos, you lose the ability to change your lock screen wallpapers. This guide will work for both the Fire 7 and HD 10.
Requirements:
- ROOTED Fire 7 or HD 10
- 7-Zip
- ADB insecure
- Your choice of any 7 wallpapers
- Windows PC with ADB
Instructions:
IMPORTANT: Make a copy of your SystemUI.apk at /system/priv-app/SystemUI and place it somewhere on your PC in case you have an unfavorable result, you won't have to reset your device.
1. Download and install 7-zip.
2. First we need to get a copy of your SystemUI. Plug your tablet into your PC, making sure ADB debugging is enabled in the developers menu. Open an ADB window on your PC and type the command below (the actions of moving the SystemUi.apk around should only be done via ADB. Never copy and past an APK from one device to another if you intend on editing it.)
Code:
adb pull /system/priv-app/SystemUI/SystemUI.apk
3. Running the above command will have resulted in making a copy of your SystemUI.apk and then placed it on your PC, into the same folder as ADB.
4. Create a folder on your desktop for the 7 wallpapers you desire. You can pick 7 different ones, or use the same wallpaper 7 times, but you can't choose any more or any less of a quantity. Putting anymore or less in the SystemUI will cause the tablet to bootloop. I have a collection of about 200 stock Android wallpapers from the first version, all the way to Nougat. It doesn't matter what size they are because you'll be resizing them anyways.
5. Once you've chosen your wallpapers, you'll have to resize them. For this guide I will be using Microsoft Paint. Navigate to the folder containing your new wallpapers and open the first one in Paint. Click the 'Resize' button at the top left of the screen, select Pixels and make sure the 'maintain aspect ratio' box is UNCHECKED. Your wallpaper MUST be the same size/resolution as Amazon's. Enter the values as listed and pictured below:
Code:
Horizontal: 1920
Vertical: 1200
6. Save the wallpaper as a .jpg. The name doesn't matter right now because we will be renaming them. If you are going to use 7 different wallpapers, you need to make a copy of the wallpaper you just resized. Open it in paint and again click resize, select Pixels and make sure 'maintain aspect ratio' is UNCHECKED. Reverse the dimensions:
Code:
Horizontal: 1200
Vertical: 1920
7. If you want to keep the same wallpaper on your lock screen all the time, repeat the above step with copies of the same wallpaper. Regardless if you use the same ones or different ones, you will have 14 wallpapers in the folder when done.
8. Navigate back to your ADB folder and locate SystemUI.apk. Right click on it and select the '7-Zip' option then 'open archive'. DO NOT UNZIP, EXTRACT OR DECOMPILE THE APK! Resize the window so you have a good amount of space to open the wallpaper folder we just made. Place the windows next to each other.
9. In the 7-zip, SystemUI archive window, double click on the 'res' folder then locate and double click the 'raw-hdpi-v4' folder. This is the location of the Amazon's default lock screen wallpapers. In your custom, wallpaper folder, you need to rename each wallpaper to match the names of Amazon's. It's important you do this step and that the names match. Otherwise when you reinstall the SystemUI, it will crash.
10. When you're done, in your custom wallpaper folder, click on 'Edit' a the top and 'select all'. Click on any of the wallpapers but don't let go! Start to drag them over to the 7-zip SystemUI window. Make sure you have all of them, then let go. When the box pops up asking you if you want to overwrite the other wallpapers just click yes. Close both windows and open an ADB window again.
11. Download and install ADB Insecure from the link at the beginning of this post. Open it and grant it root access if you don't have SuperSU set to automatic. Check the box to put ADB into insecure mode. In the ADB window, type the following commands, pressing enter after each one.
Code:
adb remount
adb push SystemUI.apk /system/priv-app/SystemUI/SystemUI.apk
adb reboot
12. That's all. If successful, your tablet will reboot and your custom lock screen wallpaper(s) should appear. If unsuccessful, your tablet will reboot, but with no SystemUI active. I'll write a small guide on recovering from a SystemUI crash without reflashing firmware if anyone has a problem. Until then enjoy your wallpapers. Just remember you have to repeat this guide each time you want to change them. Until I can figure out how Amazon Photos has such control over the lock screen, this is the only way to change your lock screen wallpapers if you uninstall Amazon Photos. Thank you for following everyone!
Definitely looking forward to trying this!
Still waiting for part 2. Also wondering if it's possible to modify the framework so that we can customize the power options.
oscarcx said:
Still waiting for part 2. Also wondering if it's possible to modify the framework so that we can customize the power options.
Click to expand...
Click to collapse
Got a little busier this weekend than I predicted. I will try to get part 2 up today or tonight.
Is it possible? Yes. However I'm having a difficult time with it. Those settings are a bit scattered and butchered so I'm having trouble figuring out which xml to edit. Amazon created their own xml files to override some of androids. It also doesn't help that a lot of values from the bools are repeated then scattered across various system apps. I know one issue is the power profile. Amazon did a good job of butchering that setting and it's proving difficult reconstruct. In other words the power profile is almost non existent.
DragonFire1024 said:
Got a little busier this weekend than I predicted. I will try to get part 2 up today or tonight.
Is it possible? Yes. However I'm having a difficult time with it. Those settings are a bit scattered and butchered so I'm having trouble figuring out which xml to edit. Amazon created their own xml files to override some of androids. It also doesn't help that a lot of values from the bools are repeated then scattered across various system apps. I know one issue is the power profile. Amazon did a good job of butchering that setting and it's proving difficult reconstruct. In other words the power profile is almost non existent.
Click to expand...
Click to collapse
No need to hurry. These are great discoveries so take your time to write the tutorial
In my opinion, your tutorial is kind of way too detailed. I know it's great for tech newbies, but by simplifying it a little bit could effectively save your time.
For the power option, if it's way too hard to customize it, maybe spending time on other stuff will be a better choice.
Anyways, thanks for your amazing work!
oscarcx said:
No need to hurry. These are great discoveries so take your time to write the tutorial
In my opinion, your tutorial is kind of way too detailed. I know it's great for tech newbies, but by simplifying it a little bit could effectively save your time.
For the power option, if it's way too hard to customize it, maybe spending time on other stuff will be a better choice.
Anyways, thanks for your amazing work!
Click to expand...
Click to collapse
I think it's more of putting pieces back in the right spots, for example, settings fragments. Some things are directed with Amazon's fragments and it's just a matter of finding the right android fragment and replacing it. In other cases, Amazon blocks out some features in an 'assets' file. Some things are also set in smali files/java and I know very little about smali, so have been reading up on that. Sometimes the fix is just a simple word change like the DayDream. I also recently discovered other settings or at least "project defaults " set by mediatek. I'm able to change some of those and supposedly add them to the build prop for more activation, but so far I haven't seen a difference.
Change your lock screen wallpapers everyone Part 2 is out!
DragonFire1024 said:
This guide will teach you how to change all of the stock FireOS wallpapers. This is much easier than activating Daydreams and you don't need Java or Apktool to make the edits.
(........................)
Thank you for following everyone!
Click to expand...
Click to collapse
Brilliant! Never thought of replacing those default wallpapers. At least this is a temporary solution.
I am wondering how the lockscreen wallpaper works and correct me if I am wrong. The app called "Special offer" is included in stock Fire OS and it has the ability to either change the wallpaper or overlay the wallpaper. Maybe it's a good idea to start from there but I am not sure about the legitimacy issue.
The lockscreen itself is weird though. Using Gravity Box, I can change some of the features but not all of them. Someone here told me that the lockscreen is deeply integrated into Fire OS.
oscarcx said:
Brilliant! Never thought of replacing those default wallpapers. At least this is a temporary solution.
I am wondering how the lockscreen wallpaper works and correct me if I am wrong. The app called "Special offer" is included in stock Fire OS and it has the ability to either change the wallpaper or overlay the wallpaper. Maybe it's a good idea to start from there but I am not sure about the legitimacy issue.
The lockscreen itself is weird though. Using Gravity Box, I can change some of the features but not all of them. Someone here told me that the lockscreen is deeply integrated into Fire OS.
Click to expand...
Click to collapse
There's a line in the build.prop file called "curlockscreen" with a value of 1. I have no idea exactly what it's for, but it might be related to disabling and/or modifying the lock screen.
lakitu47 said:
There's a line in the build.prop file called "curlockscreen" with a value of 1. I have no idea exactly what it's for, but it might be related to disabling and/or modifying the lock screen.
Click to expand...
Click to collapse
Just did a quick search on it and looks like it's the default lockscreen style
I decided to give Part 1 a try.
I got up to step 15 successfully, including having the Daydream tile.
I'm presuming that — to install BasicDreams.apk (in step 16) — you need to have another round of "adb remount"
Unfortunately, although "adb remount" worked when I did it the first time, trying to do it now results in an error:
remount of system failed: Invalid argument
remount failed
Trying to copy (with the "adb push BasicDreams.apk" command) results in an error:
adb: error: failed to copy '[PATH]/BasicDreams.apk' to '/system/app/BasicDreams.apk': remote Read-only file system
(Unsurprisingly, this is the same error if I try to do the "adb push BasicDreams.apk" thing without trying "adb remount")
In all cases, I'm re-enabling the "Enable insecure adbd" option from the "adbd insecure" app.
Any ideas how to fix this?
GamerOfRassilon said:
I decided to give Part 1 a try.
I got up to step 15 successfully, including having the Daydream tile.
I'm presuming that — to install BasicDreams.apk (in step 16) — you need to have another round of "adb remount"
Unfortunately, although "adb remount" worked when I did it the first time, trying to do it now results in an error:
remount of system failed: Invalid argument
remount failed
Trying to copy (with the "adb push BasicDreams.apk" command) results in an error:
adb: error: failed to copy '[PATH]/BasicDreams.apk' to '/system/app/BasicDreams.apk': remote Read-only file system
(Unsurprisingly, this is the same error if I try to do the "adb push BasicDreams.apk" thing without trying "adb remount")
In all cases, I'm re-enabling the "Enable insecure adbd" option from the "adbd insecure" app.
Any ideas how to fix this?
Click to expand...
Click to collapse
Make sure box is checked in adb insecure. After a reboot, you need to check the box again.
oscarcx said:
Just did a quick search on it and looks like it's the default lockscreen style
Click to expand...
Click to collapse
Yes but broken up internally. I do have a fix but I have to consult a developer before I announce it as it uses a piece of software from another rom.
GamerOfRassilon said:
I decided to give Part 1 a try.
I got up to step 15 successfully, including having the Daydream tile.
I'm presuming that — to install BasicDreams.apk (in step 16) — you need to have another round of "adb remount"
Unfortunately, although "adb remount" worked when I did it the first time, trying to do it now results in an error:
remount of system failed: Invalid argument
remount failed
Trying to copy (with the "adb push BasicDreams.apk" command) results in an error:
adb: error: failed to copy '[PATH]/BasicDreams.apk' to '/system/app/BasicDreams.apk': remote Read-only file system
(Unsurprisingly, this is the same error if I try to do the "adb push BasicDreams.apk" thing without trying "adb remount")
In all cases, I'm re-enabling the "Enable insecure adbd" option from the "adbd insecure" app.
Any ideas how to fix this?
Click to expand...
Click to collapse
How about,
adb shell
su
mount -o rw,remount /system
Instead of adb remount? It looks like an error in adb remount.
Supersonic27543 said:
How about,
adb shell
su
mount -o rw,remount /system
Instead of adb remount? It looks like an error in adb remount.
Click to expand...
Click to collapse
You can do that I suppose. I haven't tried. I side stepped that method because adb will make sure the APK has the permissions assigned properly amongst other anomalies I've come across. These are old APKs from original sources I work with. Most of the time i keep them safely inside their zipped ROM and sometimes you only get so many uses out of them if you move them around outside the system too much without proper permissions. In a matter of speaking they get lost and stop working. So I try to minimize the amount of time they remain away from home. With that said, it shouldn't be a problem.
Sent from my Samsung Galaxy S4 using XDA Labs
To follow up here:
1) I was certain I re-enabled adb insecure.
2) I tried "mount -o rw,remount /system", and got a similar error: "mount: Invalid argument". I also tried a command that worked in the past (that I'm pretty sure is doing the same thing): "mount -w -o remount /system" (no quotes, obviously), and also got the "mount: Invalid argument" error.
3) The error I had in this circumstance was similar to one I had on an unrelated matter regarding getting FlashFire working.
What I suspect is that somehow /system gets tired of being written to, and it "locks me out" for some reason. (There are two points when I have traditionally made use of "mount -w -o remount /system" — when I copy over the initial /system image via "dd if=/sdcard/system.img of=/dev/block/mmcblk0p13; sync" and when I disable OTA updates with "mv /system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk /system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk_" )
Another possibility is that I had somehow made a mistake in following this tutorial originally, typing "adb push [SOURCE]\framework-res.apk /system/framework-res.apk" instead of "adb push [SOURCE]\framework-res.apk /system/framework/framework-res.apk"
I deleted the errant framework-res.apk from /system, but I wonder if that somehow tripped up some kind of "don't muck with this" flag that wouldn't let me remount it.
4) Speaking of which, are you sure about this command in Step 16?
adb push BasicDreams.apk /system/app
Click to expand...
Click to collapse
I can't get it to work. In fact, if I use a file browser to go to /system , I just have a non-folder file named "app" that happens to be the same size as BasicDreams.apk . . .
I reflashed my /system and confirmed that I don't seem to have a folder named "app" in /system , so I can't quite figure out what that command is doing . . . Does it need to be:
adb push BasicDreams.apk /system/priv-app
? (I have a 2017 HD10, if it matters.)
5) For my second attempt, I tried to do as "clean" a re-install of my system as I could, avoiding the two instances of when I would remount /system in the past (flashing a straight system.img extracted from an update and freezing the OTA app with Titanium Backup). This time, remounting worked both times, as did the rest of the procedures (with the exception of the "BasicDreams.apk" problem, directly above).
GamerOfRassilon said:
To follow up here:
1) I was certain I re-enabled adb insecure.
2) I tried "mount -o rw,remount /system", and got a similar error: "mount: Invalid argument". I also tried a command that worked in the past (that I'm pretty sure is doing the same thing): "mount -w -o remount /system" (no quotes, obviously), and also got the "mount: Invalid argument" error.
3) The error I had in this circumstance was similar to one I had on an unrelated matter regarding getting FlashFire working.
What I suspect is that somehow /system gets tired of being written to, and it "locks me out" for some reason. (There are two points when I have traditionally made use of "mount -w -o remount /system" — when I copy over the initial /system image via "dd if=/sdcard/system.img of=/dev/block/mmcblk0p13; sync" and when I disable OTA updates with "mv /system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk /system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk_" )
Another possibility is that I had somehow made a mistake in following this tutorial originally, typing "adb push [SOURCE]\framework-res.apk /system/framework-res.apk" instead of "adb push [SOURCE]\framework-res.apk /system/framework/framework-res.apk"
I deleted the errant framework-res.apk from /system, but I wonder if that somehow tripped up some kind of "don't muck with this" flag that wouldn't let me remount it.
4) Speaking of which, are you sure about this command in Step 16?
I can't get it to work. In fact, if I use a file browser to go to /system , I just have a non-folder file named "app" that happens to be the same size as BasicDreams.apk . . .
I reflashed my /system and confirmed that I don't seem to have a folder named "app" in /system , so I can't quite figure out what that command is doing . . . Does it need to be:
adb push BasicDreams.apk /system/priv-app
? (I have a 2017 HD10, if it matters.)
5) For my second attempt, I tried to do as "clean" a re-install of my system as I could, avoiding the two instances of when I would remount /system in the past (flashing a straight system.img extracted from an update and freezing the OTA app with Titanium Backup). This time, remounting worked both times, as did the rest of the procedures (with the exception of the "BasicDreams.apk" problem, directly above).
Click to expand...
Click to collapse
I am not too sure why this is happening. I presume you edited the framework-res.apk? If so, use a root explorer, I use the actual Root Explorer, and navigate to /system/priv-app and create a folder named BasicDreams. If using root excplorer, Long press the folder, tapp three dots at top right, tap permissions, set to 0755 (rwxr-xr-x). Place the APK in the internal storage of your tablet. Open your root explorer and go to your internal storage. CUT the APK FIRST to /system then CUT it to the BasicDreams folder in /system/priv-app you just made. When done, if using root explorer, long press the APK, tap three dots on upper right and tap permissions. set permissions to 0644 (rw-r--r--). Reboot then go to settings, display, and see the Daydream menu.
DragonFire1024 said:
I am not too sure why this is happening. I presume you edited the framework-res.apk? If so, use a root explorer, I use the actual Root Explorer, and navigate to /system/priv-app and create a folder named BasicDreams. If using root excplorer, Long press the folder, tapp three dots at top right, tap permissions, set to 0755 (rwxr-xr-x). Place the APK in the internal storage of your tablet. Open your root explorer and go to your internal storage. CUT the APK FIRST to /system then CUT it to the BasicDreams folder in /system/priv-app you just made. When done, if using root explorer, long press the APK, tap three dots on upper right and tap permissions. set permissions to 0644 (rw-r--r--). Reboot then go to settings, display, and see the Daydream menu.
Click to expand...
Click to collapse
I did edit the framework-res.apk, yes.
I jumped through all those hoops, it it is — indeed — working! (I interpreted the instructions as "Cut and paste into /system, then cut and paste it from /system into the folder on /system/priv-app" . . . is that because the file needs to "touch" /system to work correctly? And I just COPY/pasted the first time into /system, to keep the original backed up on my SD card.)
GamerOfRassilon said:
I did edit the framework-res.apk, yes.
I jumped through all those hoops, it it is — indeed — working! (I interpreted the instructions as "Cut and paste into /system, then cut and paste it from /system into the folder on /system/priv-app" . . . is that because the file needs to "touch" /system to work correctly? And I just COPY/pasted the first time into /system, to keep the original backed up on my SD card.)
Click to expand...
Click to collapse
It touches the system just as a precaution. I've read in places it a way for the system to better accept APKs as a system app when you force install it like this. I don't know if it's true, but when manually adding a file, i take this step as a just in case route.

Categories

Resources