Custom Device - Google Play Compatibility - Java for Android App Development

Hello. I'm working on a custom device that is not on the market yet, and I am having issues getting it to work with Google Play. I have root access, so I was able to sideload GooglePlay.apk and GoogleServicesFramework.apk. However, I am forced to use Market Helper in order to download apps. I would like to bake in compatibility to the ROM itself, but am having issues.
I've tried modifying the build.prop to have dummy values for ro.product.{model,device,manufacturer}, as well as ro.hardware and ro.com.google.clientidbase. I feel like I'm close, but the device still fails to be accepted by Play without marker helper.
Any hints or advice are tremendously appreciated!

Sorry, can't help you with the problem.
But I am really interested in your custom device. Could you please tell us more about it?
Cool.

For those who encounter a similar problem, I will post the answer. Credit to (xkcd: Wisdom of the Ancients) for the idea.
edit: the policy of not posting outside links is really annoying. All links have the base: http: slash slash developer dot android dotcom , just add the relevant url and glue it together.
Anyway, here goes. Turns out the build.prop was not the limiting factor.
Explanation of the overall process:
- Developers create an app, and list certain features it depends on in the manifest.xml file located in the root of the apk. ( /guide/topics/manifest/uses-feature-element.html)
- When the Play Store is opened, a call is made to getSystemAvailableFeatures()
- This call is handled by an internal app called PackageManager - (/reference/android/content/pm/PackageManager.html)
-This app looks in /system/etc/permissions and parses the xml files to determine what hardware and software features the phone has. it then sends this list back to the play store. - see( /guide/practices/compatibility.html) and ( /google/play/filters.html )
- The play store then filters the apps, as per the links above.
How to modify this:
- What I’ve done is taken the files from /system/etc/permissions on a galaxy S2 Skyrocket (my personal device), and copied in all of them, without overwriting the already existing files. Now, google play works and allows the download of the same subset of apps as on the Skyrocket.

For those wondering how to include these files at compile time, here is the answer:
http://forum.xda-developers.com/showthread.php?t=2356046

Related

Android Privacy

Hi all, I have a major concern about privacy and all the 3rd party data collectors...
A lot of apps are uploading user info and stats to companies like Flurry, pinch media etc.
I'm about to make the move from iphone OS to android, and i'm looking for a opt out to keep my privacy intact.
Saurik creaded PrivaCy for the jailbreak community that enabled on\off toggles for the 4 major companies.
My issue on iphone was that Pinch Media alone gathered the following information without my knowledge :
* iPhone’s unique ID (imei)
* iPhone model
* OS version
* Application version (in this case, camera zoom 1.x)
* If the application is cracked/pirated
* If the iPhone is jailbroken
* Time & date I start the application
* Time & date I close the application
* My current latitude & longitude
* My gender (if Facebook enabled)
* My birth month (if Facebook enabled)
* My birth year (if Facebook enabled)
I want the option to chose weither or not this kind of info gets collected and distributed.
I've looked into this issue on the android platform, and it seems like there's no option other than not to install the app.
Take for instance Locale. To my knowledge it uploads my imei nr (+lot of other info) to Flurry, whilst i do see the developers need to gather info, and I do not see why my imei number should be uploaded at all.
When I get my android phone I can only chose NOT to install locale, but I just want to prevent it from uploading such info..
Can anybody create a toggle, preferably one that doesn't aquire root, or some guide as to hosts file editing, or a firewall app that will give me this control over my device?
regards
-e
just add a line in hosts file like the following for each website you want to block:
127.0.0.1 some.company.com
Fantastic, thanks mate.
Unfortunately I will have to have root permissions to edit the hosts file.
(it might take time before the htc desire gets root)
(edit: unless theres another way to get write permissions for that file..?)
If I do mess with the hosts file I'd be keen on adding a fair few entries to block ads too..
Since the hosts file gets loaded in ram at bootup, will there be any noticably difference in speed due to the size increase?
regards
-e
could you please post the host-file or the addresses/ip's of the companies your gonna block?
they should be of interest for everybody here
1. You will need root access.
2. The change shouldn't impact the performance in the least. Any local host lookup is always faster than DNS lookup. Meaning that it should increase performance in cases where it finds the match in hosts file, although I doubt if you will notice it.
3. I wouldn't worry about RAM. The host file, even if you add a hundred entries, given that each line consumes 100 bytes, should still be under 10kb.
Great to hear. Thanks for the replies.
@fabsn: I'll post my hosts file as soon as I get this working.. (gimme a few weeks to get my phone, move to android and root
Although: I'd be keen on using the adblock app in androidstore (the one that modifies the hosts file), but my manual changes will break every time I update the app.
I'll try to get hold of the dev to se if he/she might add these info collectors (like Flurry) in another version so that people can get "the best of both worlds"
By the way: I wish all devs that utilizes info collection in their apps could just provide users with an opt out, then my problem would be solved...
-e
http://textbin.com/x6430
Here is a complete "phone home" list for the iPhone. A lot of this will directly apply to android as well, so perhaps a nice soul here at the forum could compile the most useful adresses for me (I'm writing on my phone and it's a b**** to do this on)
the list is taken from: i-phone-home.blogspot(dot)com/
so credit goes to that community.
I really want to combine this with the hosts file that jamesisbored/droid has for adblock..
I will test this once desire hits my mailbox and someone finds root.
-e
This sounds like a great idea. Once a comprehensive list is compiled it should be passed on to "bigtincan". I know myself and a lot of other people use their "ad free" app to block ads using the same method mentioned by Ady above. Although they may be blocking them already and I don't know. I've never looked closely at the host file.
http://bigtincan.com/downloads/android.html
Any progress made on this end?
ady said:
1. You will need root access.
2. The change shouldn't impact the performance in the least. Any local host lookup is always faster than DNS lookup. Meaning that it should increase performance in cases where it finds the match in hosts file, although I doubt if you will notice it.
3. I wouldn't worry about RAM. The host file, even if you add a hundred entries, given that each line consumes 100 bytes, should still be under 10kb.
Click to expand...
Click to collapse
I am new to modding my phone, would you be so kind as to go into more detail how to do this. Specifically, what is this "Hosts file" you speak of? I do have root access and searched my entire phone for a file like that with no joy.
Also, the links provided to possible host data do not work, can somebody update that?
Thanks!!!:laugh:
You may be interested in the MOAB (mother of all adblockers) thread here on xda. Best ad blocker out there, imo, if you haven't already. Sorry, I can't link it now.
Sent from my SCH-I545 using Tapatalk

