Signed J2me app hanging at first start - java-me

In my j2me app that is signed by veriSign, has problem in accepting the always or yes permissions the time it has to perform PIM.getInstance().openPIMList(..) action.
When my app perform below line of code very first time of it's installation it hangs and doesn't show up the main screen rather a black background hanged screen. When I exit and restart the application it runs normally without any problem even if I delete it and put it back again and runs fine, except I delete and restart the phone and try to run it again it shows the same problem I described above.
My code of line that causes to ask permissions is here that actually also causes the problem. One more thing this error only occurs on specific phones which actually allow ALWAYS permission on start.
I am checking it over Nokia X2-05 and it shows problem but on Nokia C3-02 it doesn't as it doesn't allow ALWAYS permission automatically on start of app.
private void permissionSettings() throws PIMException {
PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
}
Above is code snippet that hangs at first start.

It sounds like a bug on the handset to me, the TCK tests used to verify j2me libraries are pretty weak so lots of bugs like this find their way through.
It seems that the key is in the permissions, so I would try and play around in this area. Make sure you have the right permissions set in the .jad (before signing), if you can get hold of one try to sign with a certificate in a different security domain or certificate, try changing the permission level before running the applet.
I would expect that you'll only be able to work around the problem, so rather than suggest something specific I would be varying things within those areas.

Related

SSH client behaviour changed since private key implementation

I've just changed our authentication methods for connecting via SSH as we're moving into production for our app, we're also in the middle of migrating to EC2#AWS.
Its been a few days now and I've started to notice a few little changes whcih seem small but none the less, causing me to make mistakes as we run through command lines.
We disabled root logins to start with and now working on a range of users, all with different keys etc.
We no longer get our login 'introduction' when we login. We had some pretty useful information on there which we enjoyed reviewing - Where is that stored and how do we get it back or rebuild it?
We cant 'tab' to autocomplete the filenames anymore. This probably saves us tens of hours a week in typing so would be nice to get this back.
Im sure theres a configuration file somewhere but the files I've reviewed give little to no clue on either of these issues.

Can I reset the simulator's contacts and location permission settings for my app, to simulate a first-time usage scenario?

My iOS app currently has a deployment target of iOS 7 (although my scheme runs the iOS 9.2 simulator), and links with the AddressBook, AddressBookUI, and CoreLocation frameworks. I have a suite of Swift UI tests in Xcode 7 (not in Instruments). When a user first uses my app, they are asked for permission to access their contacts, and their location while the app is running. Since this involves a fair amount of code that needs to execute perfectly, I'd love to automate all of the possible outcomes and ensure the UI is in the desired state.
Can I use Xcode UI testing to reset the Simulator's settings for access to contacts and locations? For example, I could implement this in the setUp() function within my test case class. I've found some tutorials about how to respond to the dialogs, but before I get to that point, I need to simulate the condition where the permissions are requested. Here's a question that explains how to respond to such an alert.
Short answer: no. There is no API for UI Testing to reset the simulator (and therefore reset the permission dialogs). I suggest filing a bug report with Apple explaining why you need this.
UI Testing doesn't make it easy to test "unhappy paths." In your question you mentioned testing all of the flows for permissions. Without manually reseting the simulator between tests this will prove impossible. I suggest only testing the happy path with UI Testing and leaving the other cases to unit tests.
I understand that this is not ideal but for now it's a decent workaround. For what it's worth, that is the approach I take when testing our app. (The app asks for push notifications and location permissions.)
xcrun simctl privacy booted reset location <your_app_bundle_id>
Source: https://developer.apple.com/videos/play/wwdc2020/10647/
In UITesting, it is simple:
let app = XCUIApplication()
app.resetAuthorizationStatus(for: .location)
Here is how I would do it. I would delete the simulator data which will delete the saved settings, hopefully this works in your situation. In Swift:
let filemanager = NSFileManager.defaultManager()
do {
try filemanager.removeItemAtPath(NSHomeDirectory())
}
catch let error as NSError {
print("Ooops! Something went wrong: \(error)")
}
Just figure out a good spot to put that in your code and poof--simulator data gone.

Getting detailed crash dumps from a hooked exe

I am trying find a problem with my program that is hooking into a game. This is
vc++. Basically I launch the program and then hook into it using SDL. When I run the code from VS2010, all works fine. But when I try to run from command prompt, my program can launch the game, but after that the game crashes immediately.
I was viewing windows event logs, and it appears that there is an access violation. 0xc000005
How can I log any further details about the program that crashes? I tried "procdump" but that is not useful as I cannot INDIRECTLY target the hooked game from console. Rather it can only target my application that hooks.
Anyway of getting detailed dumps is highly appreciated in this case.
Thanks!
You can perform postmortem debugging by using a combination of the WER registry keys/values to trap any dump that is produced. I’ve used this method to prevent the WER system from collecting the dump file (.dmp). I’ve also written about this in another similar post. To accomplish this, you will need to create a registry key under
Software\Microsoft\Windows\Windows Error Reporting
if one does not already exist. The key should be
LocalDumps\your application.exe
Once that’s done, modify these keys/values to meet your needs:
DumpCount, DumpFolder, DumpType
You’ll need Administrator rights to create and modify the keys, and, you should reset everything you’ve modified when you’re done debugging.

Does process have permission to view files on azure?

I have recently deployed a fubu mvc application to windows azure. Everything works except when the pipeline tries to find the view to render. This all works correctly on my local machine.
So I am wondering: does the process on the Azure box have rights to read/scan files on disk?
Any suggestions to fix it are welcome though.
EDIT:
As part of the deployment there is a stage that azure goes through called "Preparing files for eployment". I checked on the log and my view was not in there
So I changed copy to output as true and it worked
It depends a bit on where you are trying to read and how you have configured your roles. By default, the code will run as a very low privilege user that only has R/W to the code directory (and any LocalResource(s) defined by the user). However, you can run your code as SYSTEM, in which case you can R/W anywhere (you might still have to take ownership, but you are all powerful as SYSTEM).
If your views are defined as part of your package and uploaded, the code should have permission to view it. I am curious as why you think this is a permission issue right now. Do you see an error that indicates that, or are you guessing it? If I had to guess, my first thought would be your views didn't get packaged correctly and are not on the VM. You can confirm they are there either by RDP or by cracking open the package and snooping around.

Trying to create a X509Certificate2 certificate fails when called within a COM interop environment

I've got a classlibrary which defines a couple of helper classes/methods which are used from a classic asp web application. So far, everything works fine. Now I've added a new helper method which signs a PDF file using a third party tool. Using a console application to call this wrapper method, everything works fine. Once I use an asp page to call the exact same method, the call to
X509Certificate2 cert = new X509Certificate2(sigFilePath, sigPassword);
fails with the error "The system cannot find the specified file" (translated from german).
Since the same code works fine called from the console application, i guess the problem must be located somewhere different. Could it be a security issue?
When I wonder if I'm facing a security issue like you do, I just do a quick test : I put the user account the webserver is using in the administrators group, do a quick iisreset, and try again. If it's working know you now it's a security issue. If it's still failing, look somewhere else.
Never forget to then remove the user accoung from the administrators group, and only do that on you own dev machine, not on production servers !!
If it's a security issue, I would then recommend launching Process Monitor (look for procmon in google). It's a Microsoft download. Look for access denied in the result column. You'll then know what's blocking you ...

Resources