[Q] How to protect my asset folder? - Java for Android App Development

Hey I'm building an app with an asset folder full of sound files. I'd like to protect it from decompilation. I understand it's considered impossible but I'd like to use the example of console games like Playstation's. I remeber they pack their files in custom .DAT files that are indexed. The whole files are packed and it can be painful to extract the files without lnowing the way they are packed. I think that is the best way to do.
Is there a tool that can do that for me?

basterd2 said:
Hey I'm building an app with an asset folder full of sound files. I'd like to protect it from decompilation. I understand it's considered impossible but I'd like to use the example of console games like Playstation's. I remeber they pack their files in custom .DAT files that are indexed. The whole files are packed and it can be painful to extract the files without lnowing the way they are packed. I think that is the best way to do.
Is there a tool that can do that for me?
Click to expand...
Click to collapse
this is Dalvik and JIT, so you can't really do what you say... PS is about as far from mobile/java as you can get.... maybe don't use java and use NDK for such things

basterd2 said:
Hey I'm building an app with an asset folder full of sound files. I'd like to protect it from decompilation. I understand it's considered impossible but I'd like to use the example of console games like Playstation's. I remeber they pack their files in custom .DAT files that are indexed. The whole files are packed and it can be painful to extract the files without lnowing the way they are packed. I think that is the best way to do.
Is there a tool that can do that for me?
Click to expand...
Click to collapse
If you download games like asphalt or need for speed (or any big game for that matter), you will notice that they download additional data (expansion files) to the sdcard which has media and other stuff and they are stored in some different extensions (not mp3 or wav). But I have no idea how it is done. You probably will have to write binaries to encode and decode them.

gh0stslayer said:
If you download games like asphalt or need for speed (or any big game for that matter), you will notice that they download additional data (expansion files) to the sdcard which has media and other stuff and they are stored in some different extensions (not mp3 or wav). But I have no idea how it is done. You probably will have to write binaries to encode and decode them.
Click to expand...
Click to collapse
THis is very interesting, I'm checking the android page, they have a tool that does exactly that, it creates an opaque binary blob. The thing is I'm wondering how to use it directly witrhout using their expansion pack system.
http://developer.android.com/tools/help/jobb.html

You can protect your assets while you encrypt them before you put them in the apk. In your app you have to decode them of course.
You don't need a complex encoding system. Maybe you just add 5 to each byte... This may not be 100% sure, but protect from just playing the mp3/wav/ogg file.

EmptinessFiller said:
You can protect your assets while you encrypt them before you put them in the apk. In your app you have to decode them of course.
You don't need a complex encoding system. Maybe you just add 5 to each byte... This may not be 100% sure, but protect from just playing the mp3/wav/ogg file.
Click to expand...
Click to collapse
Can you give me an code example that does that? I've battling the APKexpansion files for hours with no success.

Related

folder or file locker..anyone????????

can anyone tell me from where can i download a file or folder locker for my pda, o2 xda mini.
i would like this also.
pocketrar
u can try pocketrar and use the password function
Re: future proof high end mobo ? suggest me.....
the pocketrar takes hell lots of time in converting in rar and than unpack it, i just want a prog, that provides password protection to my files and folders, so that nobody else than me can open the files. it must be there somewhere for free, as i had seen paid versions of this software.
but we r here to find a free for all software.
anyboby.....................
sankirsh said:
the pocketrar takes hell lots of time in converting in rar and than unpack it, i just want a prog, that provides password protection to my files and folders, so that nobody else than me can open the files. it must be there somewhere for free, as i had seen paid versions of this software.
but we r here to find a free for all software.
anyboby.....................
Click to expand...
Click to collapse
**** I'll pay for it. I got stuff that would have me single, homeless and beat to a pulp on my cell phone. What's the name of the program?

Batch upx compress (compress whole folders of exes)

