Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

Question about .apk modding - possible to have it erase a database value on launch?

$
0
0
Hey guys,

I'm not sure if this is the best subforum to ask in, but I figured if anybody knew it would be you guys on XDA-devs.

I have a slightly modified Facebook .apk - what I did was take the last version before they bastardized the newsfeed and got rid of "most recent" (it's version 8.something), then open it up and remove a bunch of permissions that I didn't want it having. I left in obvious ones like GPS for checking in, but removed the stuff like "prevent phone from sleeping", drawing over other apps and other really obnoxious things that you normally couldn't opt out of.

I use it on a daily basis. I also hate Messenger - not only because it's two apps instead of one, but because of that same aforementioned issue... the drawing over other apps and there was no way to TURN NOTIFICATIONS OFF ENTIRELY, only for up to an hour. :mad:

Anyway, Facebook v8 already has a messenger built in. It's absolutely pointless to use the standalone one. However, there's a value that keeps being generated by their end that I can't control - at least not yet!
What happens is the first time you open messenger after signing in, it says "Upgrade to Messenger? Your friends are using it!" and you can choose "Not now" or upgrade. It does this for a day or two and then eventually the "not now" option goes away and it refuses to let you see your messages without "upgrading" despite the fact the app obviously has the ability to do it just fine.

After some experimentation, I discovered the fix. There are two values that get written in prefs.db (it's /data/data/com.facebook.katana/databases/prefs.db - not sure why prefs.db since it's not really a preferences but I digress)

If you open that up in SQLite Browser, there are three tables... open up "preferences" and there are two values:
/config/force_messenger/first_shown_1
/config/force_messenger/last_shown_1

Then there's a binary timestamp stored in another column in that row.
If I simply delete both of those and restart the app, it works!

But this is a bit annoying to have to do every couple days. I already have my development options set to force-close an app when I long-press the back button, so I was hoping it were possible to put a line of code in the .apk somewhere that just wipes those values, if present, when the app starts. There's nothing I can do about their server sticking those in there, as obviously they want to force people to use Messenger. I CAN just delete the values, though. :p

At the very least, some script I could set to auto-run (like kill the app and edit the .db) would work too, but I'm going to be getting a new phone soon and want to use it unrooted if possible... so I figured having this done from within the app itself would be a better idea.

Thanks in advance!

Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>