I am having some difficulties with my android app parsing an xml that contains links to PDF files. It should open a listView showing all of the files listed in the xml. However, most of the time it just freezes up on me. The app was made by a developer no longer with us, and all I have is the apk and not the source files. Is there a way to use the apk to get the source files and figure out what the issue is? Android is not my forte and I'm at a loss with how to fix this.
UPDATE:
It appears that devices running 2.2 display all the songs just fine, while the newer versions of Android crash when ran.
I've had problems with android 2.2 on my HTC desire taking a long time to parse large XML files. There wasn't much I could do other than switch from DOM to SAX which for some reason was a lot quicker
However debugging this without source code is likely to be pretty difficult. Not least because fixing the issue when and if you find it will require you to re-compile a new class in replacement for the one which keeps freezing.
I would suggest you look into decompiling the APK back into source code.
According to Wikipedia APK files are based on the Jar file format which in turn is a Zip file:
http://en.wikipedia.org/wiki/APK_%28file_format%29
That makes this task a little easier as you won't need to look for a decompiler that is specific to android but a more generic Java Decompiler.
A quick search on google suggests this one:
http://java.decompiler.free.fr/
If you can decompile the app back to source code and then get that source code into eclipse and rebulild from source then you can start to debug.
Related
A third party created a unity project for me but they lost their project on their end. A guy had it on his laptop, never backed it up but he did send the integrated unity project for android. The only issue is that we need to change something inside it. So I have the android project, I just need the built unity's source code.
The same situation occurred with our IOS version, luckily Xcode had the Assembly-Csharp accessible and I could find the value I needed to change. The Android's Unity was built with il2cpp. I've managed to re-secure the assets using some tools I've found online. So I can potentially rebuild the project with new scripts. However this may take a rather large amount of time. So I found I can edit the source code through the hex code, but this seems limited/nigh impossible as I need to make a condition on this string instead of simply setting the value. If there is a way to do this with a hex editor on the lib2cpp.so file I would greatly appreciate even a lead. Alternatively I have found some things on hooking a string, but I am unsure of how to go about this and cannot find sources of where to start such a thing.
Any leads or information on how to edit a string on a condition in the unity source code through it's lib2cpp.so file or libunity.so file would be greatly appreciated!
I'll try to make this simple :
If I create an AIR app from the Flash IDE, I can choose to embed folder in my package. Then I can load the files using 'app:/'+filename. Everything is ok.
I have to move to Flash Builder because I can't test workers in the IDE (thanks Adobe). My issue is that, if I test/debug from Flash Builder, it does a stream error when calling 'app:/'+filename. If I launch the test in the IDE from FB, it works but the Workers don't. I should mention, the reason I'm using this method is that I have so many graphical assets, it's just easier to maintain/update this way instead of using [Embed.. ] for all my items, and it just works in the IDE...
I've added my folder to my sources locations in Flash Builder, still it seems I cannot use the 'app:/' thing.
How can I make this work so I don't change my code and still use 'app:/'? FB is such a confusing program...
edit : I tested again the workers in the IDE build launched by FB (the test in flash IDE icon), I can trace its state with :
worker.start();
worker.addEventListener(Event.WORKER_STATE, this._handleWorkerState);
private function _handleWorkerState(__e:Event):void{
trace(__e.currentTarget.state);
}
traces 'new' then 'running'. But for some reason, it doesn't send or receive any data from any message channel, which, again, works in FB4.7 when i run a debug but doesn't find my files....
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: app:/foldername..
So basically, I'm looking for a solution to at least one of my problems :)
EDIT :
So ok. Here it is, one issue was due to the wrong debugger version installed (for the workers part). So I can now work and compile in the IDE again. I haven't found an answer to why 'app:/' doesn't work from FB4.7. So that would be the remaining question.
One option since you have Flash IDE is to create a library with all of your images. Drop all your images into the library in Flash and export them for actionscript. Then publish and create a a SWC. Then you can use the swc, which is kind of like a zip file for display objects, in flashbuilder and access them like:
var mc:MovieClip = new imageExportedForAS3_1()
Create a top level folder in your flex project called for example images, copy all of your images into that folder, then every time you need to load an image, just use the source attribute and use the absoulte rute, for example.
<mx:Image source="#Embed(source='../images/pic.png')"
I have never used the app:/ sentence before! Good luck!
I have one simple question conserning PhoneJS http://phonejs.devexpress.com/Documentation
and it's demos - how to launch and preview them on Android devise?
I've loaded a package and tried to run demos through Eclipse, using
webView.loadUrl("file:///android/html/index.html");
But only black screen is visible.
Thanks!
I also not found this PhoneJS information in documentation. I wrote to support and they told me PhoneJS application is like any PhoneGap based application can be packaged with PhoneGap and in http://build.phonegap.com site.
PhoneGap Build worked well, but it is little slow.
Do you see any errors or simple black screen?
Possible files, mentioned in the index.html file, are spelled in the different case from files on the disk, e.g. you have line
script type="text/javascript" src="data/db.js"
but on the disk there is "Data" (not "data") folder or "Db.js" (not "db.js") file.
It makes sense then application is uploaded on android device. You should ensure file names spelling.
Thanks, Serge
I've spent almost a week on this now, trying to get FFmpeg "Angel"/"Happiness" to build for Android.
I've tried build scripts from all over the internet to no avail. I got closest was using this. As the author himself says the script doesn't work for newer versions of FFmpeg due to this bug, which has been dismissed on that ticket saying "I found a Makefile that does it." This was dis-heartening, being the only post on all of the vast Google world that was anywhere close to my problem.
So, question time:
Is there a way to get around the above bug? I'm trying to use the newest ffmpeg API, and "Love" is just giving me "undefined reference" errors while trying to use av_encode_video2(), and av_free_frame(). The code I was working on the lines of is at the ffmpeg git repo, under /doc/examples/decoding_encoding.c (the function starting on line 338).
Update: So they've done away with codec_names.sh in "Angel". Sorry didn't notice that before, but the problem persists in a different avatar now. With every build attempt the compiler throws a certain
start ndk-building...
/home/<user>/android-ndk/build/core/build-binary.mk:41: *** target file `clean' has both : and :: entries. Stop.
Say whatnow!?
Given the lack of any response at all, I'm assuming people who know their shit in this topic are really busy putting their skills to use with whatever they managed to compile. For the ones like me who scraped each corner of the web for an answer that makes any little sense, I have a.. more than decent workaround.
The Guardian Project, an awesome resource on github, has the perfect project set up for building an ffmpeg binary with all the settings of your choice. But just the one big problem of getting it to successfully build sans the "Unable to create executables" error.
So.. there's a way out there too. Less flexible, but it saves you from losing any more hair than I'm sure you (like me) already have. Head out here and profit.
From running the file command I noticed this binary was dynamically linked, that seemed weird, but it works.
Also, you'll have to run the chmod command before using it on the device (being a binary file and all). So pop it into your res/raw/ folder, load it up when needed and edit those videos like there's no tomorrow!
With the fantastic help of Tim on this thread Controlling Android app with bluetooth mouse/ presenter I added bluetooth remote control of my application. After finishing this, I noticed my apk file went from 175k all the way to 1711k - 10 times larger! I have implemented the bluetooth changes on a test application without seeing any change in file size so I am not sure what caused this. I did have some kind of Eclipse problem in the middle of this and had to do a rebuild to get the source to run again so maybe that had something to do with it.
Searching for file size change here and on Google gives me questions of people who want to make larger files to hold more stuff, not my question. I can't seem to find relevant answers.
The application has no graphics, pdf's, or other files of any size at all. It just reads some GPS stuff, does some math, and displays the results as text.
Is there some way to get the file size back down? Is there an Eclipse option? This is my first real (non test) application and it is finished and working but I am concerned with the file size increase.
You can check the contents of apk file easily. An apk file is simply a zip file with different extension. Just replace .apk with .zip and unzip it. Then diff the contents with your previous .apk file and find out what file makes the difference.
I encountered a similar problem with the APK size. One way to check out which resources are the culprits is to 'Open Editor Log' in Console.
Some helpful explanations can be found here:
Unity build project game 2d to apk with huge size because textures
https://docs.unity3d.com/432/Documentation/Manual/ReducingFilesize.html