Folks,
The project that I am working on requires that a certain video can be played on an android device for x number of times. After that, it must stop playing. When a client gets the video file, he or she also gets another file that contains the Android device ID and the number of times the video can be played. The original file and the metadata file are both encrypted.
My first thought is just to write a video decoder for the video file. Each time the file is played, the decoder first checks if Android device and the count are valid, decrements the count, starts decrypting the data and streaming it to the mpeg-4 decoder shipped with the OS.
I would appreciate your feedback on this idea. Please share your thoughts if you feel there is a better way to do it.
One problem I see is where to store the actual count. Storing it in the file itself won't work as the user can simply backup the original file and replace it after the count exceeds. It has to be stored in some other part of the system that cannot be tampered by the end-user.
Thank you in advance for your help.
Regards,
Peter
Useless to store it anywhere on the actual device, because anywhere an app can touch a user can as well. Best bet is to use a remote server for authorization, but then you get spoofing problems. But your real goal is to make it a nuisance, not worth going around, instead of making it impossible to crack, because you can't.
Okay, the simplest way would be similar to something you first suggested, and needs no further infrastructure: store the information in a file. This is defeated by reloading the file, as you suggested, but even that is a high enough barrier for some.
Defeat reloading the file via obsfucating where you're storing the information. Possibilities include text files (easy to spot), or perhaps image files (like images that are supposedly button images).
Remember, it only takes 1 guy 1 time to point the playback into a recorder, and you have a perfect, DRM-free copy running around in the wild. Remember that you're simply trying to make it easy enough to view legitimately and difficult enough to crack (take the difference of those) that people won't bother cracking it.
Related
I want to create an app for sharing audio files. I want to build native mobile apps and made most of my progress on android with a PHP/MySQL backend so far. But now I want to step up my game and build my backend with Node.js and MongoDB.
Since big audio files take a while do download and can worsen the user experience I wondered if it is possible to just download the first 20% of an audio file. When the user reaches a certain point of the audio it downloads the rest/the next section. Therefore, we do not need to download the entire audio that might never get used. I just wonder if it is that difficult to add another section of the audio while playing without any interruptions.
For some reason I think this is how the big social media apps work but I cannot find any sources on this topic. I don't ask for code but just suggestions and references to help me. Am I on a good track or are there are ways to solve this problem? Also can you recommend to use Digital Ocean Spaces for this task??
Sources for Android and IOS will be very helpful!
You can do it by providing a "Range" attribute to the header of the HTTP-Request you are sending to the Digital Ocean space for the desired media file. The "Range" attribute says the number of bytes you want to receive.
I'm looking for someone who might be able to suggest ANYTHING that might explain this problem I've been having. I've been having this problem for almost three years, with the same app, and nothing I have tried fixes it, or even explains what's going on. The app is a little game, and it saves its state in three files inside one level of folder, like so:
USERNAME
gamestate1.dat
gameinfo.dat
gamestuff.cfg
So what happens is, people will play the game, then suddenly the next day they'll play it again and data will be wiped. Sometimes all files (and the folder) are gone. Sometimes one or two files are missing. It's not common,but it's happening enough that it's occupying too much support time.
The game itself has nothing in it that deletes files at all. The game doesn't delete. But the files are vanishing somehow anyway. The game is not a hardcore game for hardcore players, so most of my users are tech-ignorant, so I know they're not going in an deleting the files.
The rate of customers complaining that they've lost everything increases exponentially right after I push an update.
Can anyone tell me if there's ANY kind of special situation on android that could cause this, and how I could prevent it? Is some antivirus on some phones? Could it be sectors on the card going bad? I've tried turning Google sync on and off and every which way, and turning sync off seems to reduce the problem without eliminating it.
I'm using JNI and accessing my files with normal C++ file functions-- fopen, fwrite, fread, fclose. I am saving them in the folder returned via getExternalFilesDir(null).getAbsolutePath().
I guess small audio clips are necessary for many applications, thus I would expect QT have support playing mp3 in memory slices. Maybe decode mp3 data to wav data in memory may be one solution, but that needs time to decode all data first. For real time application, it is not a good idea. It also doesn't make sense to store mp3_data in a file and ask QMediaPlayer to play that, the performance is unacceptable.
This is my code after many searches by google, including stackoverflow:
m_buffer.setBuffer(&mp3_data_in_memory);
m_player.setMedia(QMediaContent(), &m_buffer);
m_player.play();
where m_buffer is a QBuffer instance, and mp3_data_in_memory is a QByteArray one; m_player is a QMediaPlayer instance.
I got some information that the code here doesn't work in MacOS and iOS, but I am running on Android now.
Does anyone have a solution for Android system? Thanks a lot.
Your code won't work because the media property requires a valid QMediaContent instance:
Setting this property to a null QMediaContent will cause the player to
discard all information relating to the current media source and to
cease all I/O operations related to that media.
There's also no way of telling the QMediaPlayer what format the data is in, you're just dumping raw data on it. In principle QMediaResource can hold this information, but it requires a url and is regarded as null without it.
As you may have guessed, QMediaPlayer and the related classes are high-level constructs not designed for this sort of thing. You need to use a QAudioDecoder to actually decode the raw data, and pipe the output to a QAudioOutput to hear it.
Hey I'm stuck with this problem for quite a while
I need to have a backround activity in android which will be running to detect any photo/video activity, the minute a photo or video is taken it should make an entry into a text file:
The entry should look like this : [uri_of_new_photo, time, gps-location]
What are the possible ways in which i can achieve this, I was looking at the BroadcastReciever, but was not sure if that would work.
Are there any tutorials/links which can give me a solution. A direct solution to this problem would be great!! (rather than alternatives, as this is a small part of a bigger project)
What are the possible ways in which i can achieve this
Technically, it's not possible. Anyone is welcome to write a camera application that takes photos or videos and does not tell you about them.
I was looking at the BroadcastReciever, but was not sure if that would work.
I am not sure what "the BroadcastReceiver" is that you are referring to.
You are welcome to use FileObserver to try to monitor likely places for photos and recorded videos. However, there is no guarantee that apps will write their photos or recorded videos in the places that you are looking. And, just because there is a new file in one of those directories does not mean that the user took a photo or recorded a video -- they could have simply copied a file into that directory, or obtained the file from the Internet (e.g., Flickr sync). And, this will only work while your app is running.
You are welcome to use a ContentObserver on MediaStore. It will suffer from the same basic problems as would the FileObserver approach that I mentioned.
If you want to reliably log information about the time and location of photos and videos, write your own camera app.
I'm at an early stage of development (and experience as a programmer). I would really appreciate some advice and insight. I am developing an application on the Android platform that should allow users to record short 5-10 second audio files and store them on a remote database. It should also allow any user to later locate and playback the sound file from any phone running the application.
I have looked a little into storing them as blobs in a SQLite db, but I read that the speed of the database begins suffering at just 250bytes per row. The files won't be huge but they will exceed this amount sufficiently to dissuade me from going headlong down this path. There will be some basic information attached to each file. Unless someone has a better idea, I will probably use the SQLite db for this alone, and include some sort of a pointer to the audio data. What would be the most appropriate way to store the audio information?
Again I really appreciate any advice or insight into this issue.
Thanks,
Adam
It sounds like a bad idea to store the audio data directly in the database.
A better approach would be to store it in files and save filename in the database.