How to write/change a visio file with java (jacob) - java

I wasn't able to find anything useful about how to write a visio file with java, and probably looked through every article on the web.
If found a lot of stuff about doing it with c#, vb, and other stuff but couldn't find what I need.
I also found this, but I am not sure if this (reverse engineering) could do what I need >>How to generate MS Visio diagram automatically?<<. Because I really want to create a vsd file with my java application write a lot of data into it (from an xml file for example) and open it afterwards with visio to check and correct that data.
It took me a while to find this
http://www.java2s.com/Open-Source/Java/Development/jacob-1.15/com/jacob/samples/visio/Catalogvisio.htm <<
which at least allowed me to open a visio file.
But I still need to know how to write into that file and save it afterwards.
So in short, my acutal attempt is to use jacob, but I don't know how to do stuff like "add block at position x,y" with that com bridge. Is there a docu for that stuff?
any help would be appreciated
thanks

Related

Lg .dz .kdz file structure

Im asking for a bit much here but maybe some can point me or help me understand how .kdz and .dz file work, meaning I want to understated their structure and possible build a java script to compress (as a self project), also how can I read or utilize the dll file in the kdz.
I have a python script that can decompress those file, can any one help me understand it?

Tutorial on how to import/read a tif/tiff file using java or the java advanced imaging API

I have a tiff image with many directories and subdirectories. I would like to navigate this tiff directory tree and import the image into a 2D array, so I can process this image. I am relatively new to java and cannot figure out how to do this. Will someone please reply to my question with a tutorial and examples of code?
Also, does anyone else find the java API documentation difficult to find, difficult to navigate, and somewhat sparse? I am trying to do this as a workaround for a processing sketch I am creating. Are there different workarounds?
Thank you.
Well i didn't even know a tiff could have directories and sub directories... But I would have a look in java File class as a start point to try to see those directories from your app. If you can see them, than you probably can parse them too.

how to read a .ptn file from java

Any one knows what .ptn file is and how to open that, just got the file from client and couldnt able to figure out what is this , searched a lot but no luck .
Also have the requirement from client that
my application should read this .ptn file from Java
is this possible ?
thanks
This seems rather obvious, but if a client is paying you to write code to read a file, you're entirely within your rights to ask what the file is, and where it comes from. If it's some internal or proprietary format, you can ask for documentation.
Of course, you might start by simply opening the file in a text editor, to see if it's just something trivial.
This wonderful web site is a repository of information about file formats; searching "PTN" brings up nothing, unfortunately, which suggests that it's nothing very common.

Android: .java files readable from .apk file?

I'm currently developing an application for a company which includes livescoring. The XML-files I access (from the net like: "http://company.com/files/xml/livescoring.xml") are not intended to be public and should only known to me.
I was wondering if it is possible for anyone to decode the .apk file and read my original .java files (which include the link to the XML files).
So, I renamed the .apk file to .zip and could access the "classes.dex", which seemed to include the .java files (or classes). Googling led me to a tool named "AvaBoxV2" which decoded this "classes.dex" file. Now I have a folder including an "out" folder where files named .smali exist. I opend one of these with an editor and finally there is the link to the xml file. Not good. :(
Is there a way to encrypt my app or the classes.dex file? I don't want to tell that company, that anyone can access the original xml-files. Maybe signing the app probably helps?
Also, do you know a really noob-friendly tutorial to prepare apps (signing, versioning,...) for Google Market?
Thanks in advance!
The .java source code is not included in the APK.
It is possible to disassemble the Dalvik bytecode into bytecode mnemonics using a tool like baksmali, but there's no way a user can recover the original .java source.
Furthermore, you can use a tool like proguard (included in the Android SDK) to obfuscate your byte code, making it hard to interpret the behavior of the disassembled bytecode.
You can make small tricks too, like storing the link string in some sort of obfuscated form, and then de-obfuscating it at run-time in your app (a simple example would be to use base 64 encoding, but someone could probably reverse that quickly if they wanted to).
That said, it's pretty trivial for someone to run tcpdump and sniff the network traffic between your device and the server, and get the URL that way, so there's no way to completely prevent anyone from getting this value.
Yeah, its impossible to fully prevent something like this. Its the same on a desktop application, or any other application.
As mentioned, obfuscation will help, but people who are persistent can still get past it. Especially for something like a url like that.
One solution of making it much more tricky for hackers is to use PHP on your webserver and some sort of token system to determine if the request is coming from your app or not... That would get a bit tricky though, so I don't really suggest it.

Reading binary file without knowing file format

I'm working on a java project and i have to read some files like these:
- EntryID.data
- EntryID.index
- KeyText.data
- KeyText.index
...
I think these files are used in a dictionary project but i can't find a any document about this. How can i read them or know the format of them ? Sorry for my english =.=
Thanks alot!
This looks like files from a database management system. One file to store the data, another one to store at least one index to speed up queries.
I'd start with a hex editor and look at the file. Sometimes, the content binaries gives a hint.
Another idea: look at the classpath and inspect property and resource files. Maybe you'll find a database driver or some config files with jdbc connect strings.
Google told me, that all four files are used by Apple's Dictionary.app. Have a look at this blog, this can point you in the correct direction.
Last note - reading undocumented binaries is a challenge. I usually start with 010 Editor to analyse the datastructure and develop a java based test tool to read the data. It's some sort of try and error evolutionary process.
Well, this is kinda difficult. data could mean anything.
You could try the UNIX utility file or open the file with a hex editor and look for interesting strings (the utility strings is helpful for that too).
Some information is in info.plist.
KeyText.data is sometimes compressed using zlib. 78 9C is well-known zlib-header so you can decompress when you find it. Size of decompressed entry comes before compressed entry.
Size of entry comes before entry of array.
C# library is in https://github.com/kurema/MacDictionaryGeneral. But *.index is too difficult to understand and implement. info.plist says *.index is trie index which is not enough information to understand fully.

Categories