JailbreakDetection 가이드 프로그램은 디바이스의 탈옥 및 루팅을 현황을 조회하는 기능을 제공한다.
본 가이드 프로그램 에서는 디바이스의 루팅 및 탈옥 정보 조회 기능의 활용을 가이드 할 수 있도록 기기 검사 하기, 인식결과 조회 를 제공하고 있다.
| 구분 | 내용 |
|---|---|
| Local 디바이스 개발 환경 | Xcode 8.0 (8A218a), Cordova 6.4.0 |
| 서버 사이드 개발 환경 | 전자정부표준프레임워크 개발환경3.6 |
| Mash up Open API 연계 | N/A |
| 테스트 디바이스 | iPhone 6 , iPad Air |
| 테스트 플랫폼 | iOS 9.3, iOS 10.0 |
| 추가 라이브러리 적용 | N/A |
| 구분 | 내용 |
|---|---|
| 지원 디바이스 및 플랫폼 | N/A |
| 크로스 도메인 사용 | 폰갭에서 특정 외부 도메인이나 외부 도메인의 하위 도메인을 사용해야할 경우, Res/xml/config.xml에서 <access origin=”” />에 외부 도메인 주소를 추가 설정해야 외부 도메인에 접속할 수 있다. |
| 라이선스 | N/A |
JailbreakDetectionAPI 가이드 프로그램은 크게 기기검사 하기, 인식결과 조회 기능으로 구성되어 있다.(관련기능 부분참조)
| 유형 | 대상소스명 | 비고 |
|---|---|---|
| CSS | assets/www/css/egovframwork/mbl/hyb/JailbreakDetectionAPI.css | JailbreakDetection 가이드 프로그램 주요 Cascading Style Sheets |
| IMAGE | assets/www/images/egovframwork/mbl/hyb/ | JailbreakDetection 가이드 프로그램 주요 Image 폴더 |
| JS | assets/www/js/egovframwork/mbl/hyb/JailbreakDetection.js | JailbreakDetection 가이드 프로그램 주요 JavaScript |
| JS | assets/www/js/egovframwork/mbl/hyb/messages_ko.js | Validate 메세지 처리 JavaScript |
| HTML | assets/www/JailbreakDetection.html | JailbreakDetection 메인 페이지 |
| HTML | assets/www/intro.html | JailbreakDetection Intro 페이지 |
| HTML | assets/www/license.html | JailbreakDetection 라이센스 페이지 |
| HTML | assets/www/overview.html | JailbreakDetection 기능설명 페이지 |
| RES | [Project_Name]/Resources/ | JailbreakDetection 가이드 프로그램 주요 Resource 폴더 |
| PLIST | [Project_Name]/Resources/[Project_Name]-Info.plist | iOS 어플리케이션 설정 파일 |
var cordova= device.cordova;
var platform = device.platform;
var uuid = device.uuid;
var version = device.version;
var isDevicesRooted;
| 변수 | 설명 | 비고 |
|---|---|---|
| cordova | 어플리케이션에서 사용된 폰갭 버전을 반환한다. | |
| platform | 모바일 디바이스의 플랫폼 정보를 반환한다. | |
| uuid | 디바이스 고유의 UUID를 반환한다. | |
| version | 디바이스의 플랫폼 버전을 반환한다. | |
| isDevicesRooted | 디바이스에 루팅 및 탈옥 결과정보를 반환한다. |
window.addEventListener("batterycritical", yourCallbackFunction, false);
window.addEventListener("batterylow", yourCallbackFunction, false);
window.addEventListener("batterystatus", yourCallbackFunction, false);
| 유형 | 대상소스명 | 비고 |
|---|---|---|
| Controller | egovframework.hyb.mbl.jai.web.EgovJailbreakDetectionDeviceAPIController.java | JailbreakDetectionAPI 가이드 프로그램 Controller Class |
| Service | egovframework.hyb.add.dvc.service.EgovJailbreakDetectionDeviceAPIService.java | JailbreakDetectionAPI 가이드 프로그램 Service Class |
| ServiceImpl | egovframework.hyb.add.dvc.service.impl.EgovJailbreakDetectionDeviceAPIServiceImpl.java | JailbreakDetectionAPI 가이드 프로그램 ServiceImpl Class |
| VO | egovframework.hyb.add.dvc.service.JailbreakDetectionDeviceAPIVO.java | JailbreakDetectionAPI 가이드 프로그램 VO Class |
| DAO | egovframework.hyb.add.dvc.service.impl.JailbreakDetectionDeviceAPIDAO.java | JailbreakDetectionAPI 가이드 프로그램 Dao Class |
| QUERY XML | resources/egovframework/sqlmap/hyb/add/dvc/EgovJailbreakDetectionDeviceAPIGuide_SQL_xxx.xml | JailbreakDetectionAPI 가이드 프로그램 QUERY XML |
| 테이블명 | 테이블명(영문) | 비고 |
|---|---|---|
| 탈옥정보 | detection | 탈옥 및 루팅 정보 관리 |
| No | 컬럼ID | 컬럼명 | 타입 | 길이 | NULL |
|---|---|---|---|---|---|
| 1 | SN | 일련번호 | NUMERIC | 6 | NotNull |
| 2 | UUID | UUID | VARCHAR | 45 | NotNull |
| 3 | OS | OS | VARCHAR | 45 | NotNull |
| 4 | PG_VER | 폰갭버전 | VARCHAR | 45 | NotNull |
| 5 | DETECTION | 탈옥여부 | VARCHAR | 45 | NotNull |
JailbreakDetection 디바이스API 가이드 프로그램에서 제공하는 모바일 디바이스의 메타 정보 조회 기능을 활용하기 위하여 필요한 항목 및 그 환경 설정은 다음과 같다.
<!--전자정부 Interface 디바이스 API를 사용하기 위한 Phonegap Plugin 클래스--> <feature name="InterfaceAPI"> <param name="ios-package" value="EgovInterface"/> </feature> <feature name="JailbreakDetection"> <param name="ios-package" value="JailbreakDetection" /> <param name="onload" value="true" /> </feature>
<access origin="ExternalHosts"/>
#define kSERVER_URL @"Server_URL"
<sqlMap resource="egovframework/sqlmap/hyb/mbl/jai/EgovDeviceAndroidAPIGuide_SQL_[DB명].xml"/>
JailbreakDetectionAPI 가이드 프로그램은 크게 디바이스 내 메타 정보 조회 기능과 조회된 메타 정보를 서버에 전송하고 조회할수 있는 기능으로 구성되어 있다.
/** 디바이스 정보 VO */
var deviceInfoVO = {
sn : "",
uuid : "",
os : "",
pgVer : "",
detection : ""
}
function fn_egov_detectio(){
var successCallback = function (result) {
var isDevicesRooted = result == 1;
$('.deviceInfo:eq(0)').html(device.platform + " " + device.version);
$('.deviceInfo:eq(1)').html(device.uuid);
$('.deviceInfo:eq(2)').html(device.cordova);
$('.deviceInfo:eq(3)').html(" " + isDevicesRooted);
};
var errorCallback = function (error) {
console.error(error);
};
rootdetection.isDeviceRooted(successCallback, errorCallback);
$.mobile.changePage('#deviceInfo', 'slide', false, false);
infoScroll.refresh();
}
function fn_egov_get_networkInfo() {
var networkState = navigator.network.connection.type;
var states = {};
states[Connection.UNKNOWN] = 'Unknown connection';
states[Connection.ETHERNET] = 'Ethernet connection';
states[Connection.WIFI] = 'WiFi connection';
states[Connection.CELL_2G] = 'Cell 2G connection';
states[Connection.CELL_3G] = 'Cell 3G connection';
states[Connection.CELL_4G] = 'Cell 4G connection';
states[Connection.NONE] = 'No network connection';
return states[networkState];
}
| 디바이스 정보조회 화면 |
|---|
![]() |
OS: 플랫폼 정보 및 버전
UUID : 디바이스의 고유 아이디
PhoneGap Version : jailbreakdetection가이드 프로그램에 적용된 폰갭 버전
Jailbreak Detection : 디바이스의 탈옥 및 루팅 여부
function fn_egov_save_detectioInfo(){
var url = "/jai/addJailbreakDetectionDeviceInfo.do";
var d_os = $(".deviceInfo:eq(0)").text();
var d_uuid = $(".deviceInfo:eq(1)").text();
var d_pg_ver = $(".deviceInfo:eq(2)").text();
var d_detection = $(".deviceInfo:eq(3)").text();
console.log("os > " + d_os + "\n uuid >>> " + d_uuid + "\n pg_ver : >>>>" + d_pg_ver + "<<<<<< \n detection >>" + d_detection + "<<<<");
var params = {
os : d_os,
uuid : d_uuid,
pgVer : d_pg_ver,
detection : d_detection
};
window.plugins.EgovInterface.request(url, params, function(jsondata) {
console.log("jsondata > " + jsondata);
if (jsondata.resultState == "OK") {
console.log("send ok");
} else {
$("#alert_dialog").click(function() {
jAlert('데이터 전송 중 오류가 발생 했습니다.', '전송 오류', 'c');
});
}
}, function(result) {
console.log("error > " + result);
});
console.log("JailbreakDetectionDeviceInfo fn_egov_save_detectioInfo request Completed");
$.mobile.changePage("#main", "slide", false, false);
detailScroll.refresh();
}
| Action | URL | Controller method | QueryID |
|---|---|---|---|
| JailbreakDetection정보 등록 | /jai/addJailbreakDetectionDeviceInfo.do | insertDeviceInfo | “jailbreakDetectionDeviceAPIDAO.insertJailbreakDetectionDevcie” |
정보 업로드: JailbreakDetection 결과 정보를 서버로 업로드 한다.
function fn_egov_move_JailbreakDetectionInfoList() {
var url = "/jai/JailbreakDetectionInfoList.do";
var accept_type = "json";
var params = {
uuid : device.uuid,
};
// get the data from server
window.plugins.EgovInterface.request(url, params, function(jsonData) {
var list_html = "";
$(jsonData["JailbreakDetectionDevcieList"]).each(function(idx,obj){
var sn = obj.sn;
var uuid = obj.uuid;
var os = obj.os;
var pgVer = obj.pgVer;
var detection = obj.detection;
console.log("uuid >>>> " + uuid + "\n os >>>>>>> " + os + "\n pgVer >>> " + pgVer + "<<<<<<" + "\n detection >>> " + detection + "<<<<<<");
list_html += "<li><h3>UUID : " + uuid + "</h3>";
list_html += "<p><strong>OS : " + os + "</strong></p>";
list_html += "<p><strong>Version : " + pgVer + "</strong></p>";
list_html += "<p>Detection : " + detection + "</p></li>";
});
console.log("JailbreakDetectionAPIGuide fn_egov_move_JailbreakDetectionInfoList request Completed");
var theList = $('#JailbreakDetectionList');
theList.html(list_html);
$.mobile.changePage("#JailbreakDetectionInfoList", "slide", false, false);
theList.listview("refresh");
detailScroll.refresh();
listScroll.refresh();
});
}
| Action | URL | Controller method | QueryID |
|---|---|---|---|
| JailbreakDetection 정보 목록 조회 | /jai/JailbreakDetectionInfoList.do | selectJailbreakDetectionDevcieList | “jailbreakDetectionDeviceAPIDAO.selectJailbreakDetectionDevcieList” |
| 디바이스 정보목록 조회 화면 |
|---|
![]() |
메인화면 이동 : 메인 페이지를 호출한다.
디바이스 어플리케이션에서 발생한 오류 내용 확인 및 디버깅을 위해서는 폰갭 프레임워크에서 제공하는 console.log를 이용할 수 있다. console.log 함수는 자바스크립트 구문에서 사용할 수 있는 디버그 코드로 이클립스 및 Xcode에서 확인 할 수 있다.
function fn_egov_network_check(doCheck)
{
console.log('DeviceAPIGuide fn_egov_network_check');
var networkState = navigator.network.connection.type;
...
}
JailbreakDetection 디바이스 API 가이드 다운로드 : Click