How to create an epub with drmed? - epub

I want to crate an epub file with drm , so when I open it with adobe edition reader or ibooks, it will reports it's drmed .
Here is some refs:
http://www.idpf.org/epub/301/spec/epub-ocf.html#app-schema-encryption

If you want to programmatically add (Adobe) DRM to EPUB files, you need to purchase an Adobe Active Content Server license from Adobe (and it is not cheap!): http://www.adobe.com/solutions/ebook/content-server.html
If you are just interested in having one single EPUB file DRM'ed, probably the best/easiest/cheapest way is to distribute it through a platform that will add the DRM for you (usually, for a cut on the sell revenues).
BTW, why do you want to add the (Adobe) DRM? It can be easily removed with one click, and it is an absolute hassle for legitimate buyers. Adding a watermark might be a better alternative, if you are concerned about illegal sharing.

Related

Pre-load content into Documents or Library directories from XCode

I am building an iPhone app that requires preloaded content. This content is presented so that it tests the user's knowledge, but is not modified by the user. The content consists of proprietary image files and pdf files.
From what I understand, the best practice would be to store this in the app's Library or Documents directories (please inform if this assumption is not correct). In a future version of the app I might want to upload additional (not replacement) content via API, but this is not part of the initial version.
I have seen many posts and tutorials regarding obtaining paths to the Documents and Library directories of an app, and reading/writing to them. This is all good and useful, but not what I am looking for here.
I would like to preload the content into the Documents and/or Library directories, for the simulator initially, to test app in simulator; and ultimately to the release version. I would have thought this would be possible to do from XCode without writing code.
I have not been able to find a solution to this on Stack Overflow or other places on the net. Any pointers, links, solutions are welcome. I am using XCode 10.3 with Swift 4.2.
See the File System Programming Guide: File System Basics, which shows us:
The “data container” (including the Documents and the various Library folders) is for content generated/saved by the app. When, in Xcode, you mark resources as being part of the target, that becomes part of the bundle, and your app can retrieve it from there at runtime.
Theoretically, yes, you could copy data from the bundle to the Documents and/or Library folders, but, yes, you would have do that programmatically. It seems a bit wasteful to have two copies of these resources on the device, but you can do whatever you want. Generally, though, resources included in the bundle would just be be opened directly from there at runtime, not copying it to the data container (except for those cases where you would need to change it, because bundle contents are read-only).
FYI, for additional information regarding the file system, see the iOS Storage Best Practices video.

Opening up an .ipa file - Piracy

How easy is it to open up an app submitted to Apple's store?
I'm going to submit a new app to the store soon, and want to protect the app file from being opened up to the source-code. So for instance, if I were to download my own app, how easy would it be to pull out all the .h and .m files and recreate it in Xcode?
Does Apple encrypt it somehow?
What steps can I take to mitigate the code being viewed?
EDIT: Allow me to rephrase the question a little better - can I take decompiled code and make it human-readable?
An IPA is just a zip. But you don't even need to access the IPA.
Just get iExplorer and access all available assets of your installed apps from your Mac.
The m files however build a compiled binary and can not be read (if you consider de-compiled code as not readable, as I do)
Adding on the answer, it is possible to decompile the binary, but the only thing that would be directly removable from the binary itself would be the headers (or to my knowledge of what I've seen). Then the application would be reverse engineered from there. That would probably be the only thing I'd be worried about when it comes to people stealing my code.

Files security in XCode project

I am trying to build an iOS application which has a PDF file emdebbed in it, and I don’t want the user to access or find it by unpacking the IPA file. I found that if I UNCHECK the “Add to Target” check box (when I drag and drop the PDF file into my project), the PDF file will be hidden and no one can see it after showing the IPA contents.
My question is, should I be worry from this case, in another word, if I unchecked this option, will I face any issue in publishing my application or in deploying/supporting any of my targeted devices, or should I be worry from any issue may face the users in reading this PDF through my application?
I did some research regarding this point, but I couldn’t find any good or clear answer, I appreciate any help in this.
If you uncheck the "Add to target" button it means that the .pdf file will not be packed to the .ipa file and it will not be accessible at all when someone downloads your app. So this is definitely not an option for what you want to achieve. It is better to encrypt the pdf file and decrypt it on runtime if you dont want it to be accessed when someone unpacks the .ipa file.
How important is your security? You could just zip it, then name the file something other than "*.zip".
However that would not stop someone who was determined. You would be advised then to use real encryption.
But even that would not stop a truly-determined attacker, who might use a jailbroken device to capture your PDF while it was loaded in your program's memory.
You can make it difficult to get at your PDF, but if you can get at it from your App, then I myself could get at it if I downloaded your app to my device.

Opening files from iPad in Excel?

I have an iPad app that creates XML files and saves them to the iPad's Documents Directory. I would like to get these files to excel, but I am fairly certain I cannot just launch excel > open > then navigate through the iPads directory.
What's the best way to get these files? Are there any windows applications that allow you to access the iPad's directories ? Or will I have to use iTunes ?
You might want to check out "CloudOn":
Excel on my iPad
http://site.cloudon.com/
For your needs, I have the habit of going through the Beesy application: http://www.beesapps.com/management-productivity/import-excel-files-on-ipad/. I can import/export such a file in my iPad and if I need to make changes, I can make notes in the margins of the doc to complete thereafter.

Shipping zip with thousands of audio files within app bundle

I am developing app for studying foreign languages, and I'll need to ship 80000 little audio files in my app.
To reduce the size of my app I decided to ship only part of them in the bundle, on the zip archive, and then un-archive it to documents directory. Then, when iPhone will be in Wi-Fi network, I'll little by little download all the others.
But the problem is that Apple says, that we are not allowed to store big files in the Documents Directory. Flagging files for not backing up works only since 5.0.1
So I see two ways for me:
Ship all the files without zipping them and storing them in the app bundle – but that's too huge.
Ship a zip, un-archive it to the cache directory and then check, if they are (not deleted by system), and download one, if it's removed.
What should I choose or is there any other way for me to work it out?
Zipping audio files isn't a good way. I'm sure that saved space will not play any role.
Best solution is to use AAC encoded audiofiles.
Choose suitable quality between 64-128 kbps. And probably mono.
iPhones 3Gs and higher have hardware support for this codec.
There isn't much point in zipping files in the app bundle if you will just decompress them to the documents directory. When app bundles are delivered to iOS devices from the app store they are zipped up anyway (.ipa file), so unzipping to documents will make your app actually take up much more space on the user's device (once in the app bundle and once in the documents directory).
Automated way:
If you want to download them without using too much documents space you can write a predictive cache which has a maximum allowed size. You can keep track of when each file was last accessed and when you need to download a new file remove the oldest-accessed files until you have enough space. Your app can predict which files are needed next based on progression through the lessons, but even if they access a not-present file you can download it just-in-time and add it to the cache for future re-use.
Manual way:
You could provide a user interface to show the user how much space the different lessons are using and split it into lesson packs. Allow the user to control which packs remain cached and show how much space they use. They can decide when to download new packs as they progress through the lessons and when to remove old ones (if they want to save space). If the user wants to keep the files locally then you should let them, even though it uses lots of documents space.

Resources