[XAP][Source] Webserver v0.6.0 (File uploads)

Version Alpha 0.6.0 is now available
I'm back! Not dead yet, I promise. This is actually a relatively small update in terms of user-facing features, with only one really big new thing - support for file uploading - but that's a lot bigger than it might sound. It's the first write support I've implemented in the server, and it also required some fairly massive updates to the HttpServer component (support for binary requests, for POST parameters, for MIME multipart parsing). These will be built upon in forthcoming versions to add support for things like registry editing, in-browser file viewing (possibly editing), and so on. There are also a large number of small fixes and improvements that I've made over the last two-weeks-shy-of-a-year, which should make the server faster, more robust, better able to support concurrent connections, and lighter on device resources. Finally, while the app still targets WP8.0 and should run on 8.0, it now is designed for 8.1 compatibility (especially the AllCapabilities version).
Previous update (0.5.6): This version is mostly bug fixes and UI changes. The biggest changes are: clearer display of weird registry data types, the server now consumes fewer threads (it used to spawn them with wild abandon) and does faster string compares, the app version is now shown on the phone, error pages are now better, if you launch the app without a WiFi IP address it'll offer to take you to the WiFi settings page, connections are no longer closed as soon as the app starts sending a response, and the server now defaults to using the Connection: keep-alive header, with a two-minute timeout. The last change, combined with the second-to-last, should hopefully both do away with the tendency to have the app fail to display a page. However, I shouldn't have *needed* to switch it to "keep-alive" - using "close" should have worked - but it still veeeery occasionally would kill the connection early. Agh. Anyhow, this is better in the meantime.
DevDB offers me a support / Q&A thread. Please use that thread to ask questions; don't PM me unless it needs to be kept private for some reason!
ISSUES ON WP8.1:
It *should* work to deploy the app with "Application Deployment", but if you have a problem try deploying with "Windows Phone Application Deployment 8.1" instead.
Problems have been reported in the past when the app is installed to the SD card. It's small, though; putting it on internal storage shouldn't be a problem.
RESOLVED The AllCapabilities version included a few capabilities that were present in 8.0 but removed in 8.1. Those capabilities have been removed; the AllCapabilities version now deploys and runs on capability-unlocked WP8.1 phones.
IN CASE OF OTHER ISSUES: Please provide a *detailed* error report - what phone and OS version you have, what hacks you've installed, what Webserver version you're running, what you do to get the error to occur, and exactly *what* occurs - and I'll fix it as soon as I can! There's a DevDB section for posting bug reports, and you can also use CodePlex if you want.
I finally implemented file upload! I'll work on getting more stuff like that (file delete, possibly file rename/move/copy, various registry edits), hopefully soon! I also hope to add support for different areas, like an "Applications" path, a "Processes" path, a "Services" path... eventually. Many of those are really hard without good privileges. I'm also looking at moving the server to a background process and making the app just a control UI for it, adding support for authentication and/or HTTPS, adding some stylesheets to the web UI, adding caching, and much more. I did finally implement Connection header support.
Once again, the XAP is published twice. One is a fairly standard XAP that any phone can sideload, and the second has many exotic capabilities to enable viewing of (and writing to) slightly more of the file system and registry. The standard XAP has had its list of capabilities expanded to pretty much all of them that can be used without interop-unlock. The high-capability variant requires not just interop-unlock, but the additional capability-unlock hack available in the interop-unlock thread. The AllCapabilities version now works with WP8.1; sorry for the long delay on that!
An item of note: the AllCapabilities version (or either version, on WP8.1) can open other drives in the file system. On phones with an SD card, it is mounted at D: and you can browse it as normal. Credit to @hjc4869 for this discovery!
DESCRIPTION: This is a simple webserver app which can enumerate those files that are in folders readable from the sandbox, can download and upload (access permitting) files, can browse the registry, and can display the contents of registry values of any type. It runs on WP8.x (not yet tested on W10M). It is a spiritual successor to the Functional Webserver / WebServer (Mango) projects from WP7. This version is still missing a lot of functionality as I decided to implement it from scratch, but it is advancing swiftly. Note that there's no access controls implemented; use it on a public network only at your own risk!
Instructions are simple: sideload the XAP, connect to WiFi (required), run the app (called "WebServer Native Access"), point a web browser (on a PC or phone that is also on that local network) to the URL that the app displays. You should get a basic index page. Click on a Filesystem or Registry link to begin browsing the phone. There's a textbox near the top of all filesystem pages, type in a path there (for example, "C:windows" with no quotes) and hit Enter or click Get Files. You'll see a list of the contents of that folder. Click on a file to download it or a directory to open it. There's also a box for uploading files, one at a time, to the current directory. Navigating the registry is similar, except you'll need to specify the registry hive and then the path from that hive (or no path, to access the root of the hive).
As of v0.6.0, uploading files is finally supported! Other modifications (editing files, creating, deleting, or changing registry keys or values) are currently not supported. They will be "soon" although my personal testing suggests that basically the whole registry, and most of the file system, is off-limits for writing unless you use restricted capabilities.
You might see an error code (error 5 is "ACCESS_DENIED", you'll see it a lot; I should replace it with an appropriate 403 or whatever). Or you might see a status 500 message because of an exception in the server. Or the server may just crash (hopefully not so often anymore...). I'm making it more resilient, but there are still bugs. Please report any previously-unreported issues you find, including how to reproduce them, and I'll fix them if possible.
Also feel free to request features or changes; I'll implement them if reasonably possible. The app is a mixture of C++ and C# code; I could probably have done it all in one or the other but wanted to have a C++ component in case I ran into something that wasn't available in C#, and although it probably would have saved some time, I decided that hacking up a web server in C++ was maybe not the best idea.
The source code is on Codeplex, at the following projects: https://wp8webserver.codeplex.com/ for the server and the app (C#) and https://wp8nativeaccess.codeplex.com/ for the native access wrappers (C++). You may have to fix up the reference paths to get the C# component to see the C++ component correctly. The code is reasonably well documented, but let me know if you have any questions. Permission to re-use the code or components is granted under the MS-PL (Microsoft Permissive License) as posted on Codeplex.
Go forth and find cool stuff!
Version history (see the git commit logs for more detail:
07 July 2013 - 0.2.0: Initial release, FS only, 920 downloads (source: 652 downloads)
14 July 2013 - 0.3.2: initial registry, HTTP server and web app encapsulation, source on Codeplex, 225 downloads
0.3.3: bugfixes, 454 downloads
0.4.2: basic registry values display, 86 downloads
0.4.3: bugfixes, 326 downloads
0.4.6: multistring registry values, bugfixes, updated libraries, first AllCapabilities version (950 downloads), 453 downloads
25 Oct 2013 - 0.4.8: binary and long registry values, formatting and bugfixes, 451 downloads AllCaps, 201 normal
22 Dec 2013 - 0.4.9: all registry value types, better threading, proper resume, remembers port, 97 downloads AllCaps, 53 normal
24 Dec 2013 - 0.5.0: background operation using Location APIs. Downloads: 1011 AllCaps, 963 Normal
20 Jul 2014 - 0.5.1: More capabilities, better navigation. Downloads: 358 AllCaps, 352 normal
07 Aug 2014 - 0.5.3: .REG export, better traversal, bugfixes. Downloads as of 0.5.5 release: 260 AllCaps, 164 normal
10 Oct 2014 - 0.5.5: Bugfixes and back-end work. Downloads as of 0.6.0 release: 140 AllCaps, 113 normal
25 Oct 2014 - 0.5.6: Bugfixes and UI tweaks. Downloads as of 0.6.0 release: 1720 AllCaps, 1334 normal
12 Oct 2015 - 0.6.0: Binary requests, file uploads, bugfixes.
XDA:DevDB Information
WebServer Native Access, Tool/Utility for the Windows Phone 8 General
Contributors
GoodDayToDie
Source Code: https://wp8webserver.codeplex.com/
Version Information
Status: Alpha
Created 2014-10-17
Last Updated 2015-10-12
I'm going to use this space to mention something that's pretty cool:
J. Arturo of http://www.komodosoft.net is using a modified version of the HTTP server that powers this app in the ShareFolder app (http://www.windowsphone.com/s?appid=e2b9c82e-eaa1-4a3b-9d4a-8a2933a8bdb4) to support opening video files directly from Windows network shares! This was done to work around a limitation of the WP8 media control: it can only source from an isolated storage file or a HTTP URL. By running a server in the background and streaming the video file through it, and pointing the video player control at the localhost URL, it becomes possible to play the file on the phone without first copying it to the app's isolated storage. A very cool way to solve the problem! Also, reviewing the changes that were made to the network code of the server pointed me toward those threading fixes I made that have hopefully much improved version 0.4.9.
Please note that the updated version of ShareFolder with this feature may not yet be available, although it should be soon. It is a commercial (paid) app, but the author sought and received permission to use my code (although the license does not require such permission be received).
What exactly is the problem with sockets? I am battling myself with sockets atm too, maybe we can share knowledge?
Strictly speaking, the problem was with the phone's limited subset of the Sockets API forcing me to access it through functions I wouldn't normally use (asynchronous everything, SocketAsyncEventArgs and lambdas and AutoResetEvents and so on everywhere...) but I've got a pretty good handle on it now, at least for the System.Net.Sockets.Socket and its friends. The new .NET 4.x ones (using the async keyword and all) are in a different namespace; I didn't mess with them. They are more abstracted from the Bekeley sockets interface that I'm used to from C, but they are also (supposedly) more user-friendly, especially if you don't feel like writing all your own thread management code (and in fairness, I should re-write the webserver's threading to use threadpools; they're better for this type of work).
If you want to ask questions about the topic, I suggest starting a new thread (possibly in the Q&A subforum, although it's also dev related...) and I'll answer if I can.
GoodDayToDie, just an idea: how about sharing your source code via CodePlex or GitHub?
Oh man, this is pretty nice! GoodDayToDie does it again!
So far, I can read \Windows, the current install folder which you access just by typing "." with no quotes and the current application folder by typing ".." I can access the .dlls, .winmd and AppManifest.xml from the current install, but from everywhere else, it goes boom. This is a great step towards something awesome though!
EDIT:
I was wrong. For some reason, when you click on a folder it's trying to "download" it, rather than chdir. I can get pretty far into the Windows directory.
THAT's what you meant by "Click on a file (note: there's no current way to tell the difference between files and folders) to download it.
You might see an error code (error 5 is "ACCESS_DENIED", you'll see it a lot). Or you might see a status 500 message because of an exception in the server. It's getting a lot more resilient but there are surely still some bugs. ".
If you see a folder, just type the full path to it instead of clicking on it and you will be able to read the contents.
ANOTHER EDIT:
I just found a file inside of the \Windows\System32 directory named [guid].devicemetadata-ms (It's easier to just search for "devicemetadata-ms"). It's a cab file with some metadata about WP8 with a sign.cat and packagesign.cat file in the archive. I don't know what these files could potentially be useful for.
New version in a day or two (busy tonight). Features I plan to implement (not necessarily in the next version or at any particular time):
File upload (IsoStore and, of all crazy things, install directory are writable. I think I'll put a flag on each FS page that says whether the current dir is writable...).
File deletion (where possible, of course).
File and Directory distinction in the listing (clicking a dir should open it, not error out).
Filesystem index page with links to folders that can be accessed successfully (since the root isn't readable).
Some more file info (size, probably attributes, possibly permissions).
Possibly an option to preview a file (as plain text) without downloading it.
Some kind of background mode (the server uses minimal resources when not actively servicing a request, so I'll see if I can get it to work in the background, perhaps by abusing the music transfer agent...)
Some kind of offline mode (at least basic file browsing within the app, as an alternative to using the web interface, though I might just make a second app for that).
Source code changes: separate the server code from the webapp / phone app code (move it into its own project).
Source code changes: move to a hosted version control service, probably CodePlex (good suggestion sensboston).
Maybe add an icon and such...
Any other suggestions?
I also want to try experimenting with various non-standard capabilities and see if I can get access to more of the system . I've already added the ability to access removable storage, but I've also found a bunch of really weird and frequently undocumented capabilities in the OS's policy configuration files, and I need to look into those... The interesting (and possibly the uninteresting) ones are probably blocked for unsigned sideloaded apps, but it's worth checking on anyhow.
Yeah sorry, I should have been more explicit about clicking on dirs. not working in 0.2.0. Also, it's "unofficial" but if you check the URL bar you'll see a URL parameter called something like "pattern" (by default, it's *) and if you change that, you can filter the results. For example, "foo*.exe" (note: no quotes!) will search for EXE files whose names start with "foo". Among other uses, this makes it a lot faster to load large dirs like System32. This will be added to the UI at some point. Also note that URL decoding is applied correctly to querystring parameters (Probably already noticed with the path sometimes written using %5C for \) so you can add special characters that way if needed, though currently any of them but \ will probably just cause an exception.
...
Actually, does this filesystem support Alternate Data Streams? If so, you should be able to download them by appending a : and the ADS name to the filename in the download URL...
OK, so that was a new version in five days. Sorry, stuff takes time.
The source code is now on Codeplex. The native access portion is at https://wp8nativeaccess.codeplex.com/, and the web server portion is at https://wp8webserver.codeplex.com/. Both are licensed MS-PL and use Git for version control. The full XAP is also available for download from the Webserver project on Codeplex.
GoodDayToDie said:
OK, so that was a new version in five days. Sorry, stuff takes time.
The source code is now on Codeplex. The native access portion is at https://wp8nativeaccess.codeplex.com/, and the web server portion is at https://wp8webserver.codeplex.com/. Both are licensed MS-PL and use Git for version control. The full XAP is also available for download from the Webserver project on Codeplex.
Click to expand...
Click to collapse
You are a god. I'll be sure to post my findings .
Hmm. When I first load up WebServer File Access then access from my laptop, I get the main page then the program crashes on my phone. It seems to hold a lock on to the socket as i can no longer access port 9999 from any other device when re-opening the app. I can access it again when I reboot, but the same thing happens.
EDIT: I think it may be due to the WiFi at work... it's junky. I'll try again when I get home. I was just able to browse some directories.
Wow, that's completely unexpected... I can beef up the error chacking and handling around the listener port though. That part of the code is really straightforward, so I actually haven't hardened it very much. I can also put in a Finally block to close the socket and/or mark the socket as re-usable so that other apps (or the same one again) can listen on it in the future.
I also plan to add support for setting your own port, but that doesn't solve the underlying problem. I'll put in more error reporting as well, to enable better debugging. Thanks for the report! Always good to have users report problems so I know where to prioritize fixes.
GoodDayToDie said:
Wow, that's completely unexpected... I can beef up the error chacking and handling around the listener port though. That part of the code is really straightforward, so I actually haven't hardened it very much. I can also put in a Finally block to close the socket and/or mark the socket as re-usable so that other apps (or the same one again) can listen on it in the future.
I also plan to add support for setting your own port, but that doesn't solve the underlying problem. I'll put in more error reporting as well, to enable better debugging. Thanks for the report! Always good to have users report problems so I know where to prioritize fixes.
Click to expand...
Click to collapse
I tried the app at home and it DOES crash on the first hit of the home page, but I'm able to open it up again and it works fine.
The new version 0.3.3 should be more rebust; try it and let me know if you still have issues. If you do, let me know what the exception message is (and any other info you can provide) and I'll try to track it down.
Downloading really big files should also work now. The app will read and push files in smaller chunks (the code to do this existed in the NativeAccess library before, but wasn't used).
a simple SDK?
Dear Sir
Will it be possible for you to make some sort of SDK from this so other developers can integrate this into their apps and enable browsing isolatedstorage?
Sorry if it is a stupid question.
Bruce_X_Lee said:
Dear Sir
Will it be possible for you to make some sort of SDK from this so other developers can integrate this into their apps and enable browsing isolatedstorage?
Sorry if it is a stupid question.
Click to expand...
Click to collapse
With the restrictions in permissions, this app only allows browsing of the app's isolatedstorage locally. You are able to use the IsolatedStorage API within your app to browse files and directories already.
snickler said:
With the restrictions in permissions, this app only allows browsing of the app's isolatedstorage locally. You are able to use the IsolatedStorage API within your app to browse files and directories already.
Click to expand...
Click to collapse
That's right. What I want is to allow the end user to be able to browse the isolatedstorage. Imagine I have a video download app, I want the user to be able to transfer those downloaded videos from the app's isolated storage to, say, a PC.
One can do this by integrating the webserver code into the said app.
Bruce_X_Lee said:
That's right. What I want is to allow the end user to be able to browse the isolatedstorage. Imagine I have a video download app, I want the user to be able to transfer those downloaded videos from the app's isolated storage to, say, a PC.
One can do this by integrating the webserver code into the said app.
Click to expand...
Click to collapse
Ahh I see what you mean now. That sounds like a pretty nice idea. I think more research needs to be done to see whether it would even be allowed in the marketplace.
The webserver portion is stand-alone (builds to its own .NET DLL with no dependencies on the other parts) and has a pretty clean interface. You'd need to implement the web application portion of it yourself - the thing that generates the response pages for a given request - but the HttpResponse class in the server does a lot of the work of that for you; you basically just specify the content you want to send (as a String or byte array) and it sends it.

Apk copy/extracting/backing up protection

I hope that this is not the wrong place for my post.
I am trying to protect an apk from being copied/extracted/backed up off the phone and installed later, on another phone.
I have to mention that the app is not (and will not be) for sale on PlayStore or on any web store, being sold along with the phone. This is why I can not use apk protection offered by GooglePlay, which is anyway cracked at his time.
But I want to take advantages on this situation: every single phone will pass trough my hands (I will install myself the app) before hitting users. How can I use this advantage in order to protect my app?
At this time my app is not visible in Running Apps drawer, is having a default Android icon and the name is disguised in something pretty innocent. GUI access by dialing a code. No worries, is not malware but only a security app regarding GSM connection security.
Also, is running as a system app, which make it invisible for apps like Astro file manager, thus impossible to copy/back up by such file manager apps. Unfortunately there are a bunch of system app managers, that can convert a system app on user app, and then copying the apk file is easy.
I know that security sucks big time when it comes about Android OS, but I am determined to find a way to protect my app.
I know also that even a licensing scheme based on IMEI, WiFi MAC or Bluetooth MAC addresses can be bypassed by some skilled crackers. This values can be spoofed or even null.
I have tried apk encryption. Doesn't work: some apps supposed to encrypt other Android apps are actually encrypting only app libraries, not the apk file itself. By encrypting apk file, the app obviously will not work.
Code obfuscation is not an option as long the app can be duplicated off the phone and installed later on another phone.
The last idea that I had: pulling some app resources (like drawables) from a server. What do you think?
At this time I'm in a dead end. I have no more ideas how to protect my app. That's why I need your help. Can you give me please some feasible ideas, based on your huge experience?
Thank you very much for your time.
theres a thread
http://forum.xda-developers.com/showthread.php?t=2279813
where we're discussing about methods to protect apps from piracy u can post it there
Sent from my GT-S5302 using Tapatalk 2
Thanks
Thx a lot sak-venom1997.

KODI with - amazon voice search :D (proof of concept)

Hi Guys,
I managed to root my FireTV a few days back, and yesterday decided to look at the voice search to see if I could use it for other things.
After reversing some code, I found the actual voice search is handled by com.amazon.vizzini.apk
The SearchOverlay.class has this piece of code, which calls back to the amazon fireTV UI SearchResultsActivity upon completion with the search result returned as a string.
I replaced the fire TV UI with my own code, which receives the search text, and then sends a JSON rpc to KODI's web interface, and brings KODI to the front after the search is completed.
Here is a video of it in action.
http://youtu.be/hpgKci_gJYY
android studio project
http://uptobox.com/ccykod7zua1l
mirror
http://www107.zippyshare.com/v/mAhl3UuM/file.html
***** I have a FireTV v1 updated to fire os 5 ******
I have no idea if this will work on older versions of software.
To make it work you will require ROOT, and you will have to uninstall or move the existing fireTV amazon UI.
Reason for this is that the vizinni.apk calls back to
localIntent.setComponent(new ComponentName("com.amazon.tv.launcher", "com.amazon.tv.launcher.ui.SearchResultsActivity"));
So your activity has to be in that package, and called SearchResultsActivity.
The only other way to possibly get round this would be to modify the vizinni.apk to call a different package instead, but then voice search wouldn't work on the amazon UI anyway. I wasn't really bothered about the amazon UI working myself which is why I did it the way I did.
I just moved the original system/priv-app/com.amazon.tv.launcher/com.amazon.tv.launcher.apk to /system then installed my code via android studio.
mount -o rw,remount /system
mv /system/priv-app/com.amazon.tv.launcher/com.amazon.tv.launcher.apk /system/
You will also need to change KODI's settings to enable web interface control on port 8080.
On my setup it was .. system.. services.. webserver.. and tick the box that says "Allow control of kodi via http" and make sure the port is set to 8080.
edit: 07/07/2016
I did start work a few months back on an Xposed module (works but not 100%), I was going to add a settings page but I think there was issues with xposed on android version that the fire tv runs on, due to permissions etc.
You can set a prefix in the code (currently hard coded to KODI) so if you say " kodi star wars" it would pass the param of "star wars" to kodi.
If you just say "star wars" without the prefix it would pass this to the normal amazon UI.
If anyone wants to take it further, it's attached on the link below.
http://uptobox.com/ensqll4a7r65
Mick
Thats actually pretty great.
Conventional wisdom was that both voice recognition and response "results packaging" was done server side - and the only return query you could get were preexisting amazon database references - not the result of the initial voice recognition.
I've actually read that multiple places - but as it turns out, no one had bothered reversing the process I guess.
Major props and thank god for overlays containing strings... Finally - that microphone might not be so useless after all..
Next step - implement it to interface with google search. (Weather in ...)
edit: Actually - there are three interesting usecases I can think of on top of my head...
1. Launch other Apps (maybe even with "fixed Keywords (App 1 f.e. would work edit: "Number 1" delivers better results. )" if App names arent known to Amazon) - so thats text>launcher app - see if sphinx02 has any interest in coding that as part of Firestarter..
2. google search (Whats the weather in.. ) text>google search app (if possible)
3. direct text input as seen in the POC video
edit 4. forward to Amazon - not to "break" their implementation
This could be realized by a quick 4 way select screen (just confirm with the direction button) after you select the string in the overlay.
great find and implementation. would love see more expansion as above post mentions. Are you planning to share fire tv UI code?
I was playing with voice search strings and found that Amazon tends to strip out "Google" in front of search queries -so instead of "Google how is the Weather tomorrow" only "How is the weather tomorrow" will get returned.
But - Alexa as a trigger word will be returned fine, so - I vote for using "Alexa" as a trigger word to forward all search queries to the google search app.
Ok - maybe not - but conceptually, this would be a great "work of art".
An even better idea than Harklekinrains' would be to check the foreground app and do different things based on that. For example, if Kodi is open it could send the intent to Kodi. If the Fire TV launcher is open it could fall back to default functionality, etc. Simulating keystrokes could also cover 99% of the other applications. I'm excited for this. It really makes the Fire TV so much less of a novelty.
I've just updated the original post with a copy of the android studio project, and a few more details.
Mick
Great mate,thanks! gonna check it out soon!
One question (as im not firm with intents and stuff): aint there a possibility to listen for intents sent to the amazon ui and catch them? Personally, i dont care too much about it right now as im using nothing but kodi, but maybe some day when wanting to use prime or similar stuff?
dafunkydan said:
Great mate,thanks! gonna check it out soon!
One question (as im not firm with intents and stuff): aint there a possibility to listen for intents sent to the amazon ui and catch them? Personally, i dont care too much about it right now as im using nothing but kodi, but maybe some day when wanting to use prime or similar stuff?
Click to expand...
Click to collapse
I don't think so as the actual code in the vinizzi apk is as follows:
Intent localIntent = new Intent();
localIntent.setComponent(new ComponentName("com.amazon.tv.launcher", "com.amazon.tv.launcher.ui.SearchResultsActivity"));
localIntent.putExtra("identifier", null);
localIntent.addFlags(402653184);
localIntent.putExtra("term", str);
localIntent.putExtra("text", str);
localIntent.putExtra("source", "VOICE");
localContext.startActivity(localIntent);
So basically when it receives the voice search response from amazon's server, it's starting the activity com.amazon.tv.launcher.ui.SearchResultsActivity from package com.amazon.tv.launcher
Mick
Integrating the search attempt based on the previous foreground app would mean that "voice search" could never "initate a new attempt". This would prevent the "lets just ask google, or lets launch an app - impulse use" of the feature. Still - in the long term it might turn out to be the right approach - f.e. if
"People tend to use the the google search only lets say "half a dozen times", and in the majority of cases just want text input in Kodi" Also - without having a select screen with "four (dont make it too many) predefined "use options"" discoverability is pretty non existent. People would have to read readmes to find out which interactions are supported.
Also Amazon wants you to "be able to always reach the Amazon content search from anywhere" - so, political implications.
Also - each time a new app would want to integrate the voice to text feature - they would have to contact the devs of this project - if you dont use "just text input" as a default in the "use the previously open app as an indicator of intent" approach. So make sure you default to "just text input" in that case. (Amazon launcher > forward query to Amazon (do not break functionality), ....)
Dont implement it as a mixed approach though as "Kodi is open most of the time" probably for most people - and the intent (message) gets "confusing".
--
What you probably shouldnt do - regardless, is to use "trigger words" as an "indicator of intent" - because Amazon can start blocking them. "Number 1" is probably generic enough so they wont try to block that - but in principal, they can. Also Amazons "voice to text" engine is optimized for "short phrases" - the longer your input query gets the more prone to errors their results become. Leave the actual "voice input" as "natural" as possible (dont embed logic there). Imho.
I'm in the USA and uptobox.com is not available in our country.
I want to give the source a look and see what I can do to contribute.
Can you put it on github or somewhere else?
Much appreciated.
kratosjohn said:
I'm in the USA and uptobox.com is not available in our country.
I want to give the source a look and see what I can do to contribute.
Can you put it on github or somewhere else?
Much appreciated.
Click to expand...
Click to collapse
I've just uploaded it to zippyshare too. Link added to original post.
Mick
It would be nice if this could be generic way of entering text in any app, similar to the FTV Remote App that has keyboard support. I am surprised Amazon has not done this already. If you are in a text field voice search would fill in the text, else it can continue with normal Alexa functionality letting you " always reach the Amazon content search from anywhere". Should be an easy solution for Amazon to implement, not sure if it could be added with the progress here, and it would really make the voice control so much more useful.
Hey Mick, as im still very exited about that (so frustating to enter searchphrases with a dpad...), i thought about what your great find could develop to. I hope u dont get me wrong, as i unfortunatly cant contribute any programming (if u need something made with tasker let me know ), its not that i want to demand anything - rather share my thoughts or ideas...
- I think its a good thought not to 'blow it up' by adding many keywords, make it more complicated, and avoid amzn to lock features down. even if it may be an abstract fear. I think with a well-structured menu in kodi, all apps one will need to start are just 2-3 clicks away.
- if i got it right, xposed could hook into every module and alter it, right? so basically it should be possible to avoid to exchange the amazon ui and/or alter the vizinni.apk,but just modify the SearchOverlay.class? wouldnt it be (on top) the most convenient way to decide wether one is on e.g. Amazon Prime, or on kodi, and either hand over the result to the original module, or hand it over to kodi?
So, please understand my post as a mixture between sugestions and questions, not as a demanding 'please make it how i want it asap'. Im really excited about your finding, appreciate your sharing, and want to contribute what i can do - unfortunatly its rather thoughts and suggestions. Cheers mate!
Great Work !!! I totally understand this is for amazon Fire products only. My question is would we be able to port for generic Android TV box like nVidia Shield which also has mic capability and comes with root support.
Good job @is0-mick it's great to see you accomplish something that Netflix doesn't even want to be bother with on their app.
harlekinrains said:
No you dont understand. You havent even read or understood the first posting - but you have bought another device and now want others to move in your direction on your behalf.
Click to expand...
Click to collapse
Seriously mate if XDA bothers you so much, you need to take a break from it for your own sanity!
fach1708 said:
Seriously mate if XDA bothers you so much, you need to take a break from it for your own sanity!
Click to expand...
Click to collapse
No, I really don't think he needs to take break, his argument is completely understandable. This is not a Shield forum (btw before we make judgements, I own both devices). We need to get this fixed for one device, before even mentioning whether other devices are an option.
is0-mick said:
To make it work you will require ROOT, and you will have to uninstall or move the existing fireTV amazon UI.
Reason for this is that the vizinni.apk calls back to
localIntent.setComponent(new ComponentName("com.amazon.tv.launcher", "com.amazon.tv.launcher.ui.SearchResultsActivity"));
So your activity has to be in that package, and called SearchResultsActivity.
The only other way to possibly get round this would be to modify the vizinni.apk to call a different package instead, but then voice search wouldn't work on the amazon UI anyway. I wasn't really bothered about the amazon UI working myself which is why I did it the way I did.
Click to expand...
Click to collapse
Is it not usefull for this to create a xposed mod? I thought xposed was made for this...
Perhaps you should talk with rbox in his thread about a integration into version 1.5 of his mods, look here.
is0-mick said:
I just moved the original system/priv-app/com.amazon.tv.launcher/com.amazon.tv.launcher.apk to /system then installed my code via android studio.
mount -o rw,remount /system
mv /system/priv-app/com.amazon.tv.launcher/com.amazon.tv.launcher.apk /system/
Click to expand...
Click to collapse
So does that mean, while you are using your proof-of-concept you can not use the normal Launcher-UI?
Really great your work! I hope we got more
Sadly I am with my FireTV-Stick (hardware-Rooted-superSU) and my FireTV box gen1 (hardware-Rooted-superSU+custom-recovery+unlocked-bl)on the old FW. I wait for custom roms.
Greetings by Idijt
EDIT:
I forgot to ask you something. Did you got the kind of search-request back?
Can you see if amazon-voice-rgn knows if it is a app or a video or a moviestar?
This looks pretty cool since I don't like typing the name of the movie in the search box... now I can just speak it.
As a novice I have one question, You wrote:
is0-mick said:
I just moved the original system/priv-app/com.amazon.tv.launcher/com.amazon.tv.launcher.apk to /system
Mick
Click to expand...
Click to collapse
The code I downloaded was in .RAR format not .apk. Do I need to covert it to .apk or rename it to .apk before replacing the original?
I've not rooted my device yet so I haven't looked at the file structure, but I'd be willing to root to get this feature. OR is the adding of this code better done by someone other than a novice?
Thanks
carpenter940 said:
The code I downloaded was in .RAR format not .apk. Do I need to covert it to .apk or rename it to .apk before replacing the original?
Click to expand...
Click to collapse
It's the source code. You have to compile it and create the apk with AndroidStudio.

Ideas to enable multi-user support

At my job, I have been tasked with finding a cheap way to replace some paper forms with a digital equivalent. I have a Fire HD 10 7th gen, and since they inexpensive, they seemed like a good fit to accomplish this. I'm in the final stages of this prototype - if all goes well we would order a bunch to distribute to employees.
Using tutorials and guides from this forum (thanks!), I have rooted the tablet and stripped out the amazon bloatware, replaced the launcher, and now have a fairly bare bones tablet. Basically we only need email, calendar and something to open spreadsheets.
I am now trying to figure out a way to set up multiple users on each tablet. Amazon replaced the native user accounts with their own version for 'households'. You can have two 'adult' profiles and 4 'child' profiles and must be linked to an amazon account. The adult accounts function exactly like regular android user profiles, so the underlying features are there, I just need to remove the two adult limit, and be able to add them without having to set up an amazon account.
What I have tried:
1. Adding profiles while offline, still get prompted to log into amazon.
2. Tried to edit the build.prop file and included these lines
fw.max_users=3
fw.show_multiuserui=1
This did not seem to have an effect
3. Via an adb shell, I tried
adb shell pm create-user TEST
This produces the error:
Error: Unable to perform this action on production builds
4. I thought this might be a root issue, so I installed adb insecure. The command above still failed.
Is there anything else I should try? Is it possible to restore the original user manager from stock android? Is there a 3rd party user manager that I could use? More drastically, can change the build from production to something else, so that the create-user instruction is available? Obviously, the amazon user manager is able to trigger the creation of a new profile, so it must be using some other mechanism to accomplish the same thing.
Any help would be greatly appreciated!
You must be modify the framwork-res.apk

Categories

Resources