OpenGL ES 2.0 games possibility - Nexus One Android Development

I've been hankering to start porting a game I've been working on(originally was going to be for Zune HD but they haven't released the damn 3D SDK. Video of it running in windows is available on youtube, where my username is marcusmaximus04) to android but was hesitant due to the lack of OpenGL ES2.0 support in the Android SDK. However, looking through the file system on my nexus one, I spotted the file libGLESv2.so, which appears to be the shared object file for exactly this!
Obviously, I still can't use the normal SDK to use this, but in theory, one could use the NDK to use OpenGL ES 2.0 features(shaders, etc) through that shared object file.
The purpose of this post is three-fold. One I want to know if anyone has any background with using OpenGL through the NDK or knows of any tutorials for doing so(I'm not entirely sure how that would work...). Two, I wanted to bring this to the attention of all the devs out there who might be holding off from using ES 2.0 features. And three, I wanted to let everyone else know that such a thing is possible, just 'cause it's exciting.
At any rate, even if I can't find any tutorials I'll probably start plugging away at getting this to work and this should make for an exciting couple weeks/months.
Since we have this pretty well working(even on non-rooted phones) I'll post a sample apk. It doesn't look like much, but it does prove that we're using OpenGL ES 2.0(this will only work on the Nexus One). I'll also post the libGLESv2_adreno.so shared library in the same zip file. Enjoy .

From http://developer.android.com/guide/topics/graphics/opengl.html:
note that though Android does include some basic support for OpenGL ES 1.1, the support is not complete, and should not be relied upon at this time.
Click to expand...
Click to collapse
so official 2.0 support might be a bit off :/

kozm0naut said:
From http://developer.android.com/guide/topics/graphics/opengl.html:
so official 2.0 support might be a bit off :/
Click to expand...
Click to collapse
Possibly, but it does still support it in the NDK(really, this hardcore graphics stuff should be done in the NDK anyway). Even there it's not really official, but they aren't likely to change the API calls since those are already set in stone by khronos.

Hi Marcus,
to get started, grab the OpenGL ES 2.0 headers from www DOT khronos.org/registry/gles/ and copy the library file from your phone to the NDK installation dir (build/platforms/android-4/arch-arm/usr/lib/). Next you might inspect the libGLESv2.so with objdump to see what functions it provides:
build/prebuilt/linux-x86/arm-eabi-4.2.1/bin/arm-eabi-objdump -t libGLESv2.so
It should have the 2.0 functions like glCompileShader(), glCreateProgram(), etc.
Finally, add the following line to the Android.mk file in the jni/ directory of your Android project:
LOCAL_LDLIBS += -Lbuild/platforms/android-4/arch-arm/usr/lib -lGLESv2
If you're lucky, that should allow you to compile and link OpenGL ES 2.0 code. I cannot try this right now but will as soon as I get my Nexus One on monday
I haven't done any OpenGL ES coding with the NDK, but it should be straightforward if you've written OpenGL (ES) code before. This might be of use: code DOT google.com/p/glesquake/

robert-qfh said:
Hi Marcus,
to get started, grab the OpenGL ES 2.0 headers from www DOT khronos.org/registry/gles/ and copy the library file from your phone to the NDK installation dir (build/platforms/android-4/arch-arm/usr/lib/). Next you might inspect the libGLESv2.so with objdump to see what functions it provides:
build/prebuilt/linux-x86/arm-eabi-4.2.1/bin/arm-eabi-objdump -t libGLESv2.so
It should have the 2.0 functions like glCompileShader(), glCreateProgram(), etc.
Finally, add the following line to the Android.mk file in the jni/ directory of your Android project:
LOCAL_LDLIBS += -Lbuild/platforms/android-4/arch-arm/usr/lib -lGLESv2
If you're lucky, that should allow you to compile and link OpenGL ES 2.0 code. I cannot try this right now but will as soon as I get my Nexus One on monday
I haven't done any OpenGL ES coding with the NDK, but it should be straightforward if you've written OpenGL (ES) code before. This might be of use: code DOT google.com/p/glesquake/
Click to expand...
Click to collapse
Alright! Thanks for the help. I've done a lot of opengl work before and a little bit of opengl es when i had my g1 but haven't ever used the ndk, so that'll get me started.
EDIT: Sweet, I've dumped the list of functions available and it looks like all the appropriate shader functions are there. I'm attaching the full list output from my computer. I actually had to use arm-eabi-strings, since the objs one showed no objects. Regardless, it's looking good on the OpenGL ES2.0 front, and I've already looked into running opengl code from the NDK which is perfectly possible and ok.
ANOTHER EDIT: Haven't quite gotten it to build yet, but I got it to load gl2.h without any complaints. Now I just have a crapload of errors because the sample project I was using(from the ndk samples, san-angeles) was written for OpenGL ES 1.0 and all the things now done in shaders no longer exist(GL_LIGHTING, GL_MATERIAL, etc). Regardless, I'm considering this a success so far, since all that is expected.
YET ANOTHER EDIT: It runs! I'm not displaying anything yet(so it's not really a good test), but I got the shared library to build using OpenGL ES 2.0 and it runs on my phone. Gonna implement a simple program to display a triangle or something just to prove it works and will provide source code/binaries here(also, if anyone has a Droid or knows someone who does, it'd be great if we could test out to make sure this works on the Droid as well)

I just wanted to drop in and say I'm very interested in what y'all are doing I'm of very good at coding. All I know is Java but ill definantly be following yall and keep up the good work

Decided to post a reply, rather than just adding to that one post.
Well, I encountered a fairly large roadblock:
Code:
E/libEGL ( 3366): called unimplemented OpenGL ES API
That's what I see now every time I call one of the functions dealing with ES 2.0. I'm hoping there's another library I can use that'll make that go away, but we might not be as easy as I thought to do this.

That's bad news indeed. I was hoping that everything is in place and Google just didn't release a new NDK with ES 2.0 support yet, but if the libGLESv20.so is merely a stub, we're pretty much out of luck. I'd probably disassemble the file to see if there's actually some code besides "return unimplemented" in there, but even if there was, I'd have no idea on how to continue...
I'm wondering how they render the fancy rain drop effect on the wallpaper. Looks like a perfect fit for a 2.0 fragment shader, however there are a lot of other ways to create that effect.

robert-qfh said:
That's bad news indeed. I was hoping that everything is in place and Google just didn't release a new NDK with ES 2.0 support yet, but if the libGLESv20.so is merely a stub, we're pretty much out of luck. I'd probably disassemble the file to see if there's actually some code besides "return unimplemented" in there, but even if there was, I'd have no idea on how to continue...
I'm wondering how they render the fancy rain drop effect on the wallpaper. Looks like a perfect fit for a 2.0 fragment shader, however there are a lot of other ways to create that effect.
Click to expand...
Click to collapse
Well I managed to view the assembly code, but can't get it into any form that I can/want to read(I know how to read assembly but unless you spend hours with it, it's damn near impossible to decode anything. Plus, I haven't looked at ARM assembly before). Know of a good program to convert it into C?
At any rate, I'll attach the disassembler dump(ran it using arm-eabi-objdump with flags -DS). From looking at it briefly, all the implemented functions look like they might be stubs since they're pretty bare bones and have almost all the same instructions(with a slight modification to one single instruction). But it's hard to tell with assembly. Let me know if you can make anything of it. I had to attach the file in a .zip by the way because it was too big.

SUCCESS!!!! So, it looks like those functions were stubs. Google seems to have done it intentionally for whatever reason. They took the .so that actually worked(libGLESv2_adreno200.so) and shoved it under /system/lib/egl, which the ndk doesn't seem able to access(gives you a runtime error if you linked against it). However, If you just copy that file to /system/lib (yes, this requires root unfortunately) then you can use it. I successfully drew a triangle using shaders .
I'll try to get it to attach that xxx_adreno200.so file to the .apk so it can be used without messing around with such things(and work without root). If I can, then I'll throw it on here so everyone can see. Right now it's just a triangle, but tomorrow: the world.
EDIT: Alright, I attached the .apk(it's in the zip file, xda still doesn't allow posting .apks). I tried to attach the libGLESv2_adreno200.so library to it, so it wouldn't require moving the local one but it just wouldn't accept it. So, at least for the mean time, if you want to actually run that app without having it crash you'll have to do an adb remount and then the following in the terminal(or adb shell) as root:
Code:
cd /system/lib/egl
cp libGLESv2_adreno200.so ../
Once you do that, when you run the app it should display a yellowish triangle on a blue background(it was from the second tutorial from the OpenGL ES 2.0 sdk for PowerVX). Like I said, it's not much right now, but it is using custom shaders to display that triangle.
ANOTHER EDIT: I decided to change the test program a little. All I changed was the fragment and vertex shaders, which I made to change the color of the pixels based on where they are on the triangle. This should show(to those of you who know OpenGL) that it really is using custom shaders, since it's one triangle and it's clearly not using fixed-function pipeline shading .

Awesome work on reverse-engineering this! Keep us posted.

Indeed, keep at it Marcus! Very interested to see how this progresses.

Well done, Marcus! I'm glad you found that working library.
You should be able to embed the library search path in your own library by using the rpath directive while linking your program. See "man ld" for more information. You need to get the NDK to call the compiler like this:
gcc ... -Wl,-rpath=/system/lib/egl
That should allow you to use that library without copying it around, and therefore make it work on non-root phones as well.
I guess all you need to do is add the directive to the LOCAL_LDLIBS variable in Android.mk, or maybe it has LOCAL_LDFLAGS, which would be more appropriate.

robert-qfh said:
Well done, Marcus! I'm glad you found that working library.
You should be able to embed the library search path in your own library by using the rpath directive while linking your program. See "man ld" for more information. You need to get the NDK to call the compiler like this:
gcc ... -Wl,-rpath=/system/lib/egl
That should allow you to use that library without copying it around, and therefore make it work on non-root phones as well.
I guess all you need to do is add the directive to the LOCAL_LDLIBS variable in Android.mk, or maybe it has LOCAL_LDFLAGS, which would be more appropriate.
Click to expand...
Click to collapse
Ya, I tried adding it to LOCAL_LDLIBS, but that just seemed to make it use that path for the local library on my computer when building it. It still failed to find that library on my phone when I ran it. I'll try poking around a little more since that would obviously be ideal.

Alright. Are you sure you used rpath and not rpath-link?
BTW, there's a libGLESv2.so in the 2.1 emulator image. Did you try using that? I wonder if the emulator supports ES 2.0...

robert-qfh said:
Alright. Are you sure you used rpath and not rpath-link?
BTW, there's a libGLESv2.so in the 2.1 emulator image. Did you try using that? I wonder if the emulator supports ES 2.0...
Click to expand...
Click to collapse
I didn't touch either actually, just changed the name of the library and the path it had. I haven't done a lot of make files beyond the most basic operations so a little study might be necessary.
Haven't tried the emulator image one, but the one from the phone just had those stubs. It would be really strange if the emulator had the actual functionality and the phone didn't.
I think you're right that if there's hope then it lies in the makefile, so I'll keep looking into that.
EDIT: Just tried adding --rpath=/system/lib/egl everywhere I could possibly think of and all with no change.

Hmm I can't try this yet, but it looks like it uses the property java.library.path to determine where to look for shared libraries. Maybe I can have it look in /system/lib/egl too?
Ack, tried it, didn't do anything. Still can't find that library.
So ya, I'm giving up on this front for now. Google obviously has some of this ready but doesn't want us using it for now, so I'll just wait for them to give us access unless I get some new info. In the meantime, I'll continue the work I've already started on porting that game from the video I linked to. At least we now have the tools to test this stuff.

[email protected] said:
Hmm I can't try this yet, but it looks like it uses the property java.library.path to determine where to look for shared libraries. Maybe I can have it look in /system/lib/egl too?
Ack, tried it, didn't do anything. Still can't find that library.
So ya, I'm giving up on this front for now. Google obviously has some of this ready but doesn't want us using it for now, so I'll just wait for them to give us access unless I get some new info. In the meantime, I'll continue the work I've already started on porting that game from the video I linked to. At least we now have the tools to test this stuff.
Click to expand...
Click to collapse
thats depressing i was checking this thread like 10 times a day waiting for new info to popup lol call me obsessed but i respect your work

Yet another idea to try. On Linux you can specify the library search path using the environment variable LD_LIBRARY_PATH, e.g. if you run a program like this
LD_LIBRARY_PATH=/some/path /path/to/program
then the linker will search that path for libraries.
Maybe it's possible to set that variable from within the Java code, but before the JNI library is loaded:
static {
// Set environment variable LD_LIBRARY_PATH
System.loadLibrary("your_jni_lib");
}
Finally another idea, so we cannot link our library to the OpenGL ES library. But we could probably dlopen() it from within the JNI library and grab all the function pointers using dlsym(). I will get my Nexus One in a few hours, and ES 2.0 will be one of the first things I'm going to look into
EDIT: Marcus, would you mind posting the source code of your ES 2.0 triangle demo application? Basically all I need is the gl....() stuff. I haven't done too much Shader stuff so far, so that would save me a lot of time.

robert-qfh said:
Yet another idea to try. On Linux you can specify the library search path using the environment variable LD_LIBRARY_PATH, e.g. if you run a program like this
LD_LIBRARY_PATH=/some/path /path/to/program
then the linker will search that path for libraries.
Maybe it's possible to set that variable from within the Java code, but before the JNI library is loaded:
static {
// Set environment variable LD_LIBRARY_PATH
System.loadLibrary("your_jni_lib");
}
Finally another idea, so we cannot link our library to the OpenGL ES library. But we could probably dlopen() it from within the JNI library and grab all the function pointers using dlsym(). I will get my Nexus One in a few hours, and ES 2.0 will be one of the first things I'm going to look into
EDIT: Marcus, would you mind posting the source code of your ES 2.0 triangle demo application? Basically all I need is the gl....() stuff. I haven't done too much Shader stuff so far, so that would save me a lot of time.
Click to expand...
Click to collapse
Sure. I'll post it when I get home from work tonight. I don't have anything proprietary in there yet.
For the setting of the environment variable, from my understanding that's basically what System.SetProperty("java.library.path"... is supposed to do. But it still couldn't find the library and didn't seem to have any effect.
The dlopen bit might work. I was thinking of trying that but haven't had any time. I'm not really too sure on how these shared libraries are used, whether once they're open any other program can find and use them or whether the path to them has to be given explicitly at link time for the program that wants to use them and just generally having one loaded won't help.
EDIT: By the way, @pr0cl1v1ty: Don't worry, I'm not going to stop digging into ES 2.0 entirely. I'm just not going to be pushing as much for getting it to work on non-rooted phones. I've got bigger fish to fry.

Related

Almost working: Stock 2.1 Nook Color Reader and Library

I am trying to get the Library and Reader apks from the 2.1 working on cm7. I am fairly close (I hope), the next thing I have to do is sign the apks with the same key as the other apks that share the "media" userid.
If you copy over the following files you will get to where I am at.
[not sure what apks I will need just yet, so this might change]
Code:
/system/app/CryptoServer.apk
/system/app/GlobalSearch.apk
/system/app/Home.apk
/system/app/Library.apk
/system/app/Reader.apk
copy these supporting libraries/files
Code:
/system/framework/bncloudapi.jar
/system/framework/com.bn.authentication.jar
/system/framework/com.bn.cloud.jar
/system/framework/com.bn.gpb.jar
/system/framework/com.bn.provider.utils.jar
/system/lib/libbndeviceinfo.so
/system/lib/libbravodeviceinfo.so
/system/lib/libpdfhost.so
/system/etc/permissions/com.bn.app.crypto.xml
/system/etc/permissions/com.bn.app.deviceinfo.xml
Edit the following file and add the information below
Code:
/system/etc/permissions/platform.xml
This will declare the library in order for the apps to use it.
Code:
<!-- This is a list of all the libraries available for application
code to link against. -->
<library name="android.test.runner"
file="/system/framework/android.test.runner.jar" />
<library name="javax.obex"
file="/system/framework/javax.obex.jar"/>
<library name="com.bn.gpb"
file="/system/framework/com.bn.gpb.jar"/>
<library name="bncloudapi"
file="/system/framework/bncloudapi.jar"/>
<library name="com.bn.cloud"
file="/system/framework/com.bn.cloud.jar"/>
<library name="com.bn.authentication"
file="/system/framework/com.bn.authentication.jar"/>
<library name="com.bn.provider.utils"
file="/system/framework/com.bn.provider.utils.jar"/>
Once you have all this in place, restart the device. Logcat will complain about the wrong certificate for the user android.media.
My next steps are to find out which apks on cm7 use this shared id and resign them all with the same key.
Once that is done, I will launch the Library and Reader with the following commands in adb to attempt to start the activities:
Reader
Code:
am start -a android.intent.action.VIEW -n com.bn.nook.reader.activities/com.bn.nook.reader.activities.ReaderActivity
Library
Code:
am start -a android.intent.action.MAIN -n com.bn.nook.library/com.bn.nook.library.LibraryMainActivity
Very interesting concept. Possibly post in other developers sections than the NC - you may get some support.
I'm not a coder but I follow the concept.
I hope you and others are able to get this to work, because the stock reader app is my favorite.
Not sure if you've already caught this, but from looking at files so far in the APK I think there is a call being made to check for the version of android (specifically Android SDK 7 (2.1)). Is this something you got around by recompiling it?
I've made more progress. I signed the apks with ZipSigner (free in the market). I am getting some force closes trying to run the Library right now, which means I probably need to sign more of the BN apks.
FYI, if anybody else wants to give this a shot, my steps were:
1. edit the apk with 7zip and remove the META-INF dir (not sure if this is required by zipsigner) to unsign it
2. push the unsigned apk to the nook's sdcard
3. From the nook run ZipSigner and choose "media" for the key
4. sign it
5. copy the signed apk to /system/app
If you do this with the Library you should see it show up in the app drawer.
i would love to see this working
Pyrot1c said:
i would love to see this working
Click to expand...
Click to collapse
Agree'd I tried this a while back, but I really know nothing about dev stuff for android, so I didn't get far, I was really hoping someone with the know how would do this.
More Power to you. Can't wait to see this working, the library and shop apps that come with the nook color, are so much better than the Nook app off the market.
I've made a little more progress. I had to decompile the cm7 framework.jar and add some files from nook's framework.jar. I also had to merge changes into 2 files. This was all in order to get the Library app up and running. I have it loading up and I am able to see my sd card.
When I click on an epub it tries to launch the Reader but for some reason the Reader app isn't finding the libpdfhost.so shared library.
I will post instructions on what to do to the framework.jar to get the Library app up and running, but I think long-term it won't be feasible to have since the changes will need to be applied every cm7 update.
What will probably happen is I will make an app that handles epub intents and passes that off to the Reader app. The Library is adding some extra info when it starts the Reader app so I will need to copy that.
This will all be possible once I figure out why the shared library isn't being loaded properly.
Nice job man! Keep it going
Would love to see this working as well keep up the good work
Really cool.
Great progress so far. If you need a tester I'm.
I completely understand why CM can't distribute B&N software, but often it is not recognised that to many of us, the Nook Color is a family device. So it would be great if we can make these mods ourselves.
With the Market Nook app not having newspapers and magazines or NC childrens books, we still have to accommodate the entire family, in which some members of mine, still think of Gingerbread only as a type of cookie.
While I think about it...mmm ..could the library not be found because the original app's code was written to look within the file structure of Eclair instead of Gingerbread and Ext4? Or have you completely rewritten the code for the new file structure? Just thinking on my feet before I seriously studied the posted commands.
Thanks again!
Following this thread with great excitement. I would love to be able to run CM7 but still have the stock nook color app (which supports magazines, nookbooks for kids, etc.). Keep up the great work!!!!
/Kevin
OMG this would be awesome!!!
JoshMiers said:
I've made a little more progress. I had to decompile the cm7 framework.jar and add some files from nook's framework.jar. I also had to merge changes into 2 files. This was all in order to get the Library app up and running. I have it loading up and I am able to see my sd card.
When I click on an epub it tries to launch the Reader but for some reason the Reader app isn't finding the libpdfhost.so shared library.
I will post instructions on what to do to the framework.jar to get the Library app up and running, but I think long-term it won't be feasible to have since the changes will need to be applied every cm7 update.
What will probably happen is I will make an app that handles epub intents and passes that off to the Reader app. The Library is adding some extra info when it starts the Reader app so I will need to copy that.
This will all be possible once I figure out why the shared library isn't being loaded properly.
Click to expand...
Click to collapse
Have you given libpdfhost.so the correct permissions? If not chmod that mofo.
I attempted this a few weeks back myself. Your first post describes my findings exactly, including which files to copy over and adding the shared libs to platform.xml. Your followup post on modding the framework and getting the Library to stay open without FC is further than I got, however. If you want to compare notes, hit me on freenode, #nookie.
In the end, I gave up primarily because the work involved seemed to not be work it considering the Nook app from the market is quite good. The only thing it lacks is magazine subscriptions, I think. I might like a second look considering you seem to be getting closer.
-Muffin
that would be real cool if you guys could make this work.
I wish i knew how to make apps... but i'm not talented like that unfortunately.
anyone got an idea as to how to deal with the home button not working after upgrade? how about clearing of opened up apps in the notification section? how about closure of apps after being done with them as not all apps have exit button ?
i'd appreciate any comments.
thanks
Subscribed. This is the only thing keeping me from upgrading to a Froyo/GB/Honeycomb build.
Also sub'ed ... about to go with a dual-boot Stock+Froyo but would love to have the app on Froyo so I could dump stock.
This is the only thing holding me back from completely getting rid of stock. I actually use Aldiko for reading most of my books but am really looking forward to being able to read magazines from CM7.
I just wanna say keep up the good work. Your progress looks promising thus far.
Having this as an option would be great... seriously.
Work was busy last week so I didn't have much time to look into this.
I have hit a few potentially serious roadblocks. Other than needing to modify the framework.jar (with fairly simple changes) I will also need to either modify the MediaProvider.apk or write my own media provider that declares the content:// URLs that the Reader and Library apps expect.
I figured out how to launch the Reader apk from the commandline, so it will be trivial to write a front-end to do this when an epub is clicked. Also, I have gottem the Reader app to display the first page of my epub before force closing (due to unhandled content:// intents).
I was going to just stop working on this since Aldiko is suitable for my needs right now, but judging by the replies I will keep banging on it and try and write a media provider for all the content intents being sent.

[Release] PSXPeria: Native PSX Emulator ISO Converter

PLEASE, PLEASE post all your issues and bug reports regarding the converter at github. https://github.com/yifanlu/PSXperia/issues Also, include detailed information such as a copy of the converter output, android's logcat, etc. If your bug is reported already, make a comment with your system information and logs on the issue so I know multiple people are experiencing it.
Links
My site http://yifan.lu/
First writeup, about the formats and disassembling
Second writeup, about decrypting files, cracking the format, and such
YouTube video of Xperia Play running Crash 3
Source code
1.0 binary jar (command line & gui)
Wiki: detailed usage guide, compatibility list, etc
Stuff that's done
Reversed engineered all propriety formats (image.ps,zpak,toc,etc)
Extracted and decrypted emulator binary
Mapped out important functions
Patched TOC functions to load unencrypted tables (wrapper library)
Tool to extract image.ps into an ISO
Tool to convert an ISO to image.ps
Tool to generate modified APK with wrapper library, custom text, icon, and data (converter backend)
Tool to extract Crash Bandicoot and patch some files for the converter
Command line interface (frontend)
GUI (frontend)
Remove requirement for "aapt" and "jarsigner" in PATH.
Bug bashing
Stuff for the future (no promises)
Load gamedata/icon into converter from XML file (name,titleid,etc)
Batch convert
Multidisk
Game manual
Check out this guide if you are having any problems. It contains a detailed usage directions, some guidelines for settings, and troubleshooting advice. If you still can't get it working, submit a bug report here.
Nice to see someone starting on this ,, I Bought syphon filter. Just tell me what to do and I ll do it.
good luck m8
We cannot share paid games, you will have to get someone who has bought the game to do a memory dump for you ........
Sent from my R800i using Tapatalk
Why doesn't someone just donate the money so he can buy a game? I'd do it but I'm buying a house.
How much does any multi-disk game costs? SE's PSX market is not available here.
The problem is... AFAIK, no multidisk game is available in the PSX market.
AndroHero said:
We cannot share paid games, you will have to get someone who has bought the game to do a memory dump for you ........
Sent from my R800i using Tapatalk
Click to expand...
Click to collapse
Yes, I know. I only really need the first 40 bytes or so of image.ps from the ZPAK.
gojoechris said:
Why doesn't someone just donate the money so he can buy a game? I'd do it but I'm buying a house.
Click to expand...
Click to collapse
First, I can't access the store because I have the R800i and am in US. Second, it is a rule of mine to never accept donations until after a project is completely finished.
yifanlu said:
First, I can't access the store because I have the R800i and am in US. Second, it is a rule of mine to never accept donations until after a project is completely finished.
Click to expand...
Click to collapse
That's interesting to learn. My phone is an unlocked R800a that I'm using on AT&T. I installed the unlocked UK firmware on it and it now reports as an R800i in the "About phone" section. However, as of the last month or so, I can finally see games in the PlayStation Pocket app store. I wonder if it's using the IMEI or something like that to report to the store for the region?
If you use a User Agent String changer to match that of the r800a and use a proxy so that the website thinks you are in the proper country you can maybe able to download the games that way.
I can confirm this worked for the gameloft wapshop from my desktop. I have never seen where the psx games come from so I cant guarantee it, but it is worth a shot.
They're actually in the Android Marketplace. For the longest time, they were limited to Europe, but now they're available in the US. Perhaps it might be possible to purchase them from there and remote install them to the phone?
Again all that can be done with the ua switcher and a
Proxy in firefox. Android market is available via your browser. Could be worth a shot.
sent from the original unlocked R800x.
I'm sure there'll be no need to break a sweat about this.
LOL @ashergray's sig
Logseman said:
I'm sure there'll be no need to break a sweat about this.
LOL @ashergray's sig
Click to expand...
Click to collapse
I figured I earned it. I was for about 20 minutes the only unlocked R800x.
That felt pretty awesome.
So I have extracted ALL the encrypted files now, this means libdefault.so, image_ps_toc, and ps1_rom.bin. It was pretty hard because it was obfuscated in memory, but I got it using another, unorthodox method. Now, here's the weird thing. I can't figure out how the PS1 bios works. It's not a copy of any of the BIOS floating around the internet, in fact, it's not even the same format (all the bios that can be found on the internet have a similar structure). In addition, I still can't figure out what image_ps_toc is for. If anyone wants to take a look at these files for me (I've already decrypted them, you're welcome), PM me.
EDIT: I spoke too soon, I found out that the PS1 ROM is actually part of the PS2 BIOS. Yea, wtf. It seems to be using the PS1 emulator bios from the PS2, or something like that. Now, to find what the toc file is.
yifanlu said:
So I have extracted ALL the encrypted files now, this means libdefault.so, image_ps_toc, and ps1_rom.bin. It was pretty hard because it was obfuscated in memory, but I got it using another, unorthodox method. Now, here's the weird thing. I can't figure out how the PS1 bios works. It's not a copy of any of the BIOS floating around the internet, in fact, it's not even the same format (all the bios that can be found on the internet have a similar structure). In addition, I still can't figure out what image_ps_toc is for. If anyone wants to take a look at these files for me (I've already decrypted them, you're welcome), PM me.
EDIT: I spoke too soon, I found out that the PS1 ROM is actually part of the PS2 BIOS. Yea, wtf. It seems to be using the PS1 emulator bios from the PS2, or something like that. Now, to find what the toc file is.
Click to expand...
Click to collapse
TOC maybe contains sub-channel data, known from original PSX CD-s, which served in copy-protection mechanism?
I've been trying to find some information on the PSX iso format, like what's at the different offset, where checksums are, where the executable starts, etc, but google isn't helping. Can you tell me more about this? If this copy protection thing is true, that means every game has a different libjava-activity.so. Could someone with another game pm me with /data/data/packagename/libs/libjava-activity.so where package name starts with com.sony and ends with the titleld? Also, Blagus, if you want, I can let you take a look at the decrypted toc files.
yifanlu said:
I've been trying to find some information on the PSX iso format, like what's at the different offset, where checksums are, where the executable starts, etc, but google isn't helping. Can you tell me more about this? If this copy protection thing is true, that means every game has a different libjava-activity.so. Could someone with another game pm me with /data/data/packagename/libs/libjava-activity.so where package name starts with com.sony and ends with the titleld? Also, Blagus, if you want, I can let you take a look at the decrypted toc files.
Click to expand...
Click to collapse
You may want to download original Crash PSX image in CloneCD format, which comes with CUE, IMG and SUB files. Check the SUB file size, if it's approximate to TOC fle, then it might be worth downloading it.
Blagus said:
You may want to download original Crash PSX image in CloneCD format, which comes with CUE, IMG and SUB files. Check the SUB file size, if it's approximate to TOC fle, then it might be worth downloading it.
Click to expand...
Click to collapse
I made an image using CloneCD and looked at the subdata file. It's 25MB uncompressed and 4MB compressed. The TOC file is 67KB, so I don't think that's it.
maybe it stands for Table Of Contents.
sort of a way to keep track of all the files within the package.
ashergray said:
maybe it stands for Table Of Contents.
sort of a way to keep track of all the files within the package.
Click to expand...
Click to collapse
It seems like a license or license check. I used the libjava-activity for another game, and it said could not authenticate the licensed content.

[UPDATE] Memory issue with kexec.

UPDATE:
So it seems as though i have solved that problem, and now i just away the kernel modules. Thanks for all your help guys.
Code:
adb shell /data/local/kexec /data/local/uImage
MSTART= 12668952828585181184 MEND=18014435486466048 MEMTYPE=0 NR_SEGMENTS=0 ULONG_MAX= 4294967295
MSTART= 12668952829122052096 MEND=18014435822010368 MEMTYPE=0 NR_SEGMENTS=0 ULONG_MAX= 4294967295
MSTART= 12668952829390487552 MEND=18014436090445824 MEMTYPE=0 NR_SEGMENTS=0 ULONG_MAX= 4294967295
start= AFD1297980000000 mem_min= 0 hole_min=0 end=4000089C000000 mem_max =FFFFFFFF hole_max=FFFFFFFF
Cannot open /proc/atags: No such file or directory (Doesnt really matter from what ive read)
kexec_load failed: Function not implemented (The module)
entry = 0x80008000 flags = 280000
nr_segments = 2
segment[0].buf = 0x2e4e8
segment[0].bufsz = 10
segment[0].mem = 0x80001000
segment[0].memsz = 1000
segment[1].buf = 0x403ff048
segment[1].bufsz = 2c4214
segment[1].mem = 0x80008000
segment[1].memsz = 2c5000
So hears the deal myself and gameman73 have been working our a**es off trying to get this KEXEC to compile and work. The problem is the current memory will not allow for certain calls to the iomem.
We need to find a way to have this line of code compile and be true on our devices. If someone could sift through the code alittle that be well appreciated:
Code:
kexec/kexec.c 230: while ((j < info->nr_segments) && (([B](unsigned long)info->segment[j].mem) <= mend[/B]))
Apparently it thinks info->segment[j].mem is a const * void
Here's the source http://horms.net/projects/kexec/kexec-tools/kexec-tools-2.0.2.tar.bz2
When I work on something, I often find that having a complete understanding of the problem makes the solution clear. Perhaps this will help you understand the problem better:
SEE ATTACHED FILE, FIRST LINK*
Related. Looks like you aren't the first person to have a problem with the way memory is called in kexec. You might be able to work something out from this discussion, however old it may be.
SEE ATTACHED FILE, SECOND LINK*
This is something else about disabling kexec from executing. A workaround is discussed, but I am by no means a developer and I can't make any sense of it. Just giving you what I find.
I don't mean to spam, and I don't want to be the typical noob getting in the way, but I do want to help. Research, it seems, is about all I can do until my unit arrives (hopefully tomorrow).
*edit: since this is my first post, please excuse the attached file. It is only because with less than 8 posts I cannot put the links in the body of my message.
twodollaz: research is awesome. digging that crap up is a giant pita.
loglud: did you guys get kexec-mod compiling and loading? i haven't had time to look at it much, but all the sources i've found require a huge amount of work to compile, let alone load and run. do y'all have more information on that? i'd look at why the line you mentioned isn't working but i have no frame of reference if i can't reproduce it myself :-/
Actually you really don't need the module to reproduce the error that I am talking about. But gameman73 does have a fully compiled module loading into insmod. And it is showing as installed. You can ask him.
As for you links twodollaz there actually very useful, however not for our problem. The problem that they are incurring is that of the memory not being malloced, or assigned to the process. Our problem is that according to the program there is no memory existing, (the page is there but the lines are not). I think i might have found a solution last night while sleeping ironically, however i am in work and cant test till I get home.
You've gotta love it when your subconscious does the work for you.
If you guys need more help with this I would be glad to join in. I have literally no experience with kernels, hardware, etc though so I will need some hand holding to get kexec loaded and testing. Once I have the build/run setup I might be able to help. I am a programmer by trade, mostly java based, but can write c/c++ when pressed. Alot of what I do on a day to day basis is pull apart other people's code and fix it, optimize it, etc - mostly in a JVM but I have done this some for system cores.
zambien said:
You've gotta love it when your subconscious does the work for you.
If you guys need more help with this I would be glad to join in. I have literally no experience with kernels, hardware, etc though so I will need some hand holding to get kexec loaded and testing. Once I have the build/run setup I might be able to help. I am a programmer by trade, mostly java based, but can write c/c++ when pressed. Alot of what I do on a day to day basis is pull apart other people's code and fix it, optimize it, etc - mostly in a JVM but I have done this some for system cores.
Click to expand...
Click to collapse
zambien you are my new best friend. If you could take a look at what are valid memory locations in the locate_holes function that would be amazing. So far when i do an
Code:
fprintf(stderr, "mem= %li...",(unsigned long)info->segment[j].mem))
i always get nothing. I think this might be because j needs to start at 1 but idk. if you could find a way to iterate through
Code:
info->segment[j].mem
and find where it is valid, we might be on our way.
Forgive me if I'm way off, but how does this sound? I don't know if this device is EFI compliant, but if it is - and apparently some ARMv7 devices are - then it could allow kexec to reference a more complete memory map provided by EFI. The patch behind the link is for x86, but perhaps there are some ideas it might provide.
Just trying to help.
See attached for link..
twodollaz said:
Forgive me if I'm way off, but how does this sound? I don't know if this device is EFI compliant, but if it is - and apparently some ARMv7 devices are - then it could allow kexec to reference a more complete memory map provided by EFI. The patch behind the link is for x86, but perhaps there are some ideas it might provide.
Just trying to help.
See attached for link..
Click to expand...
Click to collapse
Hmm thats very interesing... Ill try this when i get home. Im looking though it more and im starting to think that this could be our problem. Im going to pull one of the patched files down tonight and try seeing what happens.

Updated/Fixed wifi calling for ICS rom users

Hey guys when the latest RUU was released I pulled all the WiFi calling stuff out (well.. lots of bits and pieces) to update my fourth bar install... Figured I'd share it here. This will fix the increasing lag/delay with WiFi calling on all ICS sense based roms..
It shouldn't work on cm10 but i haven't tried it.I am pretty sure the movial implementation of WiFi calling requires many sense hooks though... But the interesting thing to me is that I have modified fourth bar quite a lot from the original to the point where there is practically no sensE stuff left whatsoever.. so it's either a modified telephony provider or it doesn't require sense at all... I haven't tested it much. Feel free to play around if you want.
Made this on the fly from my phone (and also is why I using DB) so let me know if it works if not I'll make one proper. Feel free to try on viper but if you do I'd suggest also.copying over htc frameworks.as well as telephony provider from a sense rom, just a suggestion!
You can tell.the update worked.because the WiFi calling active icon will be different. Oh and those using fourth.bar or speedrom..WiFi calling doesn't have to be permanent.. simply make a shortcut to the WiFi calling activity "wificall preferences" using apex or nova activity shortcuts.. you can also make shortcuts to the full IMS config including SIP reg server, auth info, protocol type, etc. I wouldn't mess with these.settings but could be useful to those porting. FLASH.THE ZIP.IN RECOVERY
LINK: http://db.tt/4B6tcCE1
(uHH... got a PM asking if it was odexed... these files are obviously deodexed..lol.. considering there's no .odex file... but yeah I mounted the system.img from the latest RUU, extracted it, deodexed the entire thing.. and pulled these out to make this zip. I've actually been combed through it with diff to the last RUU and there's really not a lot changed at all. Couple libs here and there, maybe a few other APKs... Not much at all!.. if you need it odexed, it's easy enough to reodex.. I actually prefer my phone to be odexed as well. Good tool to do this is called Dexo, The Universal Odexer.. you can find it on google. It's basically a couple of binaries and a script.. works like a DREAM and the basic script odexes your system apps as well as framework.. and it's easy enough to modify to odex data.. only thing with odexed data is you must delete the .odex file manually after you uninstall any apps because you'll get out of space etc errors if you do not... I find things are much MUCH faster on an odexed system, by far... matter of fact I'll go ahead and create another post with the Tool and a quick batch file I wrote for windows that makes the process very quick and easy.)
Good work :dance:
Just wondering, would there be anyway to get it to work with Miui
build.prop
might need to add this to the build prop if it isn't there
ro.ril.enable.ganlite=1
ro.ril.def.agps.feature=1
chevycowboyusa said:
might need to add this to the build prop if it isn't there
ro.ril.enable.ganlite=1
ro.ril.def.agps.feature=1
Click to expand...
Click to collapse
actually I think that's for the Kineto Gan implementation of Wifi calling, which uses a Userspace application (The one we tried to port over for Viper)
This is actually the Movial IMS implementation. Have you tried this implementation on viper perhaps? You would need some framework files, I think... but it's worth a shot honestly. I don't think it's as tightly hooked into Sense as a lot of us originally thought. I decompiled all of the APKs and I combed through it and I didn't really see any hooks into Sense.. I think that it more than likely depends on a modified telephony provider..
The Kineto Gan implementation used a bit of trickery with what's called a RIL switch, where it would (as the name implies) basically switch the RIL out on the fly between Kineto's RIL (for wifi calling) and the normal one. This implementation is a lot cleaner, and the configurations are included within the files themselves... It actually uses SIP. All the configuration info is actually easily found within the XMLs once the APKs are installed as system apps. The trickery is with the authentication. I've been running wireshark and capturing packets... between that and decompiling the APKs it appears that a basic SIP registration address is used for everyone, it's not unique. There's some kind of SIP address->mobile number translation that happens... the IMS project is open source, and the full source code is actually available on Google Code.. and it has even been updated for Jelly Bean. The interesting part is, I was able to compile the IMS Test App for ICS, take the configuration information I found.. entered it into the test App, and was able to establish half-way working service with the Test application. The thing is, even though it uses SIP, it's not your everyday run of the mill SIP. There's some wrapping and translation going on that uses info contained in the packets to determine where it's going (mobile number).. and don't even get me started on Text Messaging.... that looks like one giant hack-job...basically hijacking the SIP/RTP protocol for a proprietary implementation that just uses the base outline.
I tried to register with a regular SIP client using the configuration information I found (The password was TMO-VOIP-TRIAL) and i couldn't establish registration... and looking at the source I could definitely see why. There's a lot of stuff going on behind the scenes.
The good news is there's VERY LITTLE that appears to have been changed when it was updated for jellybean... what this means is... theoretically if someone was skilled enough they could take the DIFF's (which are freely available on google code) and update the IMS implementation for jellybean. It would take a good amount of time and effort, but I honestly think it's much more possible than a lot of people originally believed. It's the authentication part that's tricky..
But yeah, you might want to give it a shot on Viper! For a start I would probably move over ip-provider.apk, ims-service.apk, IPService.apk, WifiCall.apk (This is basically the on/off switch that Settings calls.. you can just use an activity shortcut to reach it though), and gba-service.apk
Push those all to /system/app
Then on the framework side I would move over javax.obex.jar, gba-service-lib.jar, and the other important one is going to be jsr-api.jar... I didn't know that it was related but it's clearly defined in the IMS source code (https://code.google.com/p/the-ims-open-source-project-for-android/source/browse/#git/jsr-api)
I would also copy over TelephonyProvider.apk and Phone.apk, for good measure. .. and see what happens.
You would need a way to trigger it ON, which can easily be done with Nova/Apex by making an activity shortcut to WIfiCall.apk, you can also make activity shortcuts to all the configuration options within the IMS-server itself but it comes preconfigured.
it's worth a shot... currently WiFi calling is working flawlessly for me on Fourth Bar and I have pretty much EVERYTHING htc related disabled. Including com.htc etc...
Could be in the HTC frameworks though.. or somewhere else... but it's def. worth a shot!
I think this is a awaresome job,although I don't know what's this...
Please do that!
Great work. I tried your file to no avail. Good catch on the other files. I read somewhere that phonesky is also required.
Biggest issue I had with the semi working one that I used is that it wouldn't read the SIM. I moved some files around and then it hung on connecting to the Wi-Fi due to a lack of server address
I'll follow your instructions tonight and see where I can get... I still am working on GPS and now vpn too. Last night I attempted a sense 3.6 venom build.
Wasn't pretty. Something kept failing in the updater script and I got too tired to pay with it..
**tried all the files and made the short cut..
No love.. It didn't work..
Still trying a few things
Any other ideas?
chevycowboyusa said:
Great work. I tried your file to no avail. Good catch on the other files. I read somewhere that phonesky is also required.
Biggest issue I had with the semi working one that I used is that it wouldn't read the SIM. I moved some files around and then it hung on connecting to the Wi-Fi due to a lack of server address
I'll follow your instructions tonight and see where I can get... I still am working on GPS and now vpn too. Last night I attempted a sense 3.6 venom build.
Wasn't pretty. Something kept failing in the updater script and I got too tired to pay with it..
**tried all the files and made the short cut..
No love.. It didn't work..
Still trying a few things
Any other ideas?
Click to expand...
Click to collapse
Hmm... there IS a build.prop entry that I actually just noticed
ro.ril.ims=1
I would try to add that.
Phonesky is just the updated google play market, I believe.
I would try that build.prop entry, then get a logcat if you can and post it. I'd try but currently can't really mess around with my phone as I need wifi calling for work stuff.
See what is going on in the logcat, or post it and I'll comb through it. See if there's API calls that are failing under something like Function does not exist or something or another.. that would seem to indicate some missing framework stuff that provides those functions. Then it might just be including said frameworks as well as altering the bootclasspath in the kernel (Pretty easy thing to do, just break the boot.img into parts with unpackbootimg, un-gzip the ramdisk with gzip and CPIO, edit the init.rc, recompress the ram disk with GZIP, then recompile the boot.img with mkbootimg) and I believe you'd also have to deodex the ROM itself, then if you wanted it odexed you'd have to odex it back with the correct BOOTCLASSPATH or else it will not boot. I'm not sure but I THINK deodexed APKs need to be built with the right bootclasspath.
There HAS to be a way to get it working on Viper. After all it's the same underlying android OS version.. The sensation guys got it worknig on CM9...
ok..
ericdjobs said:
Hmm... there IS a build.prop entry that I actually just noticed
ro.ril.ims=1
I would try to add that.
Phonesky is just the updated google play market, I believe.
I would try that build.prop entry, then get a logcat if you can and post it. I'd try but currently can't really mess around with my phone as I need wifi calling for work stuff.
See what is going on in the logcat, or post it and I'll comb through it. See if there's API calls that are failing under something like Function does not exist or something or another.. that would seem to indicate some missing framework stuff that provides those functions. Then it might just be including said frameworks as well as altering the bootclasspath in the kernel (Pretty easy thing to do, just break the boot.img into parts with unpackbootimg, un-gzip the ramdisk with gzip and CPIO, edit the init.rc, recompress the ram disk with GZIP, then recompile the boot.img with mkbootimg) and I believe you'd also have to deodex the ROM itself, then if you wanted it odexed you'd have to odex it back with the correct BOOTCLASSPATH or else it will not boot. I'm not sure but I THINK deodexed APKs need to be built with the right bootclasspath.
There HAS to be a way to get it working on Viper. After all it's the same underlying android OS version.. The sensation guys got it worknig on CM9...
Click to expand...
Click to collapse
I fixed VPN and I'm uploading it in a few. I think I noticed something as well. I went back to stock ota to see what was going on and noticed wifi calling isn't showing up in settings/more should be there with vpn/ wifi hotspot/ nfc etc....
ericdjobs said:
The trickery is with the authentication. I've been running wireshark and capturing packets... between that and decompiling the APKs it appears that a basic SIP registration address is used for everyone, it's not unique. There's some kind of SIP address->mobile number translation that happens... the IMS project is open source, and the full source code is actually available on Google Code.. and it has even been updated for Jelly Bean. The interesting part is, I was able to compile the IMS Test App for ICS, take the configuration information I found.. entered it into the test App, and was able to establish half-way working service with the Test application. The thing is, even though it uses SIP, it's not your everyday run of the mill SIP. There's some wrapping and translation going on that uses info contained in the packets to determine where it's going (mobile number).. and don't even get me started on Text Messaging.... that looks like one giant hack-job...basically hijacking the SIP/RTP protocol for a proprietary implementation that just uses the base outline.
I tried to register with a regular SIP client using the configuration information I found (The password was TMO-VOIP-TRIAL) and i couldn't establish registration... and looking at the source I could definitely see why. There's a lot of stuff going on behind the scenes.
Click to expand...
Click to collapse
How was the Test App half-way working for you? I didn't compile it, but I tried an apk I found a while back and it CLAIMED it was registered, but I couldn't make it call out. I tried random presence and subscribe options but I don't think they were taking and nothing happened when I called my mobile number from somewhere else. My guess is that I have to subscribe or set presence to something magic for my phone number. After not really finding what I should actually be doing from skimming the 4th or 5th spec, and noticing that the nexus 4 guys have a $1400 bounty and don't really have progress, I gave up.
Yeah there's a pile of authentication (on both sides) that IMS has over SIP. If I understand right, the first part of registration is similar, but then TMO's side says you're unauthorized along with a challenge that's supposed to be sent to the ISIM and part of a key for establishing an IPSec tunnel that everything else goes through. Can't tunnel, then use SIP because you need the key (and part of that probably comes from the ISIM too), and a regular SIP client will just think it failed.

Tip for Code Editor on Android

I search a good Code Editor for Android. Since there are many Texteditors available, i didn't want to try out all of them, to find the right one. So maybe someone here can please suggest a good editor for me? In the first line, the Editor should be load fast, also with huge Textfiles with 500Kb or more. The App should also find the correct encoding for the File automatically, since i would like to use it with Windows and Unix/Linux Files. Brace Matching is needed, Syntax Highlighting for files like PHP, HTML, CSS, Apache Config and so on are welcome, but not a real must have. Also, if there would be code folding support, this would be a great thing. Its not important, if it is a paid or free app. I would purchase the app, if it is good enough. I have tried QuickEdit, which seems to be really fast, but i doesn't have brace matching. DroidEdit seems to have all features, but it was very slow on a Galaxy S7, compared to QuickEdit. With Quoda i miss Syntax Highlightning but the App crashes with large files. TurboEdit doas not load my Files either, i don't know why. So the closest things are Quoda and QuickEdit.
Maybe someone here have other suggestions? Maybe with additional feature where i could use this App also as fast Viewer for large Logfile?
May be this one be comfort for you
I use Dcoder, Mobile Compiler IDE - play.google.com/store/apps/details?id=com.paprbit.dcoder&hl=ru (sorry, I can't post outside links)
It's fast and supports many languages. But i didn't test it with a big files.
It's free, but have ads, that don't work without internet connection. =)
what is a code editor?

Categories

Resources