I am trying to achieve a triple tap action on an element(IOS) less than 2 seconds using appium 1.6, tried below code but it is throwing an error.
new IOSTouchAction(driver).Tap(ele).Tap(ele).Tap(ele).perform();
Or:
for (int i = 0; i < 3; i++)
{
new IOSTouchAction(driver).tap(element).perform();
}
But no use.
Appium: 1.6.3
JavaClient: 5.0.0-BETA5/4.1.2
Please let me know if anyone has achieved this using above specs, thanks in advance.
The problem here is not with your code but with apple's Instruments.
It's a known issue that Instruments is forcing a 1 second delay between each action. to solve this try and configure "Instruments without delay". it worked for me!
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/iwd_xcode7.md
After configuring this, i believe that your "for" loop will work as expected
I am building an iOS app that transmits sensitive data to my server, and I'm signing my API requests as an additional measure. I want to make reverse engineering as hard as possible, and having used Cycript to find signing keys of some real-world apps, I know it's not hard to find these keys by attaching to a process. I am absolutely aware that if someone is really skilled and tries hard enough, they eventually will exploit, but I'm trying to make it as hard as possible, while still being convenient for myself and users.
I can check for jailbroken status and take additional measures, or I can do SSL pinning, but both are still easy to bypass by attaching to the process and modifying the memory.
Is there any way to detect if something (whether it be Cycript, gdb, or any similar tool that can be used for cracking the process) is attached to the process, while not being rejected from App Store?
EDIT: This is not a duplicate of Detecting if iOS app is run in debugger. That question is more related to outputting and it checks an output stream to identify if there's an output stream attached to a logger, while my question is not related to that (and that check doesn't cover my condition).
gdb detection is doable via the linked stackoverflow question - it uses the kstat to determine if the process is being debugged. This will detect if a debugger is currently attached to the process.
There is also a piece of code - Using the Macro SEC_IS_BEING_DEBUGGED_RETURN_NIL in iOS app - which allows you to throw in a macro that performs the debugger attached check in a variety of locations in your code (it's C/Objective-C).
As for detecting Cycript, when it is run against a process, it injects a dylib into the process to deal with communications between the cycript command line and the process - the library has part of the name looking like cynject. That name doesn't look similar to any libraries that are present on a typical iOS app. This should be detectable with a little loop like (C):
BOOL hasCynject() {
int max = _dyld_image_count();
for (int i = 0; i < max; i++) {
const char *name = _dyld_get_image_name(i);
if (name != NULL) {
if (strstr(name, "cynject") == 0) return YES;
}
}
}
Again, giving it a better name than this would be advisable, as well as obfuscating the string that you're testing.
These are only approaches that can be taken - unfortunately these would only protect you in some ways at run-time, if someone chooses to point IDA or some other disassembler at it then you would not be protected.
The reason that the check for debugger is implemented as a macro is that you would be placing the code in a variety of places in the code, and as a result someone trying to fix it would have to patch the app in a variety of places.
Based on #petesh's answer, I found the below code achieved what I wanted on a jailbroken phone with Cycript. The existence of printf strings is gold to a reverse engineer, so this code is only suitable for demo / crack-me apps.
#include <stdio.h>
#include <string.h>
#include <mach-o/dyld.h>
int main ()
{
int max = _dyld_image_count();
for (int i = 0; i < max; i++) {
const char *name = _dyld_get_image_name(i);
const char needle[11] = "libcycript";
char *ret;
if ((ret = strstr(name, needle)) != NULL){
printf("%s\nThe substring is: %s\n", name, ret);
}
}
return 0;
}
As far as I know, Cycript process injection is made possible by debug symbols. So, if you strip out debug symbols for the App Store release (the default build setting for the Release configuration), that would help.
Another action you could take, which would have no impact on the usability of the App, would be to use an obfuscator. However, this would render any crash reports useless, since you wouldn't be able to make sense of the symbols, even if the crash report was symbolicated.
I meet a problem that I can't detect the source type (ex:gmail ,yahoo or exchange account) in addressbook.
I use method ABAddressBookCopyArrayOfAllSources to get all the sources.
CFArrayRef allSources = ABAddressBookCopyArrayOfAllSources(book);
for (CFIndex i = 0; i < CFArrayGetCount(allSources); i++) {
ABRecordRef source = (ABRecordRef)CFArrayGetValueAtIndex(allSources, i);
NSString *sourceTypeName = (NSString *)((CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty));
NSLog(#"%#", sourceTypeName);
}
But the Gmail account source name is 'Address Book' (It's strange to me)
iCloud account source name is 'Card' (also strange). the source type is cardav
I searched several similar questions:
1.AddressBook: Differentiating sources of type kABSourceTypeExchangeGAL
2.ABAddressBook ABSource and ABSourceType
the answers are you can't detect the account .
However, I downloaded a app named 'Cobook'. It can show my gmail account name.I'm very curious about how the app can do that.I did not found there is some api can get this info.
Thanks advance.
How can we launch a blackberry messenger programmatically. Any help would be greatly appreciated. As far as I know the following would get the BlackberryMessenger instance but what can be done to launch the BBM:
BlackBerryMessenger bbm= BlackBerryMessenger.getInstance();
I still urge you to consider my comments above, but you should be able to cause BBM to come to the foreground with:
int modHandle = CodeModuleManager.getModuleHandle( <bbm module name> );
ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors( modHandle );
ApplicationManager.getApplicationManager().runApplication(apDes [ 0 ] );
You will have to find out what the appropriate module name is and put that string in the call to getModuleHandle(). BBM has a bunch of modules and I don't know off hand which one is the main one.
I'm looking for something corresponding to net.rim.device.api.system.ApplicationManager.getVisibleApplications(), but including applications that might not/do not have a UI. Any ideas?
Unreasonably complicated work-around solutions welcome, I'm growing slowly more sure that there's not a simple single call to do this...
If you know the application name you can detect if it is running or not by checking the size of the array containing all AppDescriptor actually running this app.
int codeModuleHandle = CodeModuleManager.getModuleHandle(applicationPackageName);
if (codeModuleHandle != 0) {
ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(codeModuleHandle);
}
You could imagine a code to get all installed application and then check