Hi folks,
In the course of making my own ROM (something I admit to being new at) I found it rather tedious to individually compress exes with the upx utility and batches included with HyperCore kitchen. I've made a batch job that will look through all files in an input folder and compress all the exes (so you can just copy your entire SYS and OEM folder out of your kitchen, compress their contents and copy back). Perhaps something to do this already exists, but if so I couldn't find it. I've also included a more recent version of upx with this than was in HyperCore.
Hopefully this will save someone a little time.
To use:
1. Copy/Move folders containing exes (I suggest just copying the whole SYS and OEM folders) into the input folder.
2. Run compress.bat
3. Copy folders in output back to your kitchen.
While UPX is good for compressing PE files (which results in a smaller output file), one should point out, that it's a tradeoff. You get a smaller file, but a higher startup latency, and sometimes a tad larger memory footprint. So UPXing is not good for responsivenes of a device.
UPXing small .exe files may then be beside the point. You'll gain for eg. 5KB but you'll loose a second every time you load the file.
UPXing usually makes sence on executable files larger then 200-400 KB, and smaller then 15MB.
You can google for UPX performance for more information.
Just my 5 cents, and I think it's important for cookers.
NIXin said:
but a higher startup latency
Click to expand...
Click to collapse
mehehehe.
heh. it was not really good text, imo(maybe it is, on e-105..but even omap have VERY fast decrunch speed).
4 cents are ok, in general...
my one cent:
test EVERY upxed dll, EVERY upxed exe, some things will be broken after operation(isilo - i.e.).
very good idea is to pack office pack exes(much space for useful soft while cooking).
.net apps CANNOT be uxped for now.
imo, batch upxer is just NOT good idea...
Good input from both of you, particularly in regard to testing the executables. There is an option to force byte-identical decompression, perhaps it would be a good idea to enable this? I am aware that there is a trade-off in performance with compression, but reading the readme on upx one notes that decompression is very fast. Even assuming our ppcs are 10 times slower than the Pentium 133 decompression would still be 1MB/sec, and most of our exes are much smaller than that.
Just curious if this case where files don't work after compression is a common one (noting I'm not compressing dlls as they are unable to share data when compressed; this is noted in the upx documentation, where they comment it's probably only a good idea to compress things like plugin dlls). Perhaps someone with more experience can comment on this?
caeci11ius said:
Good input from both of you, particularly in regard to testing the executables. There is an option to force byte-identical decompression, perhaps it would be a good idea to enable this? I am aware that there is a trade-off in performance with compression, but reading the readme on upx one notes that decompression is very fast. Even assuming our ppcs are 10 times slower than the Pentium 133 decompression would still be 1MB/sec, and most of our exes are much smaller than that.
Just curious if this case where files don't work after compression is a common one (noting I'm not compressing dlls as they are unable to share data when compressed; this is noted in the upx documentation, where they comment it's probably only a good idea to compress things like plugin dlls). Perhaps someone with more experience can comment on this?
Click to expand...
Click to collapse
While compression is necessary to fit some things in it really ought to be a last resort. I recall the author stating that a 100k program compressed to 50k requires 150k of memory to expand and run and it doesn't free up all of the extra memory needed...so there has to be a balance or you are going to be using up all your memory to save storage....if the app HAS to be installed to phone storage then upx is something to consider but I wouldn't recommend globally upx'ing all your apps on your minisd for instance.
.net apps CANNOT be uxped for now.
Click to expand...
Click to collapse
Because .NET files don't have the standard PE header. It's a requirement for UPX (or any other executable file packer) (PL: pozatym witam )
Mr. famewolf just confirmed what I have said and even added some more. It's perfectly okay for PCs, where you don't notice the difference, but PPC's are just way to slow and the gain is too little (if any). Batch method is not the way to go, unless you wan't to "cripple" your PPC.

lockdown application - development

