最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - How to Detect developer mode status in iOS app - Stack Overflow

programmeradmin1浏览0评论

I have seen recently many banking apps detecting developer mode on and giving user with security warning messages.

I searched over apple documentation but couldn't find any such API.

Any idea how to detect same programmatically in iOS via Swift language.

I have seen recently many banking apps detecting developer mode on and giving user with security warning messages.

I searched over apple documentation but couldn't find any such API.

Any idea how to detect same programmatically in iOS via Swift language.

Share asked Feb 10 at 19:03 TornadoTornado 1,08712 silver badges28 bronze badges 8
  • There is no official API to detect developer mode on iOS. Why do you want to detect developer mode? It does not reduce the security of any other app in any way. I have developer mode on, on my devices, because I am a developer. If I had to switch it off and reboot every time I had to use my banking app I would switch banks. I did find some discussion online of some banking apps on Android complaining about developer mode, and the response from other developers was the same as mine; it is both pointless and annoying – Paulw11 Commented Feb 10 at 22:13
  • "It does not reduce the security of any other app in any way" ? To begin with the end user can fake their location. Every single team that works in a very secure milieu deals with the troubling issue of developer mode. – Fattie Commented Feb 10 at 23:24
  • PS Tornado can you name the banking app where you have seen this? I think you're just mentioning something someone said on the Apple forum, near Quinn's comment right ? – Fattie Commented Feb 10 at 23:30
  • Ok, that is a different question; You didn't mention detecting simulated location. This you can do. However, simply detecting developer mode is overkill. I would be very annoyed to be locked out of my banking app simply because I had developer mode enabled; If I was simulating location that might be a different thing (But I wouldn't let my bank have my location anyway). While detecting false location may help with detecting fraud, I still don't see how developer mode directly compromises the security of an app – Paulw11 Commented Feb 11 at 0:51
  • It is not a security problem because it doesn’t give the developer the means to do something that they otherwise couldn’t do. I can pretend that my phone is in New York. But I could just fly to New York. New Yorkers could just be in their home. No need to capabilities. – gnasher729 Commented Feb 11 at 4:07
 |  Show 3 more comments

1 Answer 1

Reset to default -1

You can use

.isSimulatedBySoftware

(As you already saw I think on another answer, @Tornado! :) )

Sure, the user has to enable location but, if you are working in some sort of high security milieu, that's SOP.

发布评论

评论列表(0)

  1. 暂无评论
ok 不同模板 switch ($forum['model']) { /*case '0': include _include(APP_PATH . 'view/htm/read.htm'); break;*/ default: include _include(theme_load('read', $fid)); break; } } break; case '10': // 主题外链 / thread external link http_location(htmlspecialchars_decode(trim($thread['description']))); break; case '11': // 单页 / single page $attachlist = array(); $imagelist = array(); $thread['filelist'] = array(); $threadlist = NULL; $thread['files'] > 0 and list($attachlist, $imagelist, $thread['filelist']) = well_attach_find_by_tid($tid); $data = data_read_cache($tid); empty($data) and message(-1, lang('data_malformation')); $tidlist = $forum['threads'] ? page_find_by_fid($fid, $page, $pagesize) : NULL; if ($tidlist) { $tidarr = arrlist_values($tidlist, 'tid'); $threadlist = well_thread_find($tidarr, $pagesize); // 按之前tidlist排序 $threadlist = array2_sort_key($threadlist, $tidlist, 'tid'); } $allowpost = forum_access_user($fid, $gid, 'allowpost'); $allowupdate = forum_access_mod($fid, $gid, 'allowupdate'); $allowdelete = forum_access_mod($fid, $gid, 'allowdelete'); $access = array('allowpost' => $allowpost, 'allowupdate' => $allowupdate, 'allowdelete' => $allowdelete); $header['title'] = $thread['subject']; $header['mobile_link'] = $thread['url']; $header['keywords'] = $thread['keyword'] ? $thread['keyword'] : $thread['subject']; $header['description'] = $thread['description'] ? $thread['description'] : $thread['brief']; $_SESSION['fid'] = $fid; if ($ajax) { empty($conf['api_on']) and message(0, lang('closed')); $apilist['header'] = $header; $apilist['extra'] = $extra; $apilist['access'] = $access; $apilist['thread'] = well_thread_safe_info($thread); $apilist['thread_data'] = $data; $apilist['forum'] = $forum; $apilist['imagelist'] = $imagelist; $apilist['filelist'] = $thread['filelist']; $apilist['threadlist'] = $threadlist; message(0, $apilist); } else { include _include(theme_load('single_page', $fid)); } break; default: message(-1, lang('data_malformation')); break; } ?>