How do they do? - Overriding Dalvik File.delete() - java

Recently, my attention was drawn by some of the Recycle Bin applications on the play store, and I thought it would be nice to put some of those methods into practice to make other useful applications for people out there, but it seems not quite simple.
According to this Stackoverflow post, it is impossible!
But if you look closely, applications like GT Trash and Dumpster are working like a charm without any root permissions!
What we exactly want to achieve is overriding the android system File.delete() so the deleted file is moved to our desire location before the user permanently delete it. We tried the Andrey Petrov post witch shows a solution for a similar situation but it is not providing enough details.
We appreciate any help from those who where successful finding out the magic behind these apps.

Related

Is there any way to add Autocorrect to my Android Keyboard?

I am working on an Android Keyboard, and I was trying to see if there was any way to add in Autocorrect into it. Or is Autocorrect provided with the Spelling Checker Framework? I cannot find a clear cut answer anywhere on here or any other place that I have looked.
My code for my keyboard can be found here > https://github.com/MJonesDev/AndroidKeyboardPractice
You can't rely on the Spellchecker framework. It isn't included on all devices- specifically Samsung ones. (Which may be my fault- when I worked at Swype and 4.0 was new, its UI was interacting badly with Swype. I asked them to turn it off by default, they decided to remove it entirely).
Even when it exists it doesn't really provide autocorrect. At best it can give you possibilities, and its then your job to display them, and handle the text correction when one is chosen.
There are various spelling correction libraries out there of different qualities. Its possible to find open source ones to include if you aren't looking to do anything special.

If I publish an app to the google play store what stops people from stealing my code?

I ask this question because I couldn't find the answer I was looking for but simply put is there anything in place in the app store to prevent stolen code? I notice that there are a lot of clones on android which made me wonder whether they are directly ripped off or just so easy to replicate that they end up cloned.
Can people just simply download the apk file and reverse engineer it?
Is there anything google has in place that prevents this, or if there isn't, is there anyway that I myself can prevent it or make it more difficult for people wanting to steal my code?
I'm still new to Java and learning so it will be a while before I start this, but the project I have in mind will consume a large chunk of what little spare time that I have for a while, so I don't want to put a lot of time into it without proper measures only to have it stolen and sold for someone else's profit in a week.
If this has been answered before whether on this site or another please point me to there and delete this if necessary.
Well, you can do code obfuscation, so that on de-compiling the code, the logic is not obvious, so hard to maintain.
You can use the free version i.e. ProGuard or much powerful professional version DexGuard.
Here is an example which shows how to configure ProGuard when you are using libraries.
Retrofit+ProGuard.

Add a custom file type with java application installation

I am trying to have my custom file type .vrs (which for all intents and purposes is an rich text format).
I am pleased with what I have since I am self taught.
But am having difficulties associating that file with my program so that when a user double clicks it, it automatically open my document editor.
All searches so far have come up with either right clicking and setting the association, but this is not what I would need.
I may not have explained as well as needed so think Photoshop's .psd when you install Photoshop all psd files are automatically set to open when you double click them.
Hopefully I have been clear enough for you to help.
Also whilst the question is regarding Java any resource be it for C# C++ etc, would also be appreciated.
Thanks for your time and any responses.
This functionality is system dependent, and in Windows involves the registry. If you really want to delve into this, take a look at this post, which goes into great detail on how to accomplish programmatically setting a file extension association using C++. If this is helpful, please write back telling us how you solved the problem in your individual situation.
If that isn't helpful I would try this link instead, as it links to more resources and demonstrates a little C# code.

Replacing/Rebuilding framework.jar in Android Source

This could be a rather crazy question, but I wanted to get some insight on it before I spend all the time trying it.
Is it possible to rebuild framework.jar (like say pulling the framework.jar from MIUI), decompile it to smali and then rebuilt it from scratch (via reading through and remaking it yourself into java)?
I planned on doing that + taking the similar files from Cyanogen mod as a reference to build off of. The reason I was interested in doing all this was because I have a phone that needs the Radio Interface Layer more or less rebuilt and it's just become too much of a hassle to deal with editing the smali directly and debugging it.
I figured I would ask here because people would be less quick to rush to judgment on whether it was possible or not. I don't see why it wouldnt work if you are adding everything correctly (in theory) and rebuilt the classes.dex file in the source after.
Main reason I am asking is part of an effort to port MIUI to my phone. I figured the lesser of too headaches was rewriting the java and rebuilding a working framework.jar (which has parts in it that are not in the CM7 or AOSP sources) than editing the framework.jar that comes with MIUI to work correctly.
While there are various ways to decompile a dex file back into java, none of them will produce java that is perfectly compilable. You would have to spend tons of effort cleaning up the java code from a decompiler, to get it to compile. It's pretty much not an option for something as big as that.
Your best bet is to get something like AOSP or CM working on your phone, so that you can build the framework yourself directly, with whatever modifications you need.

What's the difference between a midlet and a corelet?

It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't?
I believe a corelet is a midlet that has full read access to the phone's internal file system...
There's probably something else, but I can't remember it... I'll see if I can find any further info
After searching around, it seems they basically add functionality to the phone, rather than run on top of it as a separate application

Categories