Hello all,
first let me say I love this site , and if it wasn't for these forums then I never would have been able to do the following...
secondly, let me also say that I am no means a coder- but more of a graphic artist as such I am sure the following application could be written better...so I am offering the source code and graphics in case anyone wants to develop it further...personally I would like to have been able to make it landscapable as well as read the 'password' and the program to block from a config or .ini file..as it is now the password is embedded within the actual .exe.
I know there is development of a similar app (much better probably too)but I figured I would share what I have and hopefully it might grow into something better.
.zip file contains the folder with my vs2008 project/source code
a folder with all the graphics I used (as well as layered .psd files for artists to manipulate further)
and lastly the actual .exe and 3 .wavs used in the application..
because I am new to this if you want to try the application out you must place it on your storage card in a folder called Lockdown in 'Program Files'
thus: Storage Card\Program Files\Lockdown
please let me know what you think (even though I dread the inevitable.."you could have done all that with just these 2 lines of code"...but its a learning experience for me and I am thrilled to have been able to get this far with it.
the PASSWORD to unlock SMS messages is : 1-7-9-3 then hit 'OK'
thank you:

UPX compress dll fail

I used UPX to compress a big dll(>5 MB), compress successed, but the program can't execute, anybody know why? and how to fix it?
UPX compression on modules (DLLs) does not usually work with Windows Mobile software. It renders them unreadable and the software usually returns an error.
Compress only executables (EXEs) in future. Why? Because the operating system is designed to be able to use compressed executables -- anything higher level than the OS has to be written to use compressed modules.
Think of it like this:
You can tell a child to eat some candy and he will eat it just fine. But show him some candy that doesn't look or smell like candy (even though it is candy) he will probably not eat it without being told what it is.
Terrible analogy, but you get the point.
pj1115 said:
UPX compression on modules (DLLs) does not usually work with Windows Mobile software. It renders them unreadable and the software usually returns an error.
Compress only executables (EXEs) in future. Why? Because the operating system is designed to be able to use compressed executables -- anything higher level than the OS has to be written to use compressed modules.
Think of it like this:
You can tell a child to eat some candy and he will eat it just fine. But show him some candy that doesn't look or smell like candy (even though it is candy) he will probably not eat it without being told what it is.
Terrible analogy, but you get the point.
Click to expand...
Click to collapse
thx for reply, do you know some other ways to reduce dll's size? like some compile option?
If you're the developer of the application, you there are various changes you could make, including adapting the application to support UPX compression on dependencies. I'm not familiar with any methods specifically.
Otherwise, no. In short, there is not much you can due to reduce the size of the modules without breaking them.
Try this: http://www.google.com/search?q=wind...a:en-US:official&client=firefox-a&safe=active
And UPX is supposed to work on ARM Windows CE... Weird.
DJGonzo said:
Try this: http://www.google.com/search?q=wind...a:en-US:official&client=firefox-a&safe=active
And UPX is supposed to work on ARM Windows CE... Weird.
Click to expand...
Click to collapse
It works... I've tried it on both exe's and dll's and they were able to load on WinCe based device.
pj1115 said:
UPX compression on modules (DLLs) does not usually work with Windows Mobile software. It renders them unreadable and the software usually returns an error.
Compress only executables (EXEs) in future. Why? Because the operating system is designed to be able to use compressed executables -- anything higher level than the OS has to be written to use compressed modules.
Think of it like this:
You can tell a child to eat some candy and he will eat it just fine. But show him some candy that doesn't look or smell like candy (even though it is candy) he will probably not eat it without being told what it is.
Terrible analogy, but you get the point.
Click to expand...
Click to collapse
Isn't dll's and exe's has the same format?
Maybe OP is facing some bug or doing it wrong.
thx for all reply, google is really a good friend, but not help much, maybe I need to find other ways.
UPX will compress .DLLs .EXEs, and .MUIs. The problem is they don't always decompress.
I have no problems UPXing .DLLs, but you have to test them.
I always test with the UPX -d option to ensure that they decompress.
If it doesn't decompress, then you're out of luck with that particular file.
Sometimes they decompress, but still won't work properly because the resources get screwed up, in this case using the option "--compress-resources=0" increases my success rate.
the full command line I use is:
UPX *.dll -f --compress-resources=0 --compress-exports=0 --strip-relocs=0 --best --ultra-brute
then to test them:
UPX *.dll -d
I get a high rate of success, but there are occasionally files that won't work.
J03M4N
If it's a large dll with many resources, you can export the resources and compress them (use less colors/detail) and that will help. Dithering can cause a image to become much larger.

[Q] .DATA Files in WP8 Isolated Storage

Hello - I'm doing some security testing on a WP8 application. The isolated storage has a bunch of .DATA files. If I try and view these in notepad ++ it is gibberish. Any ideas on how to view the contents of these files? I'm assuming they are database files.
OK, first of all, you already asked this in another thread. DON'T DO THAT.
Without knowing what the app in question is - which I don't really expect you to tell me - I can't much help you. I assume this is a blackbox assessment, or you'd have checked the source code. If the app is managed code, you can try decompiling it (you can try this if it's native code too - IDA Pro supports ARM - but that's obviously more difficult).
The extension .DATA doesn't mean anything. There are only a few common database formats used on WP8, so it might be one of those... but then, it could also be encrypted so even if you figure out the format you'll need the key too. It could just be a flat text file that has been compressed and/or encrypted, for that matter. You could try checking the file for magic numbers, either manually using a hex editor or by checking the file using libmagic (on *nix systems, /bin/file is usually a front-end to libmagic and should be able to tell you if the file is, for example, a known compressed format).
GoodDayToDie said:
OK, first of all, you already asked this in another thread. DON'T DO THAT.
Without knowing what the app in question is - which I don't really expect you to tell me - I can't much help you. I assume this is a blackbox assessment, or you'd have checked the source code. If the app is managed code, you can try decompiling it (you can try this if it's native code too - IDA Pro supports ARM - but that's obviously more difficult).
The extension .DATA doesn't mean anything. There are only a few common database formats used on WP8, so it might be one of those... but then, it could also be encrypted so even if you figure out the format you'll need the key too. It could just be a flat text file that has been compressed and/or encrypted, for that matter. You could try checking the file for magic numbers, either manually using a hex editor or by checking the file using libmagic (on *nix systems, /bin/file is usually a front-end to libmagic and should be able to tell you if the file is, for example, a known compressed format).
Click to expand...
Click to collapse
Sorry about posting in multiple spots. I figured I shouldnt ask multiple questions (diff topics) in one thread so I thought I would do a stand alone. Won't happen again. The vendor has told me that these files are encrypted...but I am also trying to get some more info on what that actually means and what they are doing for key storage.
It's quite likely that the files are encrypted using the data protection API for WP8 apps (http://msdn.microsoft.com/en-us/lib...ity.cryptography.protecteddata(v=vs.105).aspx). From what I've read, that uses 3DES with a key derived from the user (probably meaning app) and system (probably meaning device-specific) identities. The key derivation and management is invisible to the user, though.

Categories

Resources