Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
efd54eb5
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
efd54eb5
编写于
10月 09, 2020
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加越狱检查
上级
bacf4693
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
150 addition
and
72 deletion
+150
-72
o2ios/O2Platform.xcodeproj/project.pbxproj
o2ios/O2Platform.xcodeproj/project.pbxproj
+4
-0
o2ios/O2Platform/App/Login-绑定登录/c/LoginViewController.swift
o2ios/O2Platform/App/Login-绑定登录/c/LoginViewController.swift
+77
-72
o2ios/O2Platform/App/Login-绑定登录/c/OOLoginViewController.swift
...s/O2Platform/App/Login-绑定登录/c/OOLoginViewController.swift
+25
-0
o2ios/O2Platform/Manager/SecurityCheckManager.swift
o2ios/O2Platform/Manager/SecurityCheckManager.swift
+44
-0
未找到文件。
o2ios/O2Platform.xcodeproj/project.pbxproj
浏览文件 @
efd54eb5
...
...
@@ -273,6 +273,7 @@
B1D1BC8F234C8349002025DA
/* CloudFileCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1D1BC8E234C8349002025DA
/* CloudFileCell.swift */
;
};
B1D4AFED24B409A9004E648E
/* AudioTouchButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1D4AFEC24B409A9004E648E
/* AudioTouchButton.swift */
;
};
B1DA305F2282754500669418
/* QCalendarPicker.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1DA305E2282754500669418
/* QCalendarPicker.swift */
;
};
B1DB0843252314F400EE6673
/* SecurityCheckManager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1DB0842252314F400EE6673
/* SecurityCheckManager.swift */
;
};
B1DB6EA5237E6F2C00D7BA94
/* O2VersionInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1DB6EA4237E6F2C00D7BA94
/* O2VersionInfoModel.swift */
;
};
B1DE853823602D36003C36E2
/* Languager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1DE853723602D36003C36E2
/* Languager.swift */
;
};
B1DE8564236030E2003C36E2
/* Bundle+Extension.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B1DE8563236030E2003C36E2
/* Bundle+Extension.swift */
;
};
...
...
@@ -1444,6 +1445,7 @@
B1D1BC8E234C8349002025DA
/* CloudFileCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CloudFileCell.swift
;
sourceTree
=
"<group>"
;
};
B1D4AFEC24B409A9004E648E
/* AudioTouchButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AudioTouchButton.swift
;
sourceTree
=
"<group>"
;
};
B1DA305E2282754500669418
/* QCalendarPicker.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
QCalendarPicker.swift
;
sourceTree
=
"<group>"
;
};
B1DB0842252314F400EE6673
/* SecurityCheckManager.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SecurityCheckManager.swift
;
sourceTree
=
"<group>"
;
};
B1DB6EA4237E6F2C00D7BA94
/* O2VersionInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
O2VersionInfoModel.swift
;
sourceTree
=
"<group>"
;
};
B1DE853723602D36003C36E2
/* Languager.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Languager.swift
;
sourceTree
=
"<group>"
;
};
B1DE8563236030E2003C36E2
/* Bundle+Extension.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Bundle+Extension.swift"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -2813,6 +2815,7 @@
B14E0C0B2484F1F0008AF6AE
/* O2WebsocketManager.swift */
,
B15BE0BD2499BCEF008CD1DB
/* O2RecordVoiceManager.swift */
,
B15BE110249A6002008CD1DB
/* AudioPlayerManager.swift */
,
B1DB0842252314F400EE6673
/* SecurityCheckManager.swift */
,
);
path
=
Manager
;
sourceTree
=
"<group>"
;
...
...
@@ -5645,6 +5648,7 @@
B15F8129210EF15E00B81F35
/* OOCalendarEventViewController.swift in Sources */
,
09E02E941F16319600579887
/* String+Haneke.swift in Sources */
,
E40E24B420B7DA3C009F8BE7
/* OOMeetingModels.swift in Sources */
,
B1DB0843252314F400EE6673
/* SecurityCheckManager.swift in Sources */
,
E4B888F61D9D48F1002E1A46
/* Application.swift in Sources */
,
E4C24C3F208D7EDE00E426B0
/* OOContactSearchViewModel.swift in Sources */
,
E4B697FC2076520E0062F6E8
/* OOFileModels.swift in Sources */
,
...
...
o2ios/O2Platform/App/Login-绑定登录/c/LoginViewController.swift
浏览文件 @
efd54eb5
...
...
@@ -68,84 +68,89 @@ class LoginViewController: UIViewController {
}
func
startFlowForPromise
()
{
if
!
O2IsConnect2Collect
{
let
unit
=
O2BindUnitModel
()
if
let
infoPath
=
Bundle
.
main
.
path
(
forResource
:
"Info"
,
ofType
:
"plist"
),
let
dic
=
NSDictionary
(
contentsOfFile
:
infoPath
)
{
let
o2Server
=
dic
[
"o2 server"
]
as?
NSDictionary
let
id
=
o2Server
?[
"id"
]
as?
String
let
name
=
o2Server
?[
"name"
]
as?
String
let
centerHost
=
o2Server
?[
"centerHost"
]
as?
String
let
centerContext
=
o2Server
?[
"centerContext"
]
as?
String
let
centerPort
=
o2Server
?[
"centerPort"
]
as?
Int
let
httpProtocol
=
o2Server
?[
"httpProtocol"
]
as?
String
DDLogDebug
(
"连接服务器:
\(
String
(
describing
:
name
)
)
, host:
\(
String
(
describing
:
centerHost
)
)
, context:
\(
String
(
describing
:
centerContext
)
)
, port:
\(
centerPort
??
0
)
, portocal:
\(
String
(
describing
:
httpProtocol
)
)
"
)
if
name
==
nil
||
centerHost
==
nil
||
centerContext
==
nil
{
self
.
showError
(
title
:
"服务器配置信息异常!"
)
//越狱检查
if
SecurityCheckManager
.
shared
.
isJailBroken
()
{
self
.
showSystemAlert
(
title
:
"提示"
,
message
:
"当前运行环境已经越狱,本应用将不提供服务!"
)
{
(
action
)
in
DDLogError
(
"已经越狱的机器,不进入app!"
)
}
}
else
{
if
!
O2IsConnect2Collect
{
let
unit
=
O2BindUnitModel
()
if
let
infoPath
=
Bundle
.
main
.
path
(
forResource
:
"Info"
,
ofType
:
"plist"
),
let
dic
=
NSDictionary
(
contentsOfFile
:
infoPath
)
{
let
o2Server
=
dic
[
"o2 server"
]
as?
NSDictionary
let
id
=
o2Server
?[
"id"
]
as?
String
let
name
=
o2Server
?[
"name"
]
as?
String
let
centerHost
=
o2Server
?[
"centerHost"
]
as?
String
let
centerContext
=
o2Server
?[
"centerContext"
]
as?
String
let
centerPort
=
o2Server
?[
"centerPort"
]
as?
Int
let
httpProtocol
=
o2Server
?[
"httpProtocol"
]
as?
String
DDLogDebug
(
"连接服务器:
\(
String
(
describing
:
name
)
)
, host:
\(
String
(
describing
:
centerHost
)
)
, context:
\(
String
(
describing
:
centerContext
)
)
, port:
\(
centerPort
??
0
)
, portocal:
\(
String
(
describing
:
httpProtocol
)
)
"
)
if
name
==
nil
||
centerHost
==
nil
||
centerContext
==
nil
{
self
.
showError
(
title
:
"服务器配置信息异常!"
)
return
}
unit
.
id
=
id
unit
.
centerContext
=
centerContext
unit
.
centerHost
=
centerHost
unit
.
centerPort
=
centerPort
unit
.
httpProtocol
=
httpProtocol
unit
.
name
=
name
}
else
{
self
.
showError
(
title
:
"没有配置服务器信息!"
)
return
}
unit
.
id
=
id
unit
.
centerContext
=
centerContext
unit
.
centerHost
=
centerHost
unit
.
centerPort
=
centerPort
unit
.
httpProtocol
=
httpProtocol
unit
.
name
=
name
}
else
{
self
.
showError
(
title
:
"没有配置服务器信息!"
)
return
}
O2AuthSDK
.
shared
.
launchInner
(
unit
:
unit
)
{
(
state
,
msg
)
in
switch
state
{
case
.
bindError
:
//校验绑定结点信息错误
self
.
showError
(
title
:
"未知错误!"
)
break
case
.
loginError
:
self
.
forwardToSegue
(
"loginSystemSegue"
)
//自动登录出错
break
case
.
unknownError
:
self
.
showError
(
title
:
msg
??
"未知错误!"
)
break
case
.
success
:
//处理移动端应用
self
.
viewModel
.
_saveAppConfigToDb
()
//跳转到主页
let
destVC
=
O2MainController
.
genernateVC
()
destVC
.
selectedIndex
=
2
// 首页选中 TODO 图标不亮。。。。。
UIApplication
.
shared
.
keyWindow
?
.
rootViewController
=
destVC
UIApplication
.
shared
.
keyWindow
?
.
makeKeyAndVisible
()
O2AuthSDK
.
shared
.
launchInner
(
unit
:
unit
)
{
(
state
,
msg
)
in
switch
state
{
case
.
bindError
:
//校验绑定结点信息错误
self
.
showError
(
title
:
"未知错误!"
)
break
case
.
loginError
:
self
.
forwardToSegue
(
"loginSystemSegue"
)
//自动登录出错
break
case
.
unknownError
:
self
.
showError
(
title
:
msg
??
"未知错误!"
)
break
case
.
success
:
//处理移动端应用
self
.
viewModel
.
_saveAppConfigToDb
()
//跳转到主页
let
destVC
=
O2MainController
.
genernateVC
()
destVC
.
selectedIndex
=
2
// 首页选中 TODO 图标不亮。。。。。
UIApplication
.
shared
.
keyWindow
?
.
rootViewController
=
destVC
UIApplication
.
shared
.
keyWindow
?
.
makeKeyAndVisible
()
}
}
}
}
else
{
//本地 -> 校验 -> 下载NodeAPI -> 下载configInfo -> 自动登录
O2AuthSDK
.
shared
.
launch
{
(
state
,
msg
)
in
switch
state
{
case
.
bindError
:
//校验绑定结点信息错误
self
.
forwardToSegue
(
"bindPhoneSegue"
)
break
case
.
loginError
:
self
.
forwardToSegue
(
"loginSystemSegue"
)
//自动登录出错
break
case
.
unknownError
:
// self.showError(title:
msg ?? "未知错误!")
self
.
needReBind
(
msg
??
"未知错误!"
)
break
case
.
success
:
//处理移动端应用
self
.
viewModel
.
_saveAppConfigToDb
()
//跳转到主页
let
destVC
=
O2MainController
.
genernateVC
()
destVC
.
selectedIndex
=
2
// 首页选中 TODO 图标不亮。。。。。
UIApplication
.
shared
.
keyWindow
?
.
rootViewController
=
destVC
UIApplication
.
shared
.
keyWindow
?
.
makeKeyAndVisible
()
}
else
{
//本地 -> 校验 -> 下载NodeAPI -> 下载configInfo -> 自动登录
O2AuthSDK
.
shared
.
launch
{
(
state
,
msg
)
in
switch
state
{
case
.
bindError
:
//校验绑定结点信息错误
self
.
forwardToSegue
(
"bindPhoneSegue"
)
break
case
.
loginError
:
self
.
forwardToSegue
(
"loginSystemSegue"
)
//自动登录出错
break
case
.
unknownError
:
// self.showError(title: msg ?? "未知错误!")
self
.
needReBind
(
msg
??
"未知错误!"
)
break
case
.
success
:
//处理移动端应用
self
.
viewModel
.
_saveAppConfigToDb
()
//跳转到主页
let
destVC
=
O2MainController
.
genernateVC
()
destVC
.
selectedIndex
=
2
// 首页选中 TODO 图标不亮。。。。。
UIApplication
.
shared
.
keyWindow
?
.
rootViewController
=
destVC
UIApplication
.
shared
.
keyWindow
?
.
makeKeyAndVisible
()
}
}
}
}
}
...
...
o2ios/O2Platform/App/Login-绑定登录/c/OOLoginViewController.swift
浏览文件 @
efd54eb5
...
...
@@ -48,11 +48,22 @@ class OOLoginViewController: OOBaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
//监听截屏通知
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
screenshots
)
,
name
:
UIApplication
.
userDidTakeScreenshotNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
didEnterBackground
)
,
name
:
UIApplication
.
didEnterBackgroundNotification
,
object
:
nil
)
//delegate
passwordTextField
.
buttonDelegate
=
self
setupUI
()
}
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
,
name
:
UIApplication
.
userDidTakeScreenshotNotification
,
object
:
nil
)
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
let
bioAuthUser
=
AppConfigSettings
.
shared
.
bioAuthUser
...
...
@@ -71,6 +82,7 @@ class OOLoginViewController: OOBaseViewController {
}
}
@IBAction
func
unwindFromBioAuthLogin
(
_
unwindSegue
:
UIStoryboardSegue
)
{
if
unwindSegue
.
identifier
==
"goBack2Login"
{
...
...
@@ -79,6 +91,19 @@ class OOLoginViewController: OOBaseViewController {
}
}
@objc
private
func
didEnterBackground
()
{
DDLogDebug
(
"进入后台................."
)
self
.
userNameTextField
.
text
=
""
self
.
passwordField
.
text
=
""
}
//截屏提示
@objc
private
func
screenshots
()
{
self
.
showSystemAlert
(
title
:
"提示"
,
message
:
"为了保护用户名密码安全,请不要截图!"
)
{
(
action
)
in
DDLogDebug
(
"确定提示。"
)
}
}
private
func
setupUI
(){
logoImageView
.
image
=
OOCustomImageManager
.
default
.
loadImage
(
.
login_avatar
)
let
backImageView
=
UIImageView
(
image
:
#
imageLiteral
(
resourceName
:
"pic_beijing"
))
...
...
o2ios/O2Platform/Manager/SecurityCheckManager.swift
0 → 100644
浏览文件 @
efd54eb5
//
// SecurityCheckManager.swift
// O2Platform
//
// Created by FancyLou on 2020/9/29.
// Copyright © 2020 zoneland. All rights reserved.
//
import
Foundation
class
SecurityCheckManager
{
static
let
shared
:
SecurityCheckManager
=
{
return
SecurityCheckManager
()
}()
private
init
()
{}
///判断是否存在越狱的软件
func
isJailBroken
()
->
Bool
{
//判断设备上是否安装了这些程序
let
apps
=
[
"/APPlications/Cydia.app"
,
"/Library/MobileSubstrate/MobileSubstrate.dylib"
,
"/bin/bash"
,
"/usr/sbin/sshd"
,
"/etc/apt"
,
"/usr/bin/ssh"
,
"/APPlications/limera1n.app"
,
"/APPlications/greenpois0n.app"
,
"/APPlications/blackra1n.app"
,
"/APPlications/blacksn0w.app"
,
"/APPlications/redsn0w.app"
,
"/APPlications/Absinthe.app"
]
for
app
in
apps
{
//通过文件管理器,判断在指定的目录下,是否在对应的应用程序。如果存在的话。就表示当前设备为越狱设备。
if
FileManager
.
default
.
fileExists
(
atPath
:
app
){
return
true
}
}
return
false
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录