Tuesday, February 28, 2017

root access - How to unpack/repack system.img of android ROM?


I have OnePlus 6T device which has A/B partition system and has a ROM of user type i.e [ro.build.type]: [user]. This device is rooted with Magisk. I have a requirement(Want to place customized sepolicy file under system_root directory) to modify system.img.


I have tried different tools like:



  1. simg2img :



OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea/img-tools$ ./simg2img system.img sys.raw
Invalid sparse file format at header magi
Failed to read sparse file
OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea/img-tools$


  1. imgtools


OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea/imgtool$ sudo ./imgtool system.img extract
[sudo] password for OMEN:

system.img is not a recognized image. Sorry
OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea/imgtool$


  1. and more tools even on windows..


but none of them is capable of parsing my system.img.


I have copied system.img directly from OnePlus6T ROM setup which installs Android 9 on this device without any issue.


Any help on:




  1. How to fix the system.img so it will be extracted and repacked fine?

  2. Any command that can unpack/repack system.img?

  3. Any working tool to accomplish this task?


Update 1: I have run file system.img and I found that its ext2 image and the tools support ext4.


system.img: Linux rev 1.0 ext2 filesystem data, UUID=d09c08e9-628d-590e-a610-3a14de2a8db0 (extents) (large files) (huge files)


Update 2: Tried to find the magic number and have following result:


OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea/imgtool$ xxd system.img | head

00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................

OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea/imgtool$

Update 3 Fing the image already unpacked. So to add the required file, I have mount the image as sudo mount -o loop system.img system_mount and then tried to copy the contents to another folder with cp system_mount/* system/ so that I can add the required file and make new image out of it but I got following errors:


root@OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea# mkdir system && cp system_mount/* system/
cp: omitting directory 'system_mount/acct'
cp: cannot stat 'system_mount/bin': No such file or directory
cp: cannot stat 'system_mount/bt_firmware': No such file or directory
cp: cannot stat 'system_mount/bugreports': No such file or directory
cp: cannot stat 'system_mount/cache': No such file or directory
cp: cannot stat 'system_mount/charger': No such file or directory

cp: cannot stat 'system_mount/charger_log': No such file or directory
cp: omitting directory 'system_mount/config'
cp: omitting directory 'system_mount/d'
cp: omitting directory 'system_mount/data'
cp: omitting directory 'system_mount/dev'
cp: cannot stat 'system_mount/dsp': No such file or directory
cp: cannot stat 'system_mount/etc': No such file or directory
cp: cannot stat 'system_mount/firmware': No such file or directory
cp: omitting directory 'system_mount/lost+found'
cp: omitting directory 'system_mount/mnt'

cp: omitting directory 'system_mount/odm'
cp: omitting directory 'system_mount/oem'
cp: omitting directory 'system_mount/op1'
cp: omitting directory 'system_mount/op2'
cp: cannot stat 'system_mount/persist': No such file or directory
cp: omitting directory 'system_mount/postinstall'
cp: omitting directory 'system_mount/proc'
cp: cannot stat 'system_mount/product': No such file or directory
cp: omitting directory 'system_mount/res'
cp: omitting directory 'system_mount/sbin'

cp: cannot stat 'system_mount/sdcard': No such file or directory
cp: omitting directory 'system_mount/storage'
cp: omitting directory 'system_mount/sys'
cp: omitting directory 'system_mount/system'
cp: omitting directory 'system_mount/vendor'
root@OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea#


Answer



To Unpack-Modify-Pach the system.img, I have followed the following procedure:


a) Unpacking




  • Run file system.img and make sure that system.img is Android Sparse Image.

  • Rename system.img to system.img.ext4. // Not required if you will use other name for raw image in below steps.

  • With simg2img system.img.ext4 system.img, you will get a raw image file named system.img

  • With mkdir system, create directory to mount system.img

  • With sudo mount -t ext4 -o loop system.img system/ you will get all files of system.img in system folder


b) Modifying



  • With ls -l system/init.rc note permissions: 750


  • With sudo chmod 777 system/init.rc give write permissions

  • With sudo echo "#MODIFICATION " >> system/init.rc done some modification in init.rc

  • With sudo chmod 750 init.rc reset init.rc to the noted permissions


c) Calculate system sector size



  • With tune2fs -l system.img | grep "Block size\|Block count" you will get block size and count

  • With echo $((1553064 * 4096)) multiply both results. I got 6361350144


d) Packing




  • With sudo make_ext4fs -s -l 6361350144 -a system system_new.img sys/ you will get system_new.img “Android Sparse Image” that has all changes


How can I transfer photos to my Android Jelly Bean device while preserving the original timestamp?


I recently bought a Nexus 4 and I would like to transfer my photos of my previous device to it. My previous Android phone used the standard USB mass storage which gave 0 problems to copy back and forth stuff, but the Nexus 4, like many other modern Android phones I suppose, uses MTP instead, which has the interesting feature of refusing to copy the original dates/timestamps of the files, using instead the date at which the files are being copied.


This is obviously a huge bummer when it comes to photos; not only because one cannot check the original date at which the picture was taken while browsing on the phone, but also because they end up completely unsorted.


Is there a way to transfer photos to a Jelly Bean Android phone that doesn't support USB mass storage preserving the original timestamps?


Things I've tried so far:



  • Transferring via USB MTP

  • ADB push (both full folders and individual files)

  • Transferring via SSH (using SSHDroid + WinSCP)


  • Uploading and downloading from Dropbox

  • Transferring a ZIP file via MTP and uncompress the file on the phone

  • Transferring from the other phone via bluetooth

  • QuickPic "fix date" function

  • Local Sync

  • Photo Date Correction

  • FTPSyncX

  • Smoke signals

  • Yelling at the phone



None of them preserved the timestamp, and this is driving me insane.


(Also, I am not rooted yet, but if the only viable way requires root I would welcome that answer as well.)



Answer



You can't, this is a current permission problem (bugreport here) of Android 4.0+'s /sdcard folder if it's not using FAT32 (but FUSE).


Reason: There's a transition away from FAT32 to unified user storage for both apps and media data (using ext4) on a single file system.



We got tired of seeing OEMs include many GB of internal storage for music, while users were still running out of space for apps and data. This approach lets us merge everything on one volume, which is way better.


-- Dan Morrill, Android engineer at Google



The old FAT32 properties are emulated using a FUSE layer to be compatible with existing apps. Also: /data/ and /sdcard on Google devices starting with the Nexus 7 use a single partition only (/data/media represents the "sdcard" content and is exposed using the FUSE layer to apps).



Here's CyanogenMod's implementation of the FUSE driver if you're interested in seeing the source. Looks like setting timestamp attributes is implemented, though.


EDIT: It only works with root.


Exact reason: All files are owned by root.sdcard_rw (see here).


A caller withouth uid=0 can't call the utimensat() syscall, it fails in the VFS layer already (EPERM) for timestamps other than current:




  1. the caller's effective user ID must match the owner of the file; or

  2. the caller must have appropriate privileges.


To make any change other than setting both timestamps to the current

time (i.e., times is not NULL, and both tv_nsec fields are not
UTIME_NOW and both tv_nsec fields are not UTIME_OMIT), either condition
2 or 3 above must apply.



Monday, February 27, 2017

facebook - How can I remove these apps from my device?



I am trying to remove the Facebook and Messenger apps from my Asus Zenphone Laser 2.


Unfortunately, in both cases, I seem to be unable to find the option to fully delete them from the device. I have disabled them, but the app management screen now shows the following:


enter image description here enter image description here



How can I fully delete/uninstall them?




Sunday, February 26, 2017

Is there a way on a DUAL SIM Android phone to configure on a per-app basis, which app uses which sim card to access internet?


Let's say, I have two SIM cards, the first one has an unlimited but slow 3G internet connection, the other SIM has a very fast LTE Internet connection with limited data volume. So I would use the first SIM card for all apps, downloads, web surfing, app updates, music streaming, data synchronisation like Dropbox and Google Drive etc. But for Skype/WhatsApp video calls and HD video streaming I would prefer to use the second sim card with LTE. Is that possible on Android?


If it is inpossible, probably another scenario will work somehow: if I start Skype/Netflix, all background internet connections should be stopped and the second sim must be activated for internet connections.



If there is no app for that yet, but it is possible to do so programmatically without rooting, that would work, too.


Thanks




Saturday, February 25, 2017

sms - How do I replace the default messaging icon in the dock with handcent?


I've a Samsung Galaxy S with 2.2 firmware. I'm using handcent instead of the default messaging application. In the default messaging app settings I have disabled notifications and disabled auto-retrieve. But when I get an SMS now, even after I had read it in handcent, I still get the new message notification overlay on the messaging icon on the homescreen until I click into it. Can i disable this, or better yet replace that icon with handcent?



Answer



Assuming you are using the default Samsung TouchWiz launcher:



  1. Open the App Drawer (Applications)

  2. Press Menu, select View Type -> Customizable Grid


  3. Press Menu, choose Edit

  4. Drag off the Messaging icon, and drag on Handcent.


I've replaced it with Gmail, myself.


connection issues - ADB connect to a device via TCP/IP


I'm trying to use adb connect:


 connect [:]       - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.


and this is what I get:


mbp:~ alexus$ adb connect 10.0.0.18
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
unable to connect to 10.0.0.18:5555
mbp:~ alexus$

USB debugging is on and 10.0.0.18 is IP of my Android device, I'm able to do it via USB cable w/out any issues... any ideas?



Answer




Try following these instructions:


1) Open the command prompt and navigate to your sdk/platform-tools/ folder.


2) Type adb tcpip 5555 with your device plugged in


3) Type adb connect :5555


4) At this point you unplug your device and type adb logcat


5) At times, such as unplugging/plugging into a USB device, the logcat will become disconnected, just redo steps 3 & 4.


From my answer here.


Nexus 7 is stuck in reboot loop after full discharge


I have a few day old Nexus 7 tablet, unrooted, bootloader still locked, and otherwise in factory condition. This morning, it ran its charge out. When I plugged in it, this happens:




  1. Google Logo appears.




  2. Nexus Logo appears.





  3. Lock screen which shows charging: 0%.




  4. White screen, device powers off.




  5. Repeat.





What is happening? Thanks!



Answer



Some devices (I don't know about the Nexus 7, but I think it will be about the same) only charge when they have still a little charge left on their battery, because - believe it or not - charging happens electronically. So it can be that your device has absolutely no juice left to run. An example of such a device is the BlackBerry PlayBook (not Android) where this trick works when your tablet doesn't want to boot.


But there is a simple solution for that, which can take some time. Try to keep your device awake for as long as possible, even if that means you have to restart it a couple of times. Of course you do this while your charger is connected. After you have restarted it a couple of times, it should normally boot up. I expect it will take about 7 or 8 boots for the battery to be charged at minimum level again. After that, make sure you keep the device connected long enough so the battery is fully charged (have a look in your user manual how long it is recommended, most tablets need about 8 hours).


Another option is that your device just needs a little more juice to start. In that case you should leave it plugged in for some time (I recommend at least an hour) before booting.


tl;dr: Two options you could try: 1) Just keep restarting it, after a while it will start as normal. Recharge the battery for a long time (probably around 8 hours). 2) Leave it plugged in for a long time before restarting


Friday, February 24, 2017

6.0 marshmallow - Android 6+ and account permissions: where have they gone to?


I was just browsing the Android Developers Permissions list, and noticed most of the account permissions are gone – in fact, all but GET_ACCOUNTS as it seems. What does that mean, what implications does it have to the end-user – and what else got messed up (apart from the fact there's practically no INTERNET permission anymore)?


As usual, I tried my best Google-Fu but found no answers. Instead, some unanswered questions asking the same. I cannot put it into better words than these:



Marshmallow dropped several Account permissions, including MANAGE_ACCOUNTS and USE_CREDENTIALS, but kept GET_ACCOUNTS. I haven't seen much documentation of what this means for the user in practice, though. I assume that the app that creates an account can automatically use/manage it. However, if a 3rd party app wants to log in with a Google/Facebook/etc account that it did not create:



  • Does it still have to request my interaction/approval the first time each account is accessed/used, or can it just use my accounts automatically now?

  • If I deny the GET_ACCOUNTS permission, can the app still prompt me to log in with an account from my Nexus? Or do I have to grant the app permission to view all of my accounts in order to let it use one of them?




Additionally: if access to accounts is still protected (which I hope it is!) – which permission is protecting it now?




Related questions (whose answers might need to be updated now):





Summing up information collected in the (cleaned-up) comments


The following details came up in the comments. They are not answering my question, but give valuable hints – which is why I'm including them with my question (credits given to their authors):



  • "there's practically no INTERNET permission": It's still there, but automatically granted to each app. No way to revoke it with on-board tools/settings. Which is why I linked to In Android 6, how to deny an app permission to access the network? above. Why that's important? See below.


  • Dan Brown points out that access to accounts is now bound to some _CONTACTS permission. Indeed, using an app to "login with Google" prompts: "Allow X to access your contacts?"
    contacts access
    It's not clear whether you grant read access only (bad enough) or even write access. So now even a cloud storage app (like Dropbox, Mega, etc) gets access to your contacts – which is why always granting INTERNET becomes a privacy nightmare.
    As it's now obvious this part of the account permissions went to contacts (kudos to Dan for the pointer!), I'd really like to read some details on that: how was it changed, why was it changed, what are the implications, how to deal with it.
    Update: As the latest version of the SE app no longer requires to access contacts, Dan created a dedicated question concerning this app on the main Meta, which might be worth checking: How does the new sign-in system work for the Android app? In short, they are using a new version of the "Google Sign In SDK", which no longer requires contacts access. As that only affects Google Sign-In, it doesn't answer my question, though.

  • Dan also pointed out that apps use their own account managers. That was already the case before MM – and the reason why there was the MANAGE_ACCOUNTS permission (see above): they registered their service with Android, so other apps could use it.

  • As I already mentioned with my question, GET_ACCOUNTS is the only surviving account permission. It was already required before MM, and probably still serves the same purpose: In order to use an account, our app first needs to know that it's there – so it has to obtain a list of available accounts to start with. If something has changed in this regard, please include it with your answers.




My Android phone is completely reset, whats the best way to recover the deleted data?


A person at a phone store reset all the contents of my Motorola Moto G Android phone, and I did not give them permission to do so. I had many important pictures and videos, but the even more important thing were the audio recordings I had created.


Is there ANY WAY to recover this data? I know it was reset, but I'm very stressed and would appreciate a pointer of a way to effectively recover some or all of the data without comprising it in the process. I am not using the phone, and had shut it off entirely. I'm aware that the more you use it, the more it overwrites the data. I NEVER had a backup, dumb, I know.



Thank you folks!


**Edit: I recovered most of my photos and videos just now through Google+, most of it was synced! But how can I recover my voice recordings ? That's what's most important to me. I used this app. https://play.google.com/store/apps/details?id=com.andrwq.recorder&hl=en


Unfortunately, my phone model never supported SD cards, so there's nothing there.




How can I prevent an application (Chrome) from opening another application (Google Play Store)?


So today Facebook Messenger declared a war against users of the mobile website. Of course we have been plagued for months with small header messages as well as overlays hiding all content and encouraging us to install Facebook Messenger.


But as from today, wherever I click in the messaging interface of Facebook's mobile website (and that includes the Message icon in the toolbar, clicking any conversation, clicking the Load more button, ...), each time it will open the Google Play Store application and send me to Facebook Messenger's application.


So I wonder if there is a way to prevent an application (in this case, Chrome) to open other applications (in this case, Google Play Store) via deep linking.
I don't believe that this is a bug that would be fixed any time soon so I am looking for a way to overcome this.


Installing any Facebook application is not an option for me.
I have searched for similar questions: answers suggested to clear Chrome's and/or Google Play Store's data, which I have tried but it did not solve the problem.




Answer



"Request desktop site" works (for now)...



downloading - Download YouTube Videos from Mobile?



Is it possible to download YouTube Videos on my New Samsung Galaxy Y android phone and have it stored in my SD card?




Thursday, February 23, 2017

Google Play Games without Google Plus


Lots of Android games have some "achievement" features that give you badges for completing some task in the game. This sounds like fun and I'd like to try it.


Apparently, those features are only available once you are signed in to Google Play Games. I don't mind that. I do mind, however, that trying to register to Google Play Games asks me to create a Google+ profile, which I definitely do not want (I don't want another social networking account, and I particularly don't want a potentially public social networking account associated with my personal gaming activities).



Is there are way to use Google Play Games features without a Google+ account?



Answer



It is possible now. As mentioned here



  • Players are prompted to sign-in once per account, rather than once per game

  • Players no longer need their account upgraded to Google+ to use Play Games services

  • Once players have signed-in for the first time, they will no longer need to sign in to any future games; they will be automatically signed in


Note: Players can turn off auto-sign-in through the Play Games App’s settings


applications - Android Tracking by vendor


I am concerned about the type of tracking done by the vendor of my Android Phone. Can they track my location when I connect my phone to internet or GPS? Do they do this tracking once after device activation or repeatedly after some time interval? And are they legally allowed to track me?



Answer



See How does Google know where I am? from SE security for good answers on this. Reproducing key extracts here:




Each cell tower has a set of ID numbers that identifies them to the phones. It broadcasts its identity constantly so that phones can connect to it as they move around....If you're in a larger populated area, like a city, your phone will usually get signals from more than one cell tower....



So how does Google know any of where these cells, wedges, slices, and intersections are?


From the billion Android phones that have GPS turned on (including yours, when your GPS was on), constantly sending reports of their GPS location and what cell towers and signal strengths they see. Google has used this data to map out where each cell is located, and what the approximate signal strength is at each point. They have a giant database on their servers with this information; your phone queries that database by making a network request that lists all cell towers that are in range, and the Google servers respond with your estimated location.




  • From BSSID information from your WLAN Access point even if your GPS and Wi-Fi are turned off. See INV3NT3D's answer



Google and others like Apple and Skyhook build a Database which links WLAN BSSIDs to a geographic location. A BSSID is like the MAC address of a access point that gets broadcasted by that access point. It is therefore "public viewable" if the BSSID broadcast is enabled, which is the default for most access points....So, essentially, when you ARE using WiFi and GPS, Google's database of BSSIDs is updated with a geographic location associated with that BSSID....So it's not that the ISP is giving Google the location of their routers, it's that your phone has already helped to build a database of the Access Points around you, and Google uses this data for geolocation.



So, you are pretty much tracked all the time and more accurately perhaps when your GPS is on and you are in a Wi-Fi dense environment (did you notice that your map location accuracy is much better while traversing a business or shopping area? )



Coming to other points in your question, tracking is periodic and I doubt if the frequency of updating would be available in public domain ( my assumption and open to correction )


Coming to the legality, this SE site doesn't deal with it but I am sure when you tick I agree on activating the device, you would have agreed to this ( Who reads them anyway? )


Wednesday, February 22, 2017

applications - How to transfer installed apps from one account to another


On my Note 2 I have two accounts configured


my.email@gmail.com
my.work.email@company.com


Usually I have the Play Store configured to buy/install apps under my.email@gmail.com but somehow it got changed to my work email a while back. Before I noticed this, I installed ~20 apps using the my.work.email@company.com


Is there a way for me to re-associate those purchases with my.email@gmail.com without manually reinstalling each app? And how will this be different for free vs paid apps that I installed while using my.work.email@company.com?



Answer



There's currently no way to do this. Free apps can be re-downloaded under the appropriate account, of course, but Google has no provision for moving paid apps (or free ones, in bulk) from one account to another. The Google Play support page has their official stance on this:




At this time, it's not possible to transfer apps from one account to another.


Some developers are willing to issue refunds for purchases on old accounts if you repurchase the app(s) using a new account. You can always reach out to the developer of an app, and you can find their contact information by following these steps:




  1. Visit Google Play and select the app in question




  2. On the app's description page, scroll down to the Developer section





  3. Find either an email address, phone number or website listed.





5.0 lollipop - Browser that doesn't reload tabs all the time


Is there a browser for Android that won't constantly reload tabs when switching between them? I'm using Chrome on a Nexus 5 (lollipop). And even when there are no other apps running it will reload any tab that I switch to. Even if I only have two open.


Or, I'm browsing a page. Open a link in a new tab and continue reading the current page. I can see that the new page has loaded, but when I switch to that tab it gets reloaded. And then switching back to the original one it reloads that one too.


This makes reading on the tube impossible as I can only pre-load one tab :/


I should note that I've factory reset my phone a couple of days ago and this is still happening every single time.



Answer



Turns out the problem is (it seems) a memory leak in Android lollipop. The OS was using well over 1GB of RAM, which caused all the tabs to constantly reload. I got suspicious when I noticed that apps also got reloaded immediately.


After restarting the phone, the problem is no longer there. It seems it's a known bug, but I don't know when it's going to be fixed.


Why is Play Store still asking for all app permissions on install on Android Marshmallow?


From everything I've read, when installing a new app from the Play Store under Marshmallow, it is supposed to just install with no permission questions (e.g. Slash Gear article). The app is then supposed to ask for each permission it needs as you run it.


This is not happening on my Nexus 5 which I updated via OTA to 6.0 earlier this week. When clicking install in the Play Store, still getting the massive list of permissions along with an Accept button. Is there a setting that is needed to make this work as expected?



Answer



I believe the app has to be made with API 23 (aka Marshmallow's API) and the user has to be on 6.0 Marshmallow or higher for what you want to take effect. However, you can still go into Settings - Apps and change each app's permissions individually, or go into Advanced under Apps (the gear icon) and change them by category.


Source: Android Developers - Requesting Permissions at Run Time


google keep - How can I export Samsung memos?


Using the built-in Memo app on a Samsung Galaxy Avant, I've created several memo files, and they are saved on the device and synced with my Samsung account. How can I export the memos as text files, or some other readable file format that lets me get the text into another program (e.g. Google Keep)?





Is there a way I can prevent the back button from going to the home screen?


One of my pet hates about Android is the back button. It is fairly unpredictable what it will do.


Depending on where you are, it can do one of three things:



  1. take the user up a page in the same app

  2. take the user back to a previous app

  3. take the user back to the home screen



Normally, I think the 1st and 2nd scenarios generally work pretty well. Even through I'm not sure where it's going to go, 90% of the time, it'll take me to where I want to go.


The last scenario is very frustrating and happens exclusively when I didn't realise that I was already on the first page of my app. It just dumps me on the home screen and I have to figure out how to open the app again. As far as I'm concerned I can't see any good reason for ever taking the user to the home screen when they hit the back screen - especially since there is a home button right next to the back button for that purpose.


Anyway, I want a solution to this. So is there some sort of app or some sort way I can program Tasker or another automation app to either



  1. override and cancel the Back button action if it'll take me to the Home screen. Either have it do nothing or display a message

  2. just disable the back button altogether if clicking it will take me to the home page.


I'm on Lollipop and unrooted.


However, although I want an actual solution for myself, I'd be interested in hearing of any solutions that are rooted or on other versions too.



Answer




Well, this is still (after investing so many hours) a half-baked (aka partial) solution. You want a message, you'll get a message. :) We need root access for the solution.


Note: Tested the solution on Android 4.2.1 but works on 5.0 as well.




At this point of time, the message will be received as a Toast and it has no effect on Back key.


For the purpose of example I'm using ES File Explorer and BetterBatteryStats to display a message on their default screen.



  1. Fire up Tasker and enable it.

  2. Go to VARS and create a variable as +%Catch (you can use a different name but keep the first letter capital (global variable)). Similarly, create another one with name %Any.

  3. Create a profile with application context and select ES File Explorer.



  4. Create a task under the above profile and then an action inside this task as +Code→ Run Shell and enter these details:



    • Command: dumpsys activity | grep mFocusedActivity | cut -d ' ' -f 6 | cut -d '}' -f 1 -- this command will output the focused activity (current app launched with its activity).

    • Check Use Root.

    • Store Output In: %Catch.

    • Save this action.



  5. Create another profile with application context inverse of ES File Explorer.



  6. Create a task under the above profile and then an action inside this task as +Variables → Variable Set, and enter these details:



    • Name: %Catch

    • To: The (you can put any word)


    This step will make sure that the variable %Catch doesn't hold the value (provided in during execution of step 4) after the profile in step 3 becomes inactive.



  7. Create a last profile under Event → New Window and choose Full Screen under Window Type -- I earlier had Toasts even for dialogs on Main activity. Full Screen option will avoid it.


  8. Create a task under the above profile and then an action inside this task as +Code→ Run Shell, and enter these details:




    • Command: dumpsys activity | grep mFocusedActivity | cut -d ' ' -f 6 | cut -d '}' -f 1 -- this command will output the focused activity (current app launched with its activity).

    • Check Use Root.

    • Store Output In: %Any.

    • Save this action.




  9. Create another action in the same task as +Alert → Flash, and enter these details:




    • Text: Don't back Disk :/ -- this is the message that will be displayed in the Toast. Choose wisely!

    • Tap + corresponding to If and enter %Any eq %Catch -- we're comparing the main activity name for our selected app with any window Android will open. If it matches, you'll see the Toast. Now you can see why we needed an extra "inverse app context" profile in step 5.



  10. Save everything and enable all three profiles.

  11. Note that I had to shift my Superuser app's root access Notifications from Toasts into Status bar notifications because the third profile will need root access every time Android will launch a window. Make sure you either disable your Superuser client's Toasts or change them into Status bar notifications. It was an invasive stream for me!

  12. Anyhow, launch ES File Explorer and see the magic. The default screen of this app will show a Toast to you. You open any other activity and it won't bother you. Come back to main screen of it and see the Toast again.

  13. You can have this behavior for multiple apps. Just choose your app in the profile we made in step 3 and 5. They are supposed to be added in OR context like ES File Explorer or BetterBettaryStats and Not BetterBatteryStats or ES File Explorer.


Some screenshots:



(Click any image for its larger variant)



No toast for any other app                     →                Default screen for BetterBatteryStats                  →


(No toast for any other app)                                                (Default screen for BetterBatteryStats)



No toast on dialog on same screen                    →                  Dialog closed and toast came back on main screen                  →


(No toast on dialog on same screen)                                      (Dialog closed and toast came back on main screen)



Toast on Default screen of ES File Explorer                    →                   No toast on dialog of the same screen                  →


(Toast on Default screen of ES File Explorer)                            (No toast on dialog of the same screen)




Toast came back as soon as dialog disappeared


(Toast came back as soon as dialog disappeared)




Commentary




  • The aforesaid solution didn't work on my device satisfactorily if the app remained in recent list (but OP is not concerned with it) and you happen to open it again.





  • You can get rid of app (and inverse) context based profiles if you use a string in step 9 in place of %Catch like com.estrongs.android.pop/.view.FileExplorerActivity (Main activity of ES File Explorer). The solution will be reduced to two steps. :D


    However, I would like things to be automated here, so why bother especially when you want to select multiple apps for the toast!




What else?




  • Every device more or less has a keylayout under /system/usr/keylayout. In my device the generic layout is named as Generic.kl. The relevant key is mentioned at


    key 158 BACK    WAKE_DROPPED


    If you put # in front of it and restart the device then the back key would be disabled. To remain at safe side, I swapped it with Meny key (key 139).


    This swapping can be very beneficial in Tasker. Unfortuntaley, the changes take effect only at next reboot which is very counterproductive for our goal. Let me know if it can be done without a reboot!




  • Xposed Additions(requires Xposed Framework) can remap or disable the Back key et al, but it has no explicitly callable activities (relevant to the goal) which can be utilized by other apps. Also, it doesn't even seem to store a database or a preference file. So I couldn't use it with Tasker to achieve the goal.




  • Secure Settings (another Xposed module) has an option named Kill back button but it seems to be available for Custom ROMs and so, I couldn't test it. Some folks say it does work and I too saw the plugin useful for the goal. Check it out if you've a custom ROM.





I'm open to Ideas here!


Tuesday, February 21, 2017

2.3 gingerbread - Can I locate my android phone?


I brought a new Samsung Galaxy Y inbuilt with Android 2.3.5 some month ago and sold it recently. But after selling I noticed that in that Android I left my email ID (email ID that is used to log in to android for the first time).


I don't worry about the my email ID as I have changed its password but Can I locate my android device with that email? or by any other way? on any Google Maps like service?



Answer




No, you would need an application like "Where's My Droid" installed on the device and know the phone number for the device.


If you sold the device, the new owner probably did a factory reset on the device so your information is no longer associated to the device.


In the future, before you sell your device, you should go in and do a factory reset so you are not giving the device away with any of your information.


I want to add my opinion on these apps that claim to help you find your device (including "Where's My Droid") if it is lost or stolen. They are great if you lost your phone in your house (or somewhere "safe") but if you lost it at like a bar or if someone actually stole it, chances are you will not even be able to use this software. A factory reset can be done on any device rather quickly, which would remove your "locating software" and remove any "tie" that your accounts may have to the device. Also, they require the device be ON, so if someone does steal your phone, all they have to do is turn it off, and when they have a chance, do a factory reset. My best advice I can give you is to remember that these are ~$600 devices (what you will pay off contract, or for a replacement) so treat it like it is a ~$600 device and don't leave it laying around. I am not saying that I would ever take someones phone or anything, but I could have the device factory reset by the time I got to the door to leave. It is as easy as Menu -> Settings -> Privacy -> Factory Data Reset.


Monday, February 20, 2017

backup - How to manually transfer entire Whatsapp installation to another device (the hard way)


I'm using Whatsapp from a virtual machine since I lost my phone, and now need to transfer it to a new VM.


The easy way would be to use the backup feature native to Whatsapp, but it is disabled since the VM is connected via Ethernet (and Android thinks it's a Mobile connection). In fact the very "local backup" feature is not available. I have a ton of messages which I really wouldn't like to lose.


There's an Xposed module which could possible fake an Wifi connection in the Android VM, but at this point I really want to do the entire transfer locally as my internet is painfully slow right now.


I tried the built-in adb backup feature, only to find out it's disabled for Whatsapp and can't be easily enabled (requires decompiling the apk file).


So, how can I manually transfer Whatspp app data to the new "device"? What folders do I need to copy, and what files must be modified in order for the transfer to work seamlessly?


I do of course have full root access.


[Update] Neither of the following work:





  • Copying the entire contents of /data/data/com.whatsapp/databases after installing Whatsapp, signing in and closing it. It will crash when opening, without any error message.




  • Copying the same directory, but without opening Whatsapp and signing in after installation. Same error as above.




  • Copying /data/data/com/whatsapp/databases/msgstore.db after installing Whatsapp and signing in. An error message is presented: "Something went wrong with your chat history"





  • Copying the entire /data/data/com.whatsapp directory, after installing and closing it. It will crash when opening, without any error message.





Answer



I was encountering the crashing behaviour trying these approaches too, but @DeathMaskSalesman seems to've been on the right track—the crashes are indeed a permissions issue.


If you remove WhatsApp entirely, reinstall it, and copy /data/data/com.whatsapp over and adjust the permissions correctly before launching it the first time, then it should just need to reverify your number to work. This worked for me.


To adjust permissions, first use ls -la to check the permissions on what's put in the /data/data/com.whatsapp directory upon install, e.g.:


drwxrwx--x   3 u0_a105 u0_a105  4096 2018-07-14 00:55 cache

Then use the username and group (here both u0_a105) to rename the files after you've copied them in:



chown -R u0_a105:u0_a105 /data/data/com.whatsapp/*

Then WhatsApp should launch okay without crashes, and retain settings, messages, and multimedia.


data monitoring - Why I couldn't monitor traffic from this page?


When I opened the capture log I found nothing from the page other than this when I first tried to visit it using http only, and then I get that security warning and i click proceed to unsafe anyway i still get nothing from that page although i have the root debugging certificate installed using HttpCanary


enter image description here


enter image description here




security - Help with compromised phone, Android 7.0


I want to ask if there's any way I can get rid of whatever's allowing my phone to be unlocked easily without any resetting or Google account?


My phone has been messed with and now it keeps getting unlocked no matter what I try, whether I put a lock-screen or change my Google password.



I don't think they would use spyware because it would cost money, but maybe they would but I think they did some configurations and/or exploited something in my phone for it to be unlocked easily.


Can anyone help me know what it is and tell me on how to get rid of it? Thanks




Sunday, February 19, 2017

App to allow me to set which contacts dial out with Google Voice by default?


I'd like to be able to set, at the contact level, which phone number is used to dial out. For example, I'd like to be able to set it so calls to my boss use Google Voice by default where as calls to my family use my cell number. Any suggestions?



Answer



I still haven't tried Voice Choice, but I just downloaded this free app: Voice Plus



This looks perfect. From the description:



Allows you to set rules for which number dialed will use your Google Voice number. Specify rules based on area code or by contacts (using contact groups). No more annoyance of having to press another button when dialing to choose where to call from!



Saturday, February 18, 2017

Is there a one-click widget to make my phone completely silent?


I currently use Mute All but it requires several clicks. I like the ease of Silent Toggle Widget but it doesn't turn of media sounds.


Ideally the widget would also turn of haptic feedback.




audio - Stream music on Android to Desktop speakers


The canonical location for my music collection is the Android phone (synced from Mac at work), and I have a Windows PC at home connected to the speaker system. Is it possible to play the music on Android, but stream (via bluetooth, wifi or USB) the audio to these speakers (via the PC)?



Answer



Try Twonky.



Instantly stream media from your phone to devices on your home network!




It can stream not only to you PC but to other DLNA capable device and not only music but photo and other stuff.


wi fi - What Android versions have captive wifi detection?


A captive Wi-Fi or captive portal being a Wi-Fi network that redirects all websites to a page, usually with a form to log in, enter a code, or accept some T&Cs.



My can detect when I've connected to a network with this behaviour, and brings up a to tell me, but my old can't. When was this feature introduced?



Answer



As best as I can tell on GrepCode, functionality relating to walled gardens (captive portals) was added to WifiWatchdogStateMachine.java in 4.0.1. I can't find it listed in the Android API reference to confirm exactly when it was added, but that would seem to match with your Nexus 10 having the feature but not your HTC Desire.


Turning off cell broadcast in HTC Desire 816


I have been receiving about 50 flash SMS a day, with my service provider name, from the number 50. As I read here, it might be a issue with activating and deactivating cell broadcast on the phone. However, I could not find the path suggested for the deactivation (Setting - Call - Other Call Settings). The option does not exist on this path. Any help?


Mobile: HTC Desire 816


Android Version: 4.4.2 with Sense 6.0




sony xperia tipo - How to easily change keyboard input application?


I have installed a Morse code input method. I believe I have followed the instructions to enable it (it's enabled in settings).



However, I don't seem to be able to use it anywhere in any input field.
I have an Xperia Tipo cellphone with the Xperia Chinese keyboard which I use often, in addition to the inbuilt English keyboard.


Possibly, I'd also like to install a French keyboard and be able to easily switch between all these keyboards, but for the time being, I cannot even use the Morse keyboard although it's installed and enabled. How do I get started? Thanks.


Edit:


Ok, I found the setting "Default" keyboard, where I can choose between Xperia Chinese and Morse input and the other keyboards I previously installed. If I choose 'morse' then I can use it. The problem is now that I must chose between one or the other, and have to come back all the way to the settings to change keyboards. Is there any way to easily change between keyboard applications? I.e. whenever I need one specific keyboard application (Chinese, English, French or Morse) rapidly switch to the proper keyboard from within the application I am currently using (browser, messaging or whatever...) ?



Answer




  1. On your Keyboard, hold the settings icon


Hold the gear




  1. Scroll Down and click "Change input method"


Select



  1. A list will come up with all activated keyboards. Choose one and then your keyboard will change to the selected keyboard. All without the need for an external app.


Select Input Method


Friday, February 17, 2017

4.0 ice cream sandwich - How to recover lost contacts from samsung galaxy s3


I was closing all my unused running programs on my galaxy S3, and suddenly closed the contacts app. When I checked my contacts afterwards they were all gone. But when I checked my call logs, the corresponding name for each number showed for few seconds, and then disappeared as though all contacts were deleted from the phone.



Does that mean it is stored somewhere in the phone? I tried recovering from GMail, but unfortunately I had not sync'd my contacts initially. Please help to recover as they were all my office related contacts.




privacy - How to share VPN connection with devices on hotspot?


I use a VPN on my Galaxy S8+ and I am looking for a way to be able to share my ExpressVPN connection via hotspot to be able to connect devices such as Xbox One and a Smart TV. Currently cannot use a PC and my router is trash so my phone is the last resort. What can I do? What are some workarounds?




performance - How to reduce number of screens on HTC Sense android phones?


I was wondering, is there a way to reduce the number of screens available with HTC sense phones to say 5? Just I find that 7 screens is excessive for my needs, and I heard I can get a decent performance / battery boost from having less screens.


So is there a way to reduce the number of screens without using a custom launcher (which I think gets rid of HTC sense?)


Currently I just have my two side screens blank, but that looks off when you zoom out, however I have found that even that has produced a noticeable improvement on my Desire HD



Thanks!



Answer



Unfortunately you can't change the number of screens and still use the HTC Sense UI. At least not in any of the versions I've seen.


You can uninstall it or turn it off, but then you won't have free access to all of the HTC widgets, if you like those.


If you really want the performance kick you'll get from less screens in total, and therefore using less RAM, you'll have to go back to Vanilla Android. Simply using less widgets, as you've done, will certainly help somewhat.


I feel you pain too, I really only need 3 screens for my favorite widgets and folders, but I kind of like some of the HTC widgets.


Thursday, February 16, 2017

wi fi - How to reach local computer via machine name instead of IP?


Developer here prototyping a mobile app, somewhat new to mobile:




  • I have a simple HTTP service running (currently) on my main laptop with machine name latitude.

  • Another laptop named vaio sharing the same WiFi network can access that service via http://latitude:8080 -- in other words, it can easily resolve the (current) IP 192.168.x.y (or whatever dynamic IP it has at that moment) of latitude somehow.

  • Now my HTC Android phones, connected to the same WiFi network, can reach the IP address of latitude so opening in its browser http://192.168.x.y:8080 works.

  • But I'd like to use the machine name here, too, like when I access the HTTP service from vaio, simply by typing http://latitude:8080 and have the phone resolve the current dynamic IP of latitude. This doesn't work, only get the standard browser error page: "Webpage not available".


Is there some DNS setting in Android I need to tweak? Haven't found anything from playing around with Settings, and a question like this is notoriously hard to google, too...


The One V has Android 4.0, and the One M7 has Android 4.2 in case that makes a difference.


(Note, this should work even when the Android is not USB-connected to my computers and is not acting as a WiFi Hotspot -- obviously, since it's consuming my main WiFi network anyway).




htc sense - How do I import all contacts from a SIM-card to an Android phone?


My mother have got a HTC Wildfire with Android 2.2.


Now I want to import all contacts from her old SIM-card to the phone. I did it and it worked. Then I switched to the new SIM-card, and now when I start the phone, the contacts has disappeared.


How can I import the contacts from the old SIM-card to the Android phone? This is a really annoying problem.




Answer



I found a pre-installed app on the HTC Wildfire Transfer Data that transferred all contacts and SMS from the old SonyEricsson phone, it was exactly what I needed.


root access - Use stock recovery to install superuser?


I am trying to use the stock recovery to install superuser.zip but it give me an error: E: signature verification failed


So I cannot root it by the superuser.zip


I Googled and someone said solution is to install CWM. However, when I try to install CWM, it require superuser privilege?!


Now I get into the loop CWM need superuser -> install superuser need CWM -> ...





Tuesday, February 14, 2017

camera - Is there any way to re-render a photosphere?


I took a photosphere earlier today, and went to the gallery to wait for it to render. While it was rendering, I switched from landscape to portrait and the gallery app crashed. I'm now left with the pre-rendered, non-stitched images.


Is there any way to force the gallery to re-render the photosphere? Or do I just have to re-take it?



Answer



Not a full answer (came here looking for an answer myself), but here are a couple of partial solutions I figured out so far, perhaps someone else can improve upon these.



  1. First of all, temporary files for the last few photosphere sessions can be found under /sdcard/Android/data/com.google.android.gallery3d/files/panorama_sessions/. You can extract these out and use an external program such as hugin to stich them. I tried this on a couple of photospheres and though they didn't come out great, I have at least something instead of nothing. I kept the files around and looking around for a good guide on using Hugin.


  2. I was able to trick photo app to reprocess them, but it didn't produce desirable result. This is what I did:

    • I connected the phone to my laptop and went into the directory where the session files are (via adb shell).

    • I identified the directory for my previous session

    • While the camera is still connected to the laptop, I started taking a new photosphere, took a couple of snaps

    • Identified the directory for the new session

    • Copied all files from old session directory to the new session directory

    • Ended the photosphere to trigger a processing.





The photo app did process the old images, but it doesn't reread the session.meta and orientations.txt and instead uses the data from the new session (must be cached in memory). The result is that you don't get a full photosphere, unless you complete the photosphere in the new session also, which I don't mind doing in the interest of saving the photosphere, except that I realized I had to capture the new photosphere in exactly the same sequence as before or the resultant image will all be out of place as it would be stiched in the wrong order.


Ideally, if there is a hidden task in the photo app to invoke the rendering, we should be able to trigger it on the old sessions folder, but I don't know where to begin.


cyanogenmod - My Android phone stuck at optimizing apps again and again


My Yu Yureka with Cyanogen Mod is Optimizing apps again and again but not starting. Is there a way to fix this?
Is tjere a way I can somehow enter safe mode and delete few apps?? Please help.




settings - Are there any downsides or risks to limiting background processes?


I enabled developer options on my Samsung Galaxy Grand Duos and then changed "Limit background process" option from Standard limit to No background process.



After that my phone is working fine, with no hanging problems or no slowness as before.


But my doubt is, will this change affect any process, updates, applications or anything which might cause an error or failure?



Answer



Setting this option forces Android to stop each process as soon as it is empty (that is, when no services are started and no activities are on screen for that app).


To be clear: this option won't stop apps that would normally run in the background from doing so. Your mail client will still run periodically to check mail, if it's configured to do that. Apps that use Google Cloud Messaging to receive push messages from Internet servers (such as Gmail and Facebook) will still be able to do so. The option would be better named "Cached background process limit", since it limits apps that would otherwise show up with that label in the apps manager.


Next time each app needs to start, Android has to load the app from storage, from scratch. This uses more power and takes longer than running it again when the process was in memory. This doesn't just mean when you start an activity from that app deliberately; it also means the email client has to be loaded afresh each time it wants to check email. Over time this can build up to a huge battery drain.


Because this is a development option, it can also trigger rare bugs in certain apps, and those apps' developers may not be keen to fix them. One example is that, on Nexus devices running 4.2.2, when this option is on, the in-built Calendar app will keep restarting itself with this option set, because stopping the cached background process causes the calendar's content provider to be removed, which causes a loop of services restarting each other to check for calendar updates. If this happens, the loop will run down your battery very quickly.


Monday, February 13, 2017

applications - How can I get a phone app on a tablet?


I have a brand new Galaxy Tab 2 that is apparently not compatible with my bank's tablet app. Someone on another forum mentioned that they just use the phone version on their tablet, but they don't say how they got it. When I go to the google play store, I only see one version. I do have the app on my phone; is there any way to transfer it?




cyanogenmod - How do I Install a custom ROM/recovery on a Galaxy Note 2?


I was trying to install CyanogenMod 12 Lollipop ROM on my Note 2. When I restart my phone in recovery mode, its giving me this screen:


enter image description here


After this I select the option "wipe data/factory reset" and then choose option "apply update from external storage" and when try to install, it gives me this error



failed to verify whole-file signature. signature verification failed




enter image description here


Please help me to solve this problem.




8.1 oreo - What is this icon in my status bar that looks like a finger pointing at 3 horizontal lines?


Can anyone identify this icon?


Screenshot


here again with context:



I can't find anything online and no one at Verizon or Kyocera can identify it either. I need help figuring out what this icon is and what it means.


I have contacted the Verizon Tech's, Kyocera and personally searched online, with no positive ID. Deleted all apps, factory reset, and even safe mode start up, and the icon remains at the top of the screen in the status bar. The only time the icon is not at the top of the screen is when you click on the drop down for the status bar icons. This phone is the newest Kyocera Duraforce Pro-2. Glove mode nor the underwater camera mode have any affect on the icon when switching these two selections on or off.


Any information on what this is would be greatly appreciated. Thank you for your time and help with this.



Answer



I mailed Kyocera linking this question and they replied very quickly.



It is a Verizon security app and Kyocera can't do a thing about it. Mail extract :



Allow us to inform you that this Icon is for a Verizon security application running on the phone, please be aware that this will not affecting its functionality. At the moment there is no way to remove the Icon.



Screenshot of mail below. You would need to chase Verizon for more details as to what it does but being a device tied with them, I guess you have to live with it.


IMG:


(Click to enlarge)


You can refer to the Tech Support Case Number: 00689640 and follow up with Kyocera (Phone.Help@kyocera.com) if you wish (The person who sent the email is Karla H, Technical Support Specialist).


Friday, February 10, 2017

How to stream audio from PC to Android Device over Bluetooth


I have a rooted Android Device running Android 2.3 Gingerbread and a PC(with Bluetooth dongle) running windows 7.


My mobile has Bluetooth with A2DP support. I want to output the audio(not just music) of my PC to my Android Device over Bluetooth. i.e. I want my android device to work as an Audio Output Device(like headset) for my PC.


How to do it?




Should the Data Saver Icon Look like Plus or a Pause?


According to this page, the data saver icon should look like a pause button.


However, on my nexus 6P (using android nougat), I get a plus icon instead whenever I turn on data saver. enter image description here


What does that mean? Am I understanding something wrong? Also, if I keep it on, does the data saver option (no background download, and limited app connectivity) when I am on an unmetered Wi-Fi?



Answer



It looks like Google changed it. According to a video on this page it should look like a plus sign.


Thursday, February 9, 2017

internet - Why network activity is detected from apps after VPN firewall blocks them?


A few non-rooted (no rooted) Android 7 and 8 phones from (Huawei, ZTE, Neffos and Samsung) were tested in this simple firewall (NetGuard) experiment. A selection of apps (including apps from the phone manufacturer) was chosen to be blocked from accessing the Internet regardless using Mobile Data or WiFi, by using NetGuard.


Before the experiment, NetGuard and GlassWire for Android were installed. The GlassWire is activated to monitor if these apps still can access to the Internet. Throughout the experiment, GlassWire reported that some apps, that were blocked by NetGuard, had network traffic to the Internet.


Therefore, it seems that users who buy any Android phones are denied full control of the phone, even if they have installed privacy protection apps such as NetGuard. So, to make the experiment fair enough, this question is posted here, requesting help from experts out there, on whether what is the actual problem(s).


Is the problem caused because GlassWire reports false positives? Or NetGuard requires special configurations in order to block Internet for selected apps? Or Android phones disregard users and allow apps to access Internet even though NetGuard was installed?




applications - How do I stop apps from installing themselves to my SD-card?


It seems that some apps default to saving to SD-card when they're first installed on Froyo rather than defaulting to internal memory, this is annoying because whenever I mount the SD Card as storage in Windows the icons for those apps disappear from my home screen, and I have to go into the apps list and find them to add them back onto the home screen. If I even notice they've gone.


I have a Galaxy S with over 1.4GB of internal memory free, so have absolutely no worries about apps taking up space on the internal storage, or running out of memory, so I'd like to use that space and save the SD storage for my files (ie pictures, movies and music).


Apps that had somehow moved themselves onto my SD Card when I checked just now were SliceIt and Open Signal Maps. In the past I remember that both Angry Birds and Angry Birds Seasons had done this too until I moved them back onto the phone (in fact I thought for a bit that Angry Birds Seasons had replaced Angry Birds as the original disappeared from the home screen around the same time that I installed Seasons, I then got suspicious a few days later when Seasons disappeared too and found them both on the SD).



Answer



Thanks to this answer to this question Is moving apps to SD only available to rooted devices?.



I've discovered the getInstallLocation ADB command and set the install location to internal on my un-rooted phone.


With the Android SDK installed, and my phone connected via USB with USB Debugging mode switched on, enter the following commands:


adb devices
(check that ADB can see my phone, and start necessary services)


adb shell
(connects a shell to the phone)


pm getInstallLocation
(returns 0[auto])


pm setInstallLocation 1
(sets the default install location to internal memory)



pm getInstallLocation
(run again to check that it is now set to the correct location, returns 1[internal])


exit


Safely Remove Hardware, unplug phone and all done, without any need for root!


6.0 marshmallow - How do I stop my device from sending my location to Google every second, even when the location setting is off?


How do I stop my device from sending my location to Google every second, even when the location setting is off? (Which is illegal because I declined Google from taking my location data because I turned it off and they still collect it anyway.)


Google was caught collecting location data EVERY second from android phones when the Location setting is turned off. Now I know why my phone battery is so terrible.


If I leave my phone stationary in my house on standby, it lasts 6-8 hours, which is bad as it should last at least 12 hours stationary on standby. If I go outside and move around, 40% of my battery goes in 2 hours so on a 100% charge when outside moving around, my battery lasts 2-3 hours. The battery drains faster when I'm moving around than when the phone is still, and it drains even faster when inside transport than walking. How do I REALLY turn location tracking off?


Before anyone says, "maybe your phone has a virus", it was like that with a terrible battery since I brought the phone with a fresh installation, and I installed every app on my phone from Google Play except for Gab.


I have a Samsung Galaxy S6 and Android 6.0.1


Update


I have made the exact same journey with my wifi, mobile data and location off and my battery only drained by 5% in one hour intead of 35% in one hour. As the mobile network tracks my location with all 3 off, the battery drain is not due to the location tracking by my network. It's also not due to any apps, as apps can only track my location when the location is on (of which a window appears asking me if I want to turn location on so the app can use it) and the location icon shows in notifications. Remember that my battery lasts much longer when stationary but abysmal when moving around.



How do I fix this problem?




boot - Android x86 Marshmallow not booting on Virtualbox and VMware Workstation


I've downloaded the latest Android x86 (android-x86-6.0_20160129.iso) from here and tried to install it to the HDD on a VM in VMware Workstation and in Virtualbox.


The installation seems to proceed properly (using EXT4, and EFI Grub) and i get a message that it has installed successfully. However when I reboot it passes GRUB, picks the correct Android installation, but it does not boot. I get the result seen in the screenshot below and then a blank screen with a blinking cursor.


enter image description here


I've seen somehow similar questions on Android-SE (here and here), but they use older versions of Android x86 and don't seem to have solutions that work for me.


The VMs in both VMware and Virtualbox have: HDD=4GB(IDE), RAM=2GB, 2 CPUs and they boot through EFI. I've tried nomodeset and xforcevesa in the Grub boot parameters but nothing seems to work.


The .iso does boot up though all the way to the GUI in Live mode (LiveCD).


Any assistance would be greatly appreciated. I have a feeling that the solution might be something linked to the graphics settings but i'm not exactly sure.




applications - Can the previous version overwrite the currently installed app?


Suppose the new version of APK of any project is currently installed on the Android phone, but I want to install my previous APK on the phone. In that case, what will happen? Will it be updated to the previous build or showing error?


If it's updated to the previous build, will it only show specific things from that build, or also include the current (latest) things?




Wednesday, February 8, 2017

rooting - Unable to Downgrade after upgrade to Android M from Android L


I upgraded my MOTO G 3rd Gen (XT1550) to Android M. After that I tried to root My Phone but unable to Root Android M. So I decided to Downgrade to Android L. But also unable to Downgrade.



Answer




I got a solution for Downgrading MOTO G 3rd Gen (XT1550) Android M to Android L




1) Extract the folder *.zip


2) Enter in the Extracted folder.


3) If "fastboot" not installed


Then you can download it from here Download Fastboot


4) Test fastboot by typing: fastboot devices You should see:


 fastboot

5) You are now ready to flash the fastboot files



Fastboot Commands:


"Do commands manually, one at a time - checking that each one returns an [OKAY]."

NOTE: system.img_sparsechunks may differ in number + name - Always check contents of folder you're working with.


fastboot oem fb_mode_set

If you want to Downgrade from Android M to Android L the Don't flash gpt.bin



fastboot flash partition gpt.bin <---- Don't Do this Step




fastboot flash bootloader bootloader.img

fastboot flash logo logo.bin

fastboot flash boot boot.img

fastboot flash recovery recovery.img

fastboot flash system system.img_sparsechunk.0


fastboot flash system system.img_sparsechunk.1

fastboot flash system system.img_sparsechunk.2

fastboot flash system system.img_sparsechunk.3

fastboot flash system system.img_sparsechunk.4

fastboot flash modem NON-HLOS.bin


fastboot erase modemst1

fastboot erase modemst2

fastboot flash fsg fsg.mbn

fastboot erase cache

fastboot erase userdata


fastboot erase customize

fastboot erase clogo

fastboot oem fb_mode_clear

fastboot reboot



For Rooting MOTO G 3rd Gen (XT1550) Android M





1) Flash(Permanent) or Boot(Temporary) with TWRP


You can download TWRP from Here Download TWRP




  • Flashing TWRP


      fastboot flash recovery {TWRP File's Name with extension} 


  • Booting TWRP



      fastboot boot {TWRP File's Name with extension}


2) Restart the phone in recovery mode (If flashed) <---- Those who use booted using TWRP Skip this step


3) Using TWRP flash the SuperSU


You can download SuperSU from Here Download SuperSU


Tuesday, February 7, 2017

uninstallation - How can I remove system apps / stock apps?




Possible Duplicate:
How can I uninstall applications that are locked by phone vendor?
How to remove pre-installed apps like Peep and Friend Stream from my HTC phone?



There are alot of stock android apps on my phone like Email, News and Weather etc. that I dont use. I really need the space because my phone is running low on memory so I am wondering if there is a way to uninstall them because I dont see that option in the Manage apps section.



Answer



these can only be removed if you root your device. And even then, some of them you would not want to remove as they tie in to the system.


Additionally, removing them will not free usable space for "non-system" apps. The /system is separate from where user apps are installed and the space is separate.



How can I force my Nexus One to upgrade to the official Gingerbread without waiting for the formal OTA update?


The OTA update for Gingerbread is being pushed out. But I'm in India and there's a good chance I'll be among the last people to get it. Is there a way to get that official update right now?



Answer



There is only one way. Keep checking xda developers forum for update.zip link. Once you get it download and update manually. This is the only way to get gingerbread update on your phone. Else it will take few weeks (as per google definition few weeks is 3+ months).


Monday, February 6, 2017

sms - Recover deleted content from userdata partition?


So it came to pass, that Amanda did have a blonde moment and deleted all her threads in the SMS app by mistake. Yeah, "Delete all threads" probably shouldn't be quite so easy to invoke.


The phone's a ZTE Blade, with all its user data inconveniently stored on a YAFFS2 filesystem.


I have an old back up, but the SMS I need to recover are from since then. There are probably some on the SIM card, so I've ordered a SIM reader. I suspect that the twenty or so it holds are mostly network operator spam, anyway.


So, I curse my ineffectual backup plan and vow to back up SMS to GMail in future.


Meanwhile, I resolve to recover mmssms.db, or what's left of it.


First up, I connect adb and check the mounts, then attempt to copy the block to an image on the SD card:


dd if=/dev/block/mtdblock6 of=/sdcard/data.img 

No such luck. I reason forcibly dismounting would be a bad idea, and probably won't work in any case.



So, I upload a statically linked copy of busybox to the SD card and use the conv=noerror option.


What I ended up with was a file that kept increasing in size until the SD card filled up.


What am I doing wrong? Does ClockworkMod take an image in the true sense or does it just back the files up and pack them into an image? Is there a YAFFS2 recovery program? (The two papers I've read make it seem feasible but I haven't seen even PoC code)


Any clues gratefully received/


Edit: The phone is rooted. Very rooted :)


Further edit:


Most of the messages found in mmssms.db-wal:


ls -al /data/data/com.android.providers.telephony/databases
drwxrwx--x 1 radio radio 2048 Jul 17 20:16 .
drwxr-xr-x 1 radio radio 2048 Oct 26 2011 ..

-rw-rw---- 1 root root 60416 Jul 17 20:16 mmssms.db
-rw-rw---- 1 radio radio 32768 Jul 17 16:18 mmssms.db-shm
-rw-rw---- 1 radio radio 628832 Jun 30 19:23 mmssms.db-wal
-rw-rw-rw- 1 root root 60416 Jul 17 20:16 mmssms.db.xxx
-rw-rw---- 1 radio radio 132096 Jun 18 13:25 telephony.db
-rw-rw---- 1 radio radio 32768 Jul 16 22:14 telephony.db-shm
-rw-rw---- 1 radio radio 106928 Jul 16 22:14 telephony.db-wal

With any luck, SMS Backup & Restore will allow a merge.



Answer




The sms database is stored in /data/data/com.android.providers.telephony/databases/mmssms.db which is what you want to do.


Best thing to do, is this, do not plug in USB cable yet:



  1. Reboot into ClockWorkmod Recovery.

  2. Go into Mounts and Storage

  3. Select mount /data

  4. Plug in the USB

  5. From the windows command shell or terminal, adb shell

  6. Since you are in ClockworkMod Recovery, you are root by default, now do this cp /data/data/com.android.providers.telephony/databases/mmssms.db /sdcard/MySmsDatabase.db

  7. exit out of the adb shell by typing in this: exit


  8. Now your database is copied to the SD-Card.

  9. Back out of ClockworkMod recovery and just reboot, the recovery will unmount /data for you.


At this stage your database is now copied across. And can be safely extracted via using something like SqliteMan. HTH.


Edit: The OP was interested to know how a dump can be done. - Read on :)


When you invoke this (with USB plugged in and within the adb shell)


sh-4.1# cat /proc/mtd
dev: size erasesize name
mtd0: 00500000 00020000 "recovery"
mtd1: 00500000 00020000 "boot"

mtd2: 00120000 00020000 "splash"
mtd3: 00080000 00020000 "misc"
mtd4: 02580000 00020000 "cache"
mtd5: 0d700000 00020000 "system"
mtd6: 0cb80000 00020000 "userdata"
mtd7: 00020000 00020000 "oem"
mtd8: 00180000 00020000 "persist"

Knowing which partition is the key.. So for example from my Blade, I can see that userdata is on the partition mtd6, in which the actual partition information can be found within /dev/mtd/mtdX so its a matter of doing this using cat:


cat /dev/mtd/mtd6 > /sdcard/myuserdata.dump


And from there, taking the /sdcard/myuserdata.dump, depending on the filesystem used on that partition, it can be mounted via loop-back. The mileage will vary and of course, its a chicken-and-egg situation, in order to do all of that, the handset needs to be rooted.


4.0 ice cream sandwich - Xperia Sola- Whatsapp Web not being able to scan the Bar Code


I have successfully managed to chat on whatsapp web two times, but since yesterday it just won't read the bar code. I have tried it horizontally and vertically, placed it for minutes and also tried moving the phone throughout the code so that it reads at least somewhere, but it just would not work. Advise.




Sunday, February 5, 2017

What's a good "if found" wallpaper for Android?


This is where I saw the terminology "if found wallpaper".


Basically, since we're all locking our phones, you want a wallpaper that contains contact information, in case it's lost. Is there such a wallpaper for Android?



Answer



Android OS versions 3.x and above (Honeycomb, Ice Cream Sandwich) actually have a setting that allows you to specify "Owner info" text that will show up when the device is locked.


There are also many 3rd-party locks-creen replacement apps that allow for much greater configuration flexibility than the stock one, including the ability to specify any text on the locks-creen. Take a look at WidgetLocker or Go Locker, for example.



For the "unlocked" state, you can always modify an image to include the "if found..." text, copy it onto the device's SD Card (or internal storage area), and set that as the wallpaper. You can use one of the myriad of free image editing software (e.g. Paint.NET) to add the text.


cyanogenmod - How can I reset my developer options, or otherwise boot my Galaxy S2 on CM10.1 again?


I have a Samsung Galaxy S2 and the ROM I'm using is CM10.1. I was messing with the Developer Options and I saw an option called "Simulate Secondary Display". I clicked that and selected 720 then it froze. I forced rebooted it and it stopped at the end of the boot animation and get stuck there.


Any ideas how to fix this, preferably without flashing a new ROM?



Answer



In this situation you have two options, which I'd try in the given order:


Safe Mode


Boot into Safe Mode (details for what Safe Mode is and how to boot your device into Safe Mode can be found in the article How to Boot Android 4.1+ into Safe Mode:



  • Method 1:


    1. hold down Power button until the power-menu pops up

    2. press and hold the "restart" option

    3. in the dialog box, select "Safe Mode" and hit "OK"



  • Method 2:

    1. Reboot your device

    2. hold the Vol+ and Vol- buttons at the same time to enter Safe Mode.





A "Safe Mode" watermark in the lower left corner tells you you've been successful. Obviously, you'd have to chose Method 2 as your device won't power up normally.


Now, while in Safe Mode, change the "Developer options" back to normal. Then do a normal reboot to leave Safe Mode.


Hint: If your device sticks in Safe Mode, power down and remove the battery for a few minutes. Then re-insert the battery, and the device should boot up normally.


Factory Reset


As a last resort, you can do a factory reset. Be aware that this will delete all your data, plus the apps you've installed yourself (i.e. the pre-installed apps won't be touched; your SDcard should also remain untouched). As your device still is unable to boot up normally, you can reset it via the recovery menu. Check your device's manual for how to boot into recovery; on many devices, this is done by holding the Vol+ and Power buttons pressed simultaneously until the device booted up to recovery. Other devices may use different combinations; so either try a few, try Google search, or search our site for it. Of course you can ask it in a separate question if you're still out of look ;)


samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...