From 6e1e0d0f530be5fe1d7280f54d613d6c91bff3d0 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Sat, 2 May 2015 03:18:49 +0300 Subject: [PATCH 01/27] Translation into Russian has been improved --- app/src/main/AndroidManifest.xml | 2 +- .../res/values-pl/translatable_strings.xml | 2 +- .../res/values-ru/translatable_strings.xml | 178 +++++++++--------- 3 files changed, 91 insertions(+), 91 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c8e8bb752..0b7a54359 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="0.1.26-alpha-b01"> - Location Services Disabled - You cannot track GPS data without enabling Location Services. Enable them now? + Определение координат отключено + Вы не можете отслеживать данные GPS без сервиса определения координат. Включить его сейчас? - System Settings - Auto Start - Automatically start service on boot - Persistent Service - Service will continue to run after exiting the application (uncheck to fully close) - Protection Settings - Cell Tracking - Enable Automatic Cell Tracking - Femtocell Detection - (currently CDMA Phones ONLY) - Femtocell Protection - Enforce Airplane Mode when Femtocell detected (re-enable network manually) - Interface Settings - Icons - Icon Theme Selection - Refresh Rate - Control the frequency of device updates - OpenCellID Settings - OpenCellID API Key - Enter your OpenCellID API Key here - Cell Monitoring - Enable Automatic Cell Monitoring - Request OCID API Key - Request API key for OpenCellID data access + Системные настройки + Автоматический старт + Автоматический запуск сервиса при загрузке + Постоянный сервис + Сервис будет продолжать работать после выхода из приложения (снимите флажок полностью закрыть) + Настройки защиты + Отслеживание сотовой сети + Включение автоматического отслеживания сотовой сети + Обнаружение фемтосот + (в настоящее время только CDMA телефоны) + Защита от фемтосот + Принудительный режим полета, когда фемтосот обнаружена (подключение к сети вручную) + Настройки интерфейса + Иконки + Выбор схемы иконок + Частота обновления + Управление частотой обновления устройства + Настройки OpenCellID + Ключ OpenCellID API + Введите здесь ваш ключ OpenCellID API + Мониторинг сотовых сетей + Включить автоматический мониторинг сотовых сетей + Запрос ключа OCID API + Запрос ключа API для доступа к данным OpenCellID - Map Viewer Preferences - Map Type - Display Map in different styles + Настроки просмотра карты + Тип карты + Отображать карту в различных стилях CID: @@ -153,14 +153,14 @@ MCC: MNC: PC: - Samples: - OpenCellID Data - Lat: - Lon: + Образцы: + Данные OpenCellID + Широта: + Долгота: - Load Data - Select Table + Загрузка данных + Выберите таблицу @string/unique_bts_data @string/bts_measurements @@ -170,40 +170,40 @@ @string/measured_signal_strengths @string/eventlog - Export Successful + Экспорт успешен - AT Command Interface - Response: - Execute - Current Serial Device: - Select Serial Device - Detected Devices: - Timeout: - Select Timeout - Enter AT command here. + Командный интерфейс AT + Ответ: + Выполнение + Текущее Serial Device: + Выберите Serial Device + Обнаружены устройства: + Задержка времени: + Выберите задержку времени + Введите команду AT здесь. - Silent SMS Intercepted - Silent SMS Message has been intercepted!\n\nDetails are available through the Database Viewer. - Table contains no data to display. + Бесшумная SMS перехвачена + Бесшумная SMS была перехвачена!\n\nПодробная информация доступна через просмотр базы данных. + Таблица не содержит никаких данных для отображения. - OpenCellID API Key - Click OK to request an API key from OpenCellID.org. This will enable you to download their data and view it in the map. It will also enable you to upload cell data. Note that if you do not upload cell data within 20 days, your API key may become inactive. - Error getting key: - Saved new API key + OpenCellID ключ API + Нажмите OK для запроса ключа API из OpenCellID.org. Это позволит вам скачать их данные и просмотреть его на карте. Это также позволит вам выгружать данные сотовых сетей. Обратите внимание, что если вы не выгружать данные сотовых сетей в течение 20 дней, ваш ключ API может стать неактивным. + Ошибка получения ключа: + Сохранен новый ключ API - Debug Logs - Clear - Copy - Logs copied to clipboard - Stop - Start + Логи отладки + Очистить + Копировать + Логи скопированы в буфер обмена + Стоп + Старт - DETAILED EXPLANATION + Подробное описание App is idling or loading. No protection and detection measures are enabled. Please open the Navigation Drawer and enable them in section TRACKING. No threats detected or found. Our App is constantly checking your network based upon the protection measures you\'ve set in the Navigation Drawer and Preferences. Insecure Service Area: At least 1 new or unknown BTS is in operation in this vicinity, or using an insecure (broken) encryption algorithm lower than A5/3 [Detection is WIP]. Expect that any phone calls/SMS made in this area can be intercepted and recorded. You better leave this place now. @@ -248,31 +248,31 @@ FemtoCell Detection Active. Cell Tracking Active. Cell Monitoring Active. - Phone Type - - Status: Idle. - - Status: Good. No Threats Detected. - ALERT: Some Threat Detected! - ALERT: FemtoCell Connection Detected! - ALERT: Type-0 Silent SMS Intercepted! - AIMSICD can only detect FemtoCell connections on CDMA devices. - Service State changed! - : Stopped tracking FemtoCell connections. - ALERT! FemtoCell Tracking Detected. - Refreshing every - Refreshing now… - seconds. - Contacting OpenCellID for data…\nThis may take up to a minute. - Unable to determine your last location.\nEnable Location Services and try again. - No tracked locations found to show on map. - No data for publishing available. - Download error: + Тип телефона + - Статус: Неработающий. + - Status: Хорошо. Угроз не обнаружено. + ТРЕВОГА: Обнаружены некоторые угрозы! + ТРЕВОГА: Обнаружено соединение с фемтосотой! + ТРЕВОГА: Перехвачена бесшумная SMS(Type-0)! + AIMSICD может определять соединение с фемтосотой только на CDMA устройствах. + Статус сервиса изменен! + : Остановлен мониториг соединения с фемтосотой. + ТРЕВОГА! Обнаружен мониторинг фемтосоты. + Обновлять каждые + Обновить сейчас… + секунд. + Обращение к данным OpenCellID…\nThis may take up to a minute. + Невозможно определить ваш последнее место.\nВключите сервис определения координат и попробуйте еще раз. + Не найдено отслеживаемых мест, чтобы показать их на карте. + Нет доступных данных для публикации. + Ошибка загрузки: OpenCellID data successfully received. Error retrieving OpenCellID data.\nCheck your network! OpenCellID data successfully received.\nMap Markers updated. Uploaded BTS data to OCID successfully. Error in uploading BTS data to OCID servers! - Restore database completed successfully. - Error restoring database. + Восстановление базы данных успешно завершено. + Ошибка восстановления базы данных. Database backup successfully saved to: Error backing up database. No OpenCellID API Key detected!\nPlease enter your key in settings first. @@ -281,16 +281,16 @@ Unable to detect Busybox on your device.\nAT Command Injection requires Busybox components to function correctly.\nPlease check your device has Busybox installed and try again An unknown error has occurred trying to acquire the Serial Device.\nPlease check your logcat for any errors and post them to Github\nor XDA, links to both of these locations can be found within the\nAbout section of the application. An unknown error has occurred trying to initialise the AT Command Injector.\nPlease check your logcat for any errors and post them to Github or\nXDA, links to both of these locations can be found within the\nAbout section of the application. - Getting OpenCellID API key… - Unable to create map! - ATTENTION! Please describe the problem you had, before sending us these logs. NO HELP WITHOUT DESCRIPTIONS!\n - Status: - IDLE - NORMAL - MEDIUM - HIGH - DANGER - RUN! + Получение ключа API OpenCellID… + Невозможно создать карту! + ВНИМАНИЕ! Пожалуйста, опишите проблему, которая у вас была, прежде, чем отправить нам эти журналы. НЕТ ПОМОЩИ БЕЗ ОПИСАНИЯ!\n + Статус: + Неработающий + Нормальный + Средний + Высокий + Опасный + Беги! AIMSICD status, neighboring cells, ciphering method indicator. From b2034c2ddff90d43e40746a1917a39beb916c4fa Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Sat, 2 May 2015 14:57:37 +0300 Subject: [PATCH 02/27] Diameter of markers has been reduced by 50% Drawing markers of cell tower immediately as possible --- .../AIMSICD/activities/MapViewerOsmDroid.java | 11 ++++++++++- .../map/CellTowerGridMarkerClusterer.java | 13 ------------- .../res/drawable-hdpi/ic_map_pin_blue.png | Bin 780 -> 577 bytes .../res/drawable-hdpi/ic_map_pin_green.png | Bin 369 -> 303 bytes .../res/drawable-hdpi/ic_map_pin_orange.png | Bin 362 -> 284 bytes .../main/res/drawable-hdpi/ic_map_pin_red.png | Bin 363 -> 315 bytes .../res/drawable-mdpi/ic_map_pin_blue.png | Bin 533 -> 363 bytes .../res/drawable-mdpi/ic_map_pin_green.png | Bin 284 -> 239 bytes .../res/drawable-mdpi/ic_map_pin_orange.png | Bin 284 -> 229 bytes .../main/res/drawable-mdpi/ic_map_pin_red.png | Bin 279 -> 232 bytes .../res/drawable-xhdpi/ic_map_pin_blue.png | Bin 921 -> 716 bytes .../res/drawable-xhdpi/ic_map_pin_green.png | Bin 450 -> 386 bytes .../res/drawable-xhdpi/ic_map_pin_orange.png | Bin 440 -> 387 bytes .../res/drawable-xhdpi/ic_map_pin_red.png | Bin 453 -> 386 bytes .../res/drawable-xxhdpi/ic_map_pin_blue.png | Bin 1340 -> 1114 bytes .../res/drawable-xxhdpi/ic_map_pin_green.png | Bin 569 -> 458 bytes .../res/drawable-xxhdpi/ic_map_pin_orange.png | Bin 570 -> 478 bytes .../res/drawable-xxhdpi/ic_map_pin_red.png | Bin 581 -> 480 bytes 18 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java b/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java index 665611a62..a2526c0f0 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java @@ -41,6 +41,7 @@ import android.view.MenuInflater; import android.view.MenuItem; +import com.SecUpwN.AIMSICD.BuildConfig; import com.SecUpwN.AIMSICD.R; import com.SecUpwN.AIMSICD.adapters.AIMSICDDbAdapter; import com.SecUpwN.AIMSICD.map.CellTowerGridMarkerClusterer; @@ -76,7 +77,7 @@ * [ ] See: #272 #250 #228 * [ ] Some pins remain clustered even on the greatest zoom, this is probably * due to over sized icons, or too low zoom level. - * [ ] pin icons are too big. We need to reduce pin dot diameter by ~50% + * [x] pin icons are too big. We need to reduce pin dot diameter by ~50% * [ ] Need a manual way to add GPS coordinates of current location (see code comments below) * [ ] * @@ -440,6 +441,7 @@ protected GeoPoint doInBackground(Void... voids) { ); // The pin of our current position ovm.setIcon(getResources().getDrawable(R.drawable.ic_map_pin_blue)); + items.add(ovm); @@ -533,6 +535,13 @@ protected void onPostExecute(GeoPoint defaultLoc) { } } } + if(mCellTowerGridMarkerClusterer != null) { + if(BuildConfig.DEBUG && mCellTowerGridMarkerClusterer.getItems() != null) { + Log.v(TAG, "CellTowerMarkers.invalidate() markers.size():" + mCellTowerGridMarkerClusterer.getItems().size()); + } + //Drawing markers of cell tower immediately as possible + mCellTowerGridMarkerClusterer.invalidate(); + } } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/map/CellTowerGridMarkerClusterer.java b/app/src/main/java/com/SecUpwN/AIMSICD/map/CellTowerGridMarkerClusterer.java index 50ca44ae3..64102aa2d 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/map/CellTowerGridMarkerClusterer.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/map/CellTowerGridMarkerClusterer.java @@ -1,22 +1,9 @@ package com.SecUpwN.AIMSICD.map; -import android.app.AlertDialog; import android.content.Context; -import android.content.DialogInterface; -import android.graphics.Color; -import android.graphics.drawable.BitmapDrawable; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.TableRow; -import android.widget.TextView; - -import com.SecUpwN.AIMSICD.R; import org.osmdroid.bonuspack.clustering.GridMarkerClusterer; -import org.osmdroid.views.MapView; -import org.osmdroid.views.overlay.ItemizedIconOverlay; -import java.util.LinkedList; import java.util.List; /** diff --git a/app/src/main/res/drawable-hdpi/ic_map_pin_blue.png b/app/src/main/res/drawable-hdpi/ic_map_pin_blue.png index 8654376b274a9f2b2c42219b012fd3141716f87f..ec5385c51e86d9f15b5da6a517ccb0c94231cbe4 100644 GIT binary patch literal 577 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`Z5(0ceT!A#h;x7y*|Ff+8%ChPU z>&kBobN{oh`~qZy5k&9{%ZkseYrZn9`oXa3KUn-T%c{>nWvnYdv#$Eeyz&!N{mQSb z8~?Lz`OmWMH_MtIEUUjI)V*H-v_h&R$S;_IiShS89kx4PUhk@ovX>R&d3JQ|vh3sl z*RDr1i|#WpFqV0`IEGl9?wxXbQnLb2+rfs4HMg!gb3XXJ|LMOSZ(qFmrc@}SSf`>m zVMVt{RDD~N_^a6>Gc|JeuiL9@_@|9ga@TU@`IFSYzhPVPZ?@#^PRqB|r}RHx>8tM% zZM_w9gLm`#SGzu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RYHfGtm$Pw-%j_08>$WloEK?$LR<g6he9Vzye z=j)2&>n*IO%`fHD-1anQwd+iQ!wLsEG?+w}G3zDlo4;-I+ZsQQmtJ1qRc+_S?fA#~ wEB#)6_q~MLkS_}_9}kabsa^WzX$^;dlaWBEkK-R%pi>z?EawdFeGAi$dNUrN+bht*MEVVhY}a<=M?4tJ0A*MdzCSii9CY+3t4bkQ*pqjUim zm6??v4_^EIieD(L{NA*h8iz1-wONlFJ<{d>8h0_momtz zPS!KKs?a@2&_(#<(>5RF6N{fPTnG)RVrZ3Gn&6g{l)iOKM)HL_i*`FYcPAD9VG?>- zsJx^-&OKv!0PDhiPN^-oxYi0*X_UCVc-r*gxlG-h{s#WZ^4#_bb)hnPvitYd2>$T; z`1DEky8wwjRTZ5dt)3h`r9Er9ZM|7dP0qc%dF{n7Z#I7bdYHk})z4*}Q$iB}-g=Pn diff --git a/app/src/main/res/drawable-hdpi/ic_map_pin_orange.png b/app/src/main/res/drawable-hdpi/ic_map_pin_orange.png index fae7baf28cf3cc25583d5400f4bea4a1b105d21b..030dbbec5eb5d0776b2330010144bd0709c6fa2f 100644 GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|l3?zm1T2})ptpJ}8S0MeWl;L?J^YdmP$@IK| z`56#3vOH^G0kWUhfw*5gm|r(D7cqJ&0#$RD1o;IsF#i!Pdi`=jPnhSbj=5z(;c1>O zjv*T7lNazOh=_#okBAo4Tj z7B9;#cL~8RzwG7~v$u`f!Un8bOxoOOEu2>wL>s5dwsRUjf7jNO%@(kDN8aIH@cXyxCW%_X?XX{>Ww&{xtS0|p`%guV7so+*FBZ-N|s$5(e5`Mwlp^sBnb71T~eM=5TrQg1&4b4A<4#qX-ekBNomDK+&pI%wV!d~ t*=(V*KH;d&B2Dc#f>)1eNU%yUFkIn@uD#19&ja)=gQu&X%Q~loCIDvoiu3>g diff --git a/app/src/main/res/drawable-hdpi/ic_map_pin_red.png b/app/src/main/res/drawable-hdpi/ic_map_pin_red.png index fbbaded6717b595dd5c21bc6b195f9cb2700c0fb..fb7c0c2b112b72376d3899a86afd8a23f26d85d0 100644 GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`Zj01c^T!HjO2Ezpm3>VmyAm}`Y z;sp++iy*G@1vbTV?8-N|)GzVN0cEeTE8pi(c_aAv2~ZnfNswPK12fZ~--T~pPUs2q zloAv-&MgPZtn_qo46!(Ucd{qnVFe!7l{3|Ef49$FyGpl-N9^{VP^WoyJU5;x9(c`s zM{ED`Y~LwywdeMgRqiZ`>N>)7^vXG1166~CrRS6iHQ3G-*-SjF-*@8lrGuK2n(9^7 zt`VCd<}s&n=>;Ag$4*&43%^Y^tY1BLIBb-j(X`5fef6pK%gTe~DWM4f Dws3cB literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xZ3?!EyURMI7v;urWT!Hj?cEt~t^@&$Iq zGrVfY7-WF5E7_Nn16A{u1o;IsD84$85%>M}rbTWdoC1<5%0P+7o-U3d9>?EawdFeG zAi$bX&%L&3El1bfsW;ejbXoWpxS!zt!okSRuW;`Gb41rxmt==$dQBZF#`={TzV7?g z%)8lI-&9_HLh=00UrB04b}XUKq)wTi+;wM5`KQy_p;ciz|5H-c=c!ERG+V3Df63Ct zTk}bykGa;OFB}2>A#MyurBV~zl9JL(H)mvDIJRiH<3iWYokEP9Uv>yya(=I{C45Ea zg^-18PR^}*9D7Bj6iUh+e^|8hKUaQm_{sG{`ZMfB+ue`P*N}{*VlHgS`_bOB*`1#QE&_>z2DQtF+}5hY0yovqXIl7moJ>X zcI?yt`YQKIU%rDrZX9X1-WOli&rr0!Is50fE&6pwk9cQIy|~_@p>==UElHV)-08yq znPypRPns|J^~R+i$roy^GhRM?ks+rXHN}a|a&qy@c23dG=9}x&HlDfTYL)JjySr?K zr{A0T{5KPdQl410I^2*dD4DkQfLUUUatQaMb?0VWX{`70KenSv*^+;*bd#o|gyV9d yTVYv6e|Ows{W>YbHRSX<+bRFH{7Mhle_sA#nE-FgOhr(zGI+ZBxvX=j>t3?O0wlgukWGq3o{y7C*ts&5P%{xhutN__??SOHSNwCXER3s3>e^3M#bz5~Vg zZVWsHG*qf2$S;`TJ@e5ud7|GR-P}LJ$5@)`!8aL6uRzZ&a0Ydbkl-!M#NvHJ8Ne3DPLXvFuub0>aLcs zjsKH>?JN_&QvCnLy$uiIS~fhpS08?|^+M(%mDbgN&;8du@GEK;qlxqOJr3&kmhNwj z>df@h;ca}CJ8}Qnm(yCePB;E`z`d+I##%Ds?Q#>X4e#Y=$!Z1ue5muJKBq$dT*Ayn z-~I^CKbWPYda=x7P1E6t1?PlKW)}!1WfyT3SJ~UmbCF)I$Nbcg`=k2@n>#M`kNgxa zo_wM*<$VD2%oV#E+?wA{>GJ$LS63l_-2t{~NAJto`@LRZzlcYG+2qxOy}zm)vhVWh zJoz*?vUx>qZm1A<#)gS1LGe*R(-f{A&HdvctnoCqf#voWLH81dSwg!qN}?}{x7SJC zINn}&?*%`{@6JW-3}t5)uuGPOB()os-ANYbDoahAu2l3^N!~n4=ejD}I?B R+Y5{e22WQ%mvv4FO#tU0^?m>V diff --git a/app/src/main/res/drawable-mdpi/ic_map_pin_green.png b/app/src/main/res/drawable-mdpi/ic_map_pin_green.png index 2660b56d4b063bc8e1c6631eeb02da7aafdf26ec..fb208d11b3914b75a507028e2d6c3640e027292f 100644 GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;w^#Gp`S0HV^g~50av+-^qVln|T zb}h&BDEB|lI!*VDx@ zMB;L?0s{-{#2X4MtUWx&R+20WWEz9gCl|P_V3~dH-Q9K}76l>8?y$9&td4O^OSpb1 zYHQZTMNEtW?O!iwDO})WC}dgohN&>D+NjCmtUwzJ_N>>Fl0$&vGdx`!Lo7}wOL!(MHVI2S z88X*7QP}Y4(cE(k2Om0>6za`4PAEuWoaJ&^QsaVy=yMBZc3uskZULdF6OVfAI69S? zJcQn)PjFzI)MBuyMRC#*nUv1S9zvEUgpN;8Nt&SAr*vdz=>%22T!$Usc(?=sA?!zMuGix~1EnI|-PF>+Hz`*d%`pe6YJ662`x{<-t L)z4*}Q$iB}UBq8) diff --git a/app/src/main/res/drawable-mdpi/ic_map_pin_orange.png b/app/src/main/res/drawable-mdpi/ic_map_pin_orange.png index 2f9a84ea0890d09942607a8be7cd1deec77ae788..760e9d68c520bbab0eec6fe3738afdd2a3091f24 100644 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;wl>na*S0Meel;L?J^RosZVtNiF zo0y(8Gkk1d0J6V!GQVwMzI0n$2dIv-B*-tAf%(^`t5Y&Gg`RKTtOgWJ_jGX#k+__! zz{t@gAYx$TVPeGLV9B)foZ7>l08X>Db2p2tayY1LQad|m<<1^KorCLES{6TB;>pUS z!1sF5Oos)c3}Nb_pjWCanfdxnE3pRxwx6L9CWqjI|_B4Eu`N+WV%uV;Q TWKiZlpp^`su6{1-oD!M<4~lE$8hkWQ%RxTeB*?I6vkODmnAhWIEX&CU}opl5b72X ziaPPA$Bv^@naM-wP5J}}#z`#(n_3hn9g#`toa`ZFc|z#;1eK%-s(ngFc9u?1<;!*0 z@r{Q|KtZK3Q-txf;au+%%`+UGGz1Kr=LWbWy6HYV(lE1zL*2qf=;+iH?g9)9@2tPP V{J3M)8=xB*JYD@<);T3K0RSG|WYquw diff --git a/app/src/main/res/drawable-mdpi/ic_map_pin_red.png b/app/src/main/res/drawable-mdpi/ic_map_pin_red.png index 2285f4b8f6b3fe1851573b1038a87dbf65c20b89..7a96e9d2b30b2194ea3353d02624a52d06dd15e0 100644 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;w^#Gp`S0H_nLFyvA(giR&&#rWt zP4y~+%msFZbLI$kN;``D&;B(@(X5Q{`K+7G)sPY7=^aQH(1gZ1{s`Le^^aZN)1*`Q1sq_S> z^aQH)1*-G}sq_S?@&u>y1*-G_uJZ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9xj{R=wfYo!3XZXtgoqjYe!)E01FI-&mkm!l5sKE)jZ=(QS&J zXy~N^z1U%wYxDyL{m4W=^wF;^*cUJKt0Vg57yJ5-{s2LLLSa7w(Vwx{4{`KX0(LV5 zyPbpHkV0;$J+YgD=xt5x#w>Pg8M`_D@7w!-M%e_#;Fw||f0Br{(_FHHYod^RfMD?xg+mE(R00000NkvXXu0mjfeR{X! diff --git a/app/src/main/res/drawable-xhdpi/ic_map_pin_green.png b/app/src/main/res/drawable-xhdpi/ic_map_pin_green.png index a215caa26ec598ec55b4712a7786bd6ad41fde17..ab5912ffd280011d3b15f53b61a7d1928aaf37d9 100644 GIT binary patch literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-smH|E?t|0mpgYj-=hGihqcsG;L z9wxJ0KsJ-{9w1@{k-Jz7_A@x_2P@deY^Sq0tJ#x*n)yqD{DK*n{xbf0nIv%U z?1EZ11)iVVe#{3-z4UZ(4DmSrcIs)qRs|lHN|BGOBLDs;zn>xf$Z3O`%DOqdEazHQ zI)%=^H+gGR^zSKbf8-B*;jj;oZ?b3G#5!gEwWESNQ|H>Kso3S|O+O$g4bwYs!Jvm#a)8mQMf2*UhFdML~37sDhuY zAuB^Oo8_g1i=VP({}z0@C}C6c>7(3khfkui`AkK#CG%5?R?FlcE80E1USodTW&U^e W%C;*P3w#B7n!(f6&t;ucLK6U=f|~&V literal 450 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeE3?v1%WpM*3g8-ipS0HV?8;thA7`qt^cQcsm zW-!|Y7J-nv8H{#-xc8z}7X$V1mjw9*GyKxMys<0Q)j;6o<3qDlOtL0wFfcG0dAc}; zL>zuQ&2yb&pg>#vz3N?^6Vnn3RE3;fk`j(_32s z4s}Fy1!R0U#3#4uFt?u7yLzT64Hw)GF>;8i

ttn?6+bm@4{j!-V8k9Wk>t7Y-hp zCps-+$A&{P-05L6k{%wht7qrdGv_*#l5ljd+~f&YxIV=Pnd#Pty*+p`+`0DWlhO3t4~dIkj+YoADH2z%qEc`njxgN@xNAueiJ* diff --git a/app/src/main/res/drawable-xhdpi/ic_map_pin_orange.png b/app/src/main/res/drawable-xhdpi/ic_map_pin_orange.png index b15d637791988d51282e1c3123a9740c126f6f3a..17ad647addb4d1ab37bd8ef667b9facf151d725d 100644 GIT binary patch literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sHUT~%u0Z<11cvAH7@jvUKLa7A zCk+hG8kwIrFag;>1Qus{*~s#|f#ESws)6})JM*h1=69{k3}v6L0`&`&1o;IsFf;!8 zm&Et>>D_Y+Yg`qCrf7Ld0p*@~x;Tb-9Dg&_o3Gh`$K|aLNBxGmzwd9=>h{uQ3-7uT zdcUi6ep0jXh57d<^6gufwv74Nm(ZV^x8y`u+8yB%etXyEtAqX7yM9LkYa`jNW+{b* zwl5X9zkPFGmV+IG&+)J8beEme+O+4yife-RudH^s*YINL!7Z~=ekydY-8XSXk7yB7 zsm_!;%wnw;4&q7g8)`Sa;k?;4capW?5!QEid_HeAnBVGRbM+1PPCuWQDpT&QV|m@J zoHIe&al=;bLhoMZZ literal 440 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD3?#3*wSy##1AIbUf%LNmh8ImB5`pR&o;EN% zZDe@S%>d#4GfLV7TQ2<0wqCy!3=+NzdyUYvCGv!;LxnhBo!`()D#8= zMioyN$B>MBZ!UTF9X8-$4)EIc*nd*ncl)urq^4d%G1dZK=|7gbAt3BqCQ&U_JXd2S|7m7J7l(xPaTP;B_ZXupZa{-qC= z%Np-wWME6Y@h`fZ+2xN>mW>m?$C>^UMJIpEtg@4m6`hypetc{C!vj+@qkd^@+tDQ6 z(YNh`^zrg|Mo#T18(Gv$uSFf%u60ny+05#=-jcMXWv*O&QJ*Kx&|Nwu=-)HO4xyP> U`P>9%0>hHQ)78&qol`;+0Mo;@RsaA1 diff --git a/app/src/main/res/drawable-xhdpi/ic_map_pin_red.png b/app/src/main/res/drawable-xhdpi/ic_map_p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ae_z>Qx+qGt)t)EKl49K1_mvIr>mdKI;Vst0I!g=Ua|S1@oEIwq0aV+ba8XS)7T z*W`U4R%>%-qW3rx#uLTon{q(DfqC{)sLy`k|ZVfByfm*oH*U3U$y9gt739v&8JPq&U5+a z2-r;Vd@@BNAe3Fbm&^5R;jHWnlUFD>_LgY9*c65r@d@zM&BwKwUeHq%inxBTIW@*YBo2LH$+S;tzy;Z>d+3K-G4Ub zACH?mFZb($U5%V;gJbh|tSe}2dfmc(A}+n-i`fPD-(@*020Vui3jVLXn%%Tt*}$<& zWtvCD%f=nkXZ?P&Q(n2eq@rEhysm&*%KT7~v)y*K%5J6YUd4&c;>QabMa5rME>sui zu0CiPu3PbxJKVpLbzXR3k?Mx<$<<1Y%cClcx|YALaGJclrZQ;Ga^9w-rOW3v73rl diff --git a/app/src/main/res/drawable-xxhdpi/ic_map_pin_orange.png b/app/src/main/res/drawable-xxhdpi/ic_map_pin_orange.png index f73f3a7246c8971a3a96f5fbc23db35f5678cb68..6fc60f1bb03f2028ab0fe47faada93de11d7533d 100644 GIT binary patch literal 478 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~Wq?nJE0BKPzpGse!&cXm>DyEJYTIN z%XRbkfhac*B6YDvqq3x>w|S=w#(YYm~e?!rX!w=_3D@9~K^xErq$FI)hnI`8-ue=RC22&Y@+v_`jtlt@)xToOO zqY9>gt2RlTO@&GPOx5#dFtn3dUlv|-n?v*XtYoMLZq$i z<(u4{&p*4>3g+4z-z}Q#e_dt89YtZ;y@IF2TyEsV*c+GT{n7DsU8(x%*n1V>i|6X| zMD2w-7VI!{O=VQ{&g|HcQ6xD1?PsOhtX~JOO^>%%-2b`rg?-dtqebyIzIeYqE?)n) zY{`9vuhHA~b^b_-UYx(>%i8(-B(H8i{;MsvzNO;)!e`=rk&{n8iT%TbP0l+XkKp%u@B literal 570 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=j01c^T!Hkn28QPi49^&;c~q9Xo!cv^D-4W)rxq4`FpiS&?;aN6MPfvbilPe&i uZTnSZO0i?Dq{tpu*0?Sf1qD!JDOC ztHYahB3q+6%NE}q^L-aNo_ruT-M3?2(B!9$I-)b1-$l%~ zo~t5VW-nQB^t;a7dy~w{Bk@69)RxtdWFr&_!hc00Fg0L_t(&-t5%9N<%Ri#_>|IS`Y_?D)^CF zaJGWt;3&9BMJFdMxLffCbav_Dbp&y7Q?H;1?&>8(szYpfx|PzNllRF9otobT{7HE8 zCKp9f6h%=q9>tqVWv>}pnce(&)PP+%I=Kz$?7pFI^)&l&E;R<&!;FWT`Noj-MyAd? zMyzEh73)Y)@*m$05*_$<9uyLpGtYswkfP%^x_zX2^6BIiQkim&SBFE1?-Vo~>;)a# zfYSoonNn~vRWfuB!85rWEeJZ?qD(_{Oog@~TBL4PgQ(5itpEb^l&(QoB0`@abcr8U zfnel6cOH~4F?0vYvKYDoW@xkV!)`$OM9r=RvmF*$IW6dIHdGzxz>hahE`>sNGsqvcS z#m}p#m*aI^cY)wa!zGJr9~V)s#+I_q^`Q$*SFA35T|>JV|3TGXj|UME5fM)~_{-b% T*NP{r00000NkvXXu0mjf8!raX From c243298bb48462ce3beb4e4c9c685c138a407cc1 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Sun, 3 May 2015 19:16:44 +0300 Subject: [PATCH 03/27] Progress bar in the map has been added; Memory leaks and other warnings were partially eliminated; --- app/src/main/AndroidManifest.xml | 3 +- .../java/com/SecUpwN/AIMSICD/AIMSICD.java | 12 ++ .../java/com/SecUpwN/AIMSICD/AppAIMSICD.java | 123 ++++++++++++++++++ .../AIMSICD/activities/MapViewerOsmDroid.java | 40 +++++- .../AIMSICD/adapters/AIMSICDDbAdapter.java | 11 +- .../SecUpwN/AIMSICD/constants/TinyDbKeys.java | 33 +++++ .../SecUpwN/AIMSICD/service/CellTracker.java | 2 +- .../SecUpwN/AIMSICD/utils/BaseAsyncTask.java | 71 ++++++++++ .../SecUpwN/AIMSICD/utils/RequestTask.java | 87 +++++++++---- .../com/SecUpwN/AIMSICD/utils/TinyDB.java | 24 +++- .../actionbar_indeterminate_progress.xml | 11 ++ 11 files changed, 385 insertions(+), 32 deletions(-) create mode 100644 app/src/main/java/com/SecUpwN/AIMSICD/AppAIMSICD.java create mode 100644 app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java create mode 100644 app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java create mode 100644 app/src/main/res/layout/actionbar_indeterminate_progress.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0b7a54359..2cb61cdec 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -94,7 +94,8 @@ android:allowBackup="false" android:icon="@drawable/sense_danger" android:label="@string/main_app_name" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:name=".AppAIMSICD"> >> mActivityTaskMap; + + public AppAIMSICD() { + mActivityTaskMap = new SparseArray<>(); + } + + @Override + public void onCreate() { + super.onCreate(); + TinyDB.getInstance().init(getApplicationContext()); + TinyDB.getInstance().putBoolean(TinyDbKeys.FINISHED_LOAD_IN_MAP, true); + } + + public void removeTask(BaseAsyncTask pTask) { + int key; + for (int i = 0; i < mActivityTaskMap.size(); i++) { + key = mActivityTaskMap.keyAt(i); + List> tasks = mActivityTaskMap.get(key); + for (BaseAsyncTask lTask : tasks) { + if (lTask.equals(pTask)) { + tasks.remove(lTask); + if (BuildConfig.DEBUG) { + Log.v(TAG, "BaseTask removed:" + pTask.toString()); + } + break; + } + } + if (tasks.size() == 0) { + mActivityTaskMap.remove(key); + return; + } + } + } + + public void addTask(Activity activity, BaseAsyncTask pTask) { + if (activity == null) { + return; + } + if (BuildConfig.DEBUG) { + Log.d(TAG, "BaseTask addTask activity:" + activity.getClass().getCanonicalName()); + } + int key = activity.getClass().getCanonicalName().hashCode(); + List> tasks = mActivityTaskMap.get(key); + if (tasks == null) { + tasks = new ArrayList<>(); + mActivityTaskMap.put(key, tasks); + } + if (BuildConfig.DEBUG) { + Log.v(TAG, "BaseTask added:" + pTask.toString()); + } + tasks.add(pTask); + } + + public void detach(Activity activity) { + if (activity == null) { + return; + } + if (BuildConfig.DEBUG) { + Log.d(TAG, "BaseTask detach:" + activity.getClass().getCanonicalName()); + } + + List> tasks = mActivityTaskMap.get(activity.getClass().getCanonicalName().hashCode()); + if (tasks != null) { + for (BaseAsyncTask task : tasks) { + task.setActivity(null); + } + } + } + + public void attach(Activity activity) { + if (activity == null) { + return; + } + if (BuildConfig.DEBUG) { + Log.d(TAG, "BaseTask attach:" + activity.getClass().getCanonicalName()); + } + List> tasks = mActivityTaskMap.get(activity.getClass().getCanonicalName().hashCode()); + if (tasks != null) { + for (BaseAsyncTask task : tasks) { + task.setActivity(activity); + } + } + } +} + diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java b/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java index a2526c0f0..35dd0ad73 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java @@ -41,9 +41,11 @@ import android.view.MenuInflater; import android.view.MenuItem; +import com.SecUpwN.AIMSICD.AppAIMSICD; import com.SecUpwN.AIMSICD.BuildConfig; import com.SecUpwN.AIMSICD.R; import com.SecUpwN.AIMSICD.adapters.AIMSICDDbAdapter; +import com.SecUpwN.AIMSICD.constants.TinyDbKeys; import com.SecUpwN.AIMSICD.map.CellTowerGridMarkerClusterer; import com.SecUpwN.AIMSICD.map.CellTowerMarker; import com.SecUpwN.AIMSICD.map.MarkerData; @@ -52,6 +54,7 @@ import com.SecUpwN.AIMSICD.utils.GeoLocation; import com.SecUpwN.AIMSICD.utils.Helpers; import com.SecUpwN.AIMSICD.utils.RequestTask; +import com.SecUpwN.AIMSICD.utils.TinyDB; import org.osmdroid.tileprovider.tilesource.TileSourceFactory; import org.osmdroid.util.GeoPoint; @@ -113,6 +116,7 @@ public class MapViewerOsmDroid extends BaseActivity implements OnSharedPreferenc private CompassOverlay mCompassOverlay; private ScaleBarOverlay mScaleBarOverlay; private CellTowerGridMarkerClusterer mCellTowerGridMarkerClusterer; + private Menu mOptionsMenu; private PhoneStateListener mPhoneStateListener = new PhoneStateListener() { @Override @@ -325,6 +329,7 @@ private void setUpMapIfNeeded() { @Override public boolean onCreateOptionsMenu(Menu menu) { + this.mOptionsMenu = menu; MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.map_viewer_menu, menu); return super.onCreateOptionsMenu(menu); @@ -353,6 +358,8 @@ public boolean onOptionsItemSelected(MenuItem item) { cell = mAimsicdService.getCell(); cell.setLon(lastKnown.getLongitudeInDegrees()); cell.setLat(lastKnown.getLatitudeInDegrees()); + setRefreshActionButtonState(true); + TinyDB.getInstance().putBoolean(TinyDbKeys.FINISHED_LOAD_IN_MAP, false); Helpers.getOpenCellData(mContext, cell, RequestTask.DBE_DOWNLOAD_REQUEST_FROM_MAP); return true; } @@ -364,6 +371,8 @@ public boolean onOptionsItemSelected(MenuItem item) { Cell cell = new Cell(); cell.setLat(loc.getLatitude()); cell.setLon(loc.getLongitude()); + setRefreshActionButtonState(true); + TinyDB.getInstance().putBoolean(TinyDbKeys.FINISHED_LOAD_IN_MAP, false); Helpers.getOpenCellData(mContext, cell, RequestTask.DBE_DOWNLOAD_REQUEST_FROM_MAP); } else { Helpers.msgLong(mContext, @@ -467,7 +476,7 @@ public void run() { Log.e("map", "Error getting default location!", e); } } - if(c != null && !c.isClosed()) { + if(c != null) { c.close(); } mDbHelper.close(); @@ -601,4 +610,33 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin setupMapType(item); } } + + public void setRefreshActionButtonState(final boolean refreshing) { + if (mOptionsMenu != null) { + final MenuItem refreshItem = mOptionsMenu + .findItem(R.id.get_opencellid); + if (refreshItem != null) { + if (refreshing) { + refreshItem.setActionView(R.layout.actionbar_indeterminate_progress); + } else { + refreshItem.setActionView(null); + } + } + } + } + + + public void onStop() { + super.onStop(); + ((AppAIMSICD) getApplication()).detach(this); + } + + @Override + public void onStart() { + super.onStart(); + ((AppAIMSICD) getApplication()).attach(this); + if( TinyDB.getInstance().getBoolean(TinyDbKeys.FINISHED_LOAD_IN_MAP)) { + setRefreshActionButtonState(false); + } + } } diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/adapters/AIMSICDDbAdapter.java b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/AIMSICDDbAdapter.java index 212d78ec5..544226c17 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/adapters/AIMSICDDbAdapter.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/AIMSICDDbAdapter.java @@ -760,6 +760,7 @@ public boolean prepareOpenCellUploadData() { if (!file.exists()) { result = file.createNewFile(); if (!result) { + c.close(); return false; } @@ -1258,7 +1259,7 @@ public void checkDBe() { // =========== samples =========== sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE Samples < 1"; - mDb.rawQuery(sqlq, null); + mDb.execSQL(sqlq); // =========== range (DBe_import::avg_range) =========== // TODO: OCID data marks many good BTS with a negative range so we can't use this yet. @@ -1267,25 +1268,25 @@ public void checkDBe() { // =========== LAC =========== sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE Lac < 1"; - mDb.rawQuery(sqlq, null); + mDb.execSQL(sqlq); // We should delete cells with CDMA (4) LAC not in [1,65534] but we can simplify this to: // Delete ANY cells with a LAC not in [1,65534] sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE Lac > 65534"; - mDb.rawQuery(sqlq, null); + mDb.execSQL(sqlq); // Delete cells with GSM/UMTS/LTE (1/2/3/13 ??) (or all others?) LAC not in [1,65533] //sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE Lac > 65533 AND Type!='CDMA'"; //mDb.rawQuery(sqlq, null); // =========== CID =========== sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE CellID < 1"; - mDb.rawQuery(sqlq, null); + mDb.execSQL(sqlq); // We should delete cells with UMTS/LTE (3,13) CID not in [1,268435455] (0xFFF FFFF) but // we can simplify this to: // Delete ANY cells with a CID not in [1,268435455] sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE CellID > 268435455"; - mDb.rawQuery(sqlq, null); + mDb.execSQL(sqlq); // Delete cells with GSM/CDMA (1-3,4) CID not in [1,65534] //sqlq = "DELETE FROM " + OPENCELLID_TABLE + " WHERE CellID > 65534 AND (Net!=3 OR Net!=13)"; //mDb.rawQuery(sqlq, null); diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java b/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java new file mode 100644 index 000000000..2593ae35f --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java @@ -0,0 +1,33 @@ +/* Android IMSI Catcher Detector + * Copyright (C) 2015 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You may obtain a copy of the License at + * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE + */ +package com.SecUpwN.AIMSICD.constants; + +/** + * Constants for TinyDb + *

Relates to {@link com.SecUpwN.AIMSICD.utils.TinyDB}
+ */ +public class TinyDbKeys { + + + /** + * Constant used to store the value that the download is complete + * (applies to the case where the application has been minimized, + * and at this point the download was completed in the map) + */ + public final static String FINISHED_LOAD_IN_MAP = "FINISHED_LOAD_IN_MAP"; + +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/service/CellTracker.java b/app/src/main/java/com/SecUpwN/AIMSICD/service/CellTracker.java index a69c2d896..79efea6da 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/service/CellTracker.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/service/CellTracker.java @@ -132,7 +132,7 @@ public CellTracker(Context context, SignalStrengthTracker sst) { TinyDb tinydb = new TinyDb(context); everytime we need to use tinydb in this class */ - tinydb = new TinyDB(context); + tinydb = TinyDB.getInstance(); // TelephonyManager provides system details tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); prefs = context.getSharedPreferences(AimsicdService.SHARED_PREFERENCES_BASENAME, 0); diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java new file mode 100644 index 000000000..0d38b5618 --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java @@ -0,0 +1,71 @@ +/* Android IMSI Catcher Detector + * Copyright (C) 2015 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You may obtain a copy of the License at + * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE + */ +package com.SecUpwN.AIMSICD.utils; + + +import android.app.Activity; +import android.os.AsyncTask; + +import com.SecUpwN.AIMSICD.AppAIMSICD; + +import java.lang.ref.WeakReference; + +public abstract class BaseAsyncTask extends AsyncTask { + protected AppAIMSICD mApp; + protected WeakReference mWeakReferenceActivity; + + public BaseAsyncTask(Activity activity) { + mWeakReferenceActivity = new WeakReference<>(activity); + mApp = (AppAIMSICD) activity.getApplication(); + } + + public void setActivity(Activity activity) { + if (activity == null) { + mWeakReferenceActivity.clear(); + onActivityDetached(); + } else { + onActivityAttached(); + mWeakReferenceActivity = new WeakReference<>(activity); + } + } + + protected void onActivityAttached() { + } + + protected void onActivityDetached() { + } + + @Override + protected void onPreExecute() { + mApp.addTask(mWeakReferenceActivity.get(), this); + } + + @Override + protected void onPostExecute(TResult result) { + mApp.removeTask(this); + } + + @Override + protected void onCancelled() { + mApp.removeTask(this); + } + + protected Activity getActivity() { + return mWeakReferenceActivity.get(); + } + +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java index a8bd238b0..13531eddf 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java @@ -1,5 +1,6 @@ package com.SecUpwN.AIMSICD.utils; +import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.Intent; @@ -10,9 +11,11 @@ import android.util.Log; import com.SecUpwN.AIMSICD.AIMSICD; +import com.SecUpwN.AIMSICD.BuildConfig; import com.SecUpwN.AIMSICD.R; import com.SecUpwN.AIMSICD.activities.MapViewerOsmDroid; import com.SecUpwN.AIMSICD.adapters.AIMSICDDbAdapter; +import com.SecUpwN.AIMSICD.constants.TinyDbKeys; import com.SecUpwN.AIMSICD.service.AimsicdService; import com.SecUpwN.AIMSICD.service.CellTracker; //import com.SecUpwN.AIMSICD.utils.Helpers; @@ -87,7 +90,7 @@ * [ ] App is blocked while downloading. * */ -public class RequestTask extends AsyncTask { +public class RequestTask extends BaseAsyncTask { //Calling from the menu more extensive(more difficult for sever), // we have to give more time for the server response @@ -105,14 +108,15 @@ public class RequestTask extends AsyncTask { public static final String mTAG = "RequestTask"; private final AIMSICDDbAdapter mDbAdapter; - private final Context mContext; + private final Context mAppContext; private final char mType; private int mTimeOut; public RequestTask(Context context, char type) { + super((Activity)context); mType = type; - mContext = context; - mDbAdapter = new AIMSICDDbAdapter(mContext); + mAppContext = context.getApplicationContext(); + mDbAdapter = new AIMSICDDbAdapter(mAppContext); mTimeOut = REQUEST_TIMEOUT_MAPS; } @@ -171,12 +175,13 @@ protected String doInBackground(String... commandString) { } return "Successful"; } else { - Helpers.msgLong(mContext, mContext.getString(R.string.no_data_for_publishing)); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.no_data_for_publishing)); return null; } } catch (Exception e) { Log.e(TAG, mTAG + ": Upload OpenCellID data Exception - " + e.getMessage()); + e.printStackTrace(); } // DOWNLOADING... @@ -203,13 +208,14 @@ protected String doInBackground(String... commandString) { if (urlConnection.getResponseCode() != 200) { try { String error = Helpers.convertStreamToString(urlConnection.getErrorStream()); - Helpers.msgLong(mContext, mContext.getString(R.string.download_error) + " " + error); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.download_error) + " " + error); Log.e(TAG, mTAG + ": Download OCID data error: " + error); } catch (Exception e) { - Helpers.msgLong(mContext, mContext.getString(R.string.download_error) + " " + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.download_error) + " " + e.getClass().getName() + " - " + e.getMessage()); Log.e(TAG, mTAG + ": Download OCID exception: " + e); + e.printStackTrace(); } return "Error"; } else { @@ -308,21 +314,21 @@ protected void onProgressUpdate(Integer... values) { protected void onPostExecute(String result) { super.onPostExecute(result); AIMSICD.mProgressBar.setProgress(0); - TinyDB tinydb = new TinyDB(mContext); + TinyDB tinydb = TinyDB.getInstance(); switch (mType) { case DBE_DOWNLOAD_REQUEST: if (result != null && result.equals("Successful")) { mDbAdapter.open(); if (mDbAdapter.updateOpenCellID()) { - Helpers.msgShort(mContext, mContext.getString(R.string.opencellid_data_successfully_received)); + Helpers.msgShort(mAppContext, mAppContext.getString(R.string.opencellid_data_successfully_received)); } mDbAdapter.checkDBe(); mDbAdapter.close(); tinydb.putBoolean("ocid_downloaded", true); } else { - Helpers.msgLong(mContext, mContext.getString(R.string.error_retrieving_opencellid_data)); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.error_retrieving_opencellid_data)); } break; @@ -331,31 +337,33 @@ protected void onPostExecute(String result) { mDbAdapter.open(); if (mDbAdapter.updateOpenCellID()) { Intent intent = new Intent(MapViewerOsmDroid.updateOpenCellIDMarkers); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - Helpers.msgShort(mContext, mContext.getString(R.string.opencellid_data_successfully_received_markers_updated)); + LocalBroadcastManager.getInstance(mAppContext).sendBroadcast(intent); + Helpers.msgShort(mAppContext, mAppContext.getString(R.string.opencellid_data_successfully_received_markers_updated)); mDbAdapter.checkDBe(); mDbAdapter.close(); tinydb.putBoolean("ocid_downloaded", true); } } else { - Helpers.msgLong(mContext, mContext.getString(R.string.error_retrieving_opencellid_data)); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.error_retrieving_opencellid_data)); } + showHideMapProgressBar(false); + TinyDB.getInstance().putBoolean(TinyDbKeys.FINISHED_LOAD_IN_MAP, true); break; case DBE_UPLOAD_REQUEST: if (result != null && result.equals("Successful")) { - Helpers.msgShort(mContext, mContext.getString(R.string.uploaded_bts_data_successfully)); + Helpers.msgShort(mAppContext, mAppContext.getString(R.string.uploaded_bts_data_successfully)); } else { - Helpers.msgLong(mContext, mContext.getString(R.string.error_uploading_bts_data)); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.error_uploading_bts_data)); } break; case RESTORE_DATABASE: if (result != null && result.equals("Successful")) { - Helpers.msgShort(mContext, mContext.getString(R.string.restore_database_completed)); + Helpers.msgShort(mAppContext, mAppContext.getString(R.string.restore_database_completed)); } else { - Helpers.msgLong(mContext, mContext.getString(R.string.error_restoring_database)); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.error_restoring_database)); } break; @@ -365,15 +373,50 @@ protected void onPostExecute(String result) { // strings.xml: pref_last_db_backup_version //tinydb.putInt(mContext.getString(R.string.pref_last_database_backup_version), AIMSICDDbAdapter.DATABASE_VERSION); //TODO tinydb.putInt("pref_last_db_backup_version", AIMSICDDbAdapter.DATABASE_VERSION); + Activity lActivity = getActivity(); - final AlertDialog.Builder builder = new AlertDialog.Builder(mContext); - builder.setTitle(R.string.database_export_successful).setMessage( - mContext.getString(R.string.database_backup_successfully_saved_to) + "\n" + AIMSICDDbAdapter.FOLDER); - builder.create().show(); + if(lActivity != null) {//Activity may be detached or destroyed + final AlertDialog.Builder builder = new AlertDialog.Builder(lActivity); + builder.setTitle(R.string.database_export_successful).setMessage( + lActivity.getString(R.string.database_backup_successfully_saved_to) + "\n" + AIMSICDDbAdapter.FOLDER); + builder.create().show(); + } } else { - Helpers.msgLong(mContext, mContext.getString(R.string.error_backing_up_data)); + Helpers.msgLong(mAppContext, mAppContext.getString(R.string.error_backing_up_data)); } //break; } } + + @Override + protected void onActivityDetached() { + if (mType == DBE_DOWNLOAD_REQUEST_FROM_MAP) { + showHideMapProgressBar(false); + } + } + + @Override + protected void onActivityAttached() { + if (mType == DBE_DOWNLOAD_REQUEST_FROM_MAP) { + showHideMapProgressBar(true); + } + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if (mType == DBE_DOWNLOAD_REQUEST_FROM_MAP) { + showHideMapProgressBar(false); + } + } + + private void showHideMapProgressBar(boolean pFlag) { + Activity lActivity = getActivity(); + if(BuildConfig.DEBUG && lActivity == null) { + Log.v(TAG, "BaseTask showHideMapProgressBar() activity is null"); + } + if (lActivity != null && lActivity instanceof MapViewerOsmDroid) { + ((MapViewerOsmDroid) lActivity).setRefreshActionButtonState(pFlag); + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java index abdef4ef6..539953201 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java @@ -48,9 +48,11 @@ * https://github.com/kcochibili/TinyDB--Android-Shared-Preferences-Turbo/ * * Usage: + * + * 1) * import com.SecUpwN.AIMSICD.utils.TinyDB; * ... - * TinyDB tinydb = new TinyDB(context); //Possibly mContext if already declared. + * TinyDB tinydb = TinyDB.getInstance(); //Possibly mContext if already declared in AppAIMSICD via method init(AppContext). * * tinydb.putInt("clickCount", 2); * tinydb.putFloat("xPoint", 3.6f); @@ -60,6 +62,14 @@ * tinydb.putList("MyUsers", mUsersArray); * tinydb.putImagePNG("DropBox/WorkImages", "MeAtlunch.png", lunchBitmap); * + * 2) + * import com.SecUpwN.AIMSICD.utils.TinyDB; + * ... + * TinyDB.getInstance().putInt("clickCount", 2); + * TinyDB.getInstance().putFloat("xPoint", 3.6f); + * + * and etc. + * * */ public class TinyDB { @@ -69,7 +79,9 @@ public class TinyDB { File mFolder = null; public static String lastImagePath = ""; - public TinyDB(Context appContext) { + private TinyDB() {} + + public void init(Context appContext) { mContext = appContext; preferences = PreferenceManager.getDefaultSharedPreferences(mContext); } @@ -373,5 +385,13 @@ public void unregisterOnSharedPreferenceChangeListener(SharedPreferences.OnShare preferences.unregisterOnSharedPreferenceChangeListener(listener); } + private static class InstanceHolder { + private static final TinyDB INSTANCE = new TinyDB(); + } + + public static TinyDB getInstance() { + return InstanceHolder.INSTANCE; + } + } diff --git a/app/src/main/res/layout/actionbar_indeterminate_progress.xml b/app/src/main/res/layout/actionbar_indeterminate_progress.xml new file mode 100644 index 000000000..59791314b --- /dev/null +++ b/app/src/main/res/layout/actionbar_indeterminate_progress.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file From 2f169977b24fae726b6ad9dbb55f2bf78903c8c4 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Sun, 3 May 2015 21:44:21 +0300 Subject: [PATCH 04/27] Adapter of spinner has been added; The switch statement has been returned; --- .../adapters/DbViewerSpinnerAdapter.java | 94 ++++++ .../Holders/ViewTableNameSpinnerHolder.java | 10 + .../SecUpwN/AIMSICD/constants/DrawerMenu.java | 16 + .../SecUpwN/AIMSICD/constants/Examples.java | 16 + .../SecUpwN/AIMSICD/enums/StatesDbViewer.java | 74 ++++ .../AIMSICD/fragments/DbViewerFragment.java | 318 ++++++++++-------- .../res/layout/item_spinner_db_viewer.xml | 20 ++ 7 files changed, 401 insertions(+), 147 deletions(-) create mode 100644 app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java create mode 100644 app/src/main/java/com/SecUpwN/AIMSICD/adapters/Holders/ViewTableNameSpinnerHolder.java create mode 100644 app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java create mode 100644 app/src/main/res/layout/item_spinner_db_viewer.xml diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java new file mode 100644 index 000000000..c39d2d6e8 --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java @@ -0,0 +1,94 @@ +/* Android IMSI Catcher Detector + * Copyright (C) 2015 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You may obtain a copy of the License at + * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE + */ +package com.SecUpwN.AIMSICD.adapters; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.TextView; + +import com.SecUpwN.AIMSICD.R; +import com.SecUpwN.AIMSICD.adapters.Holders.ViewTableNameSpinnerHolder; +import com.SecUpwN.AIMSICD.enums.StatesDbViewer; + +import java.util.ArrayList; + +public class DbViewerSpinnerAdapter extends ArrayAdapter { + + public DbViewerSpinnerAdapter(Context pContext, int pResource) { + super(pContext, pResource); + mDataList = StatesDbViewer.getStates(); + } + + ArrayList mDataList; + + + @Override + public View getView(int pPosition, View pConvertView, ViewGroup pParent) { + + View lView = pConvertView; + ViewTableNameSpinnerHolder lHolder; + if (lView == null + || (lView.getId() != R.id.item_root_layout && !(lView.getTag() instanceof ViewTableNameSpinnerHolder))) { + + lView = ((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate( + R.layout.item_spinner_db_viewer, pParent, false); + lHolder = setViewHolderToView(lView); + + } else { + lHolder = (ViewTableNameSpinnerHolder) lView.getTag(); + + } + + StatesDbViewer lEntry = mDataList.get(pPosition); + lHolder.name.setText(lEntry.getDisplayName(getContext())); + + return lView; + } + + + @Override + public View getDropDownView(int pPosition, View pConvertView, ViewGroup pParent) { + return getView(pPosition, pConvertView, pParent); + } + + + @Override + public StatesDbViewer getItem(int position) { + return mDataList.get(position); + } + + + private ViewTableNameSpinnerHolder setViewHolderToView(View pView) { + ViewTableNameSpinnerHolder lHolder; + lHolder = new ViewTableNameSpinnerHolder(); + + lHolder.name = (TextView) pView.findViewById(R.id.item_name); + + pView.setTag(lHolder); + return lHolder; + } + + + @Override + public int getCount() { + return mDataList.size(); + } + +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/adapters/Holders/ViewTableNameSpinnerHolder.java b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/Holders/ViewTableNameSpinnerHolder.java new file mode 100644 index 000000000..5a7c680b5 --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/Holders/ViewTableNameSpinnerHolder.java @@ -0,0 +1,10 @@ +package com.SecUpwN.AIMSICD.adapters.Holders; + + +import android.widget.TextView; + +public class ViewTableNameSpinnerHolder { + + public TextView name; + +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java b/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java index cf8fa9ecf..bec027f64 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java @@ -1,3 +1,19 @@ +/* Android IMSI Catcher Detector + * Copyright (C) 2015 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You may obtain a copy of the License at + * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE + */ package com.SecUpwN.AIMSICD.constants; /** diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java b/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java index 0869593d6..d72cf3467 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java @@ -1,3 +1,19 @@ +/* Android IMSI Catcher Detector + * Copyright (C) 2015 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You may obtain a copy of the License at + * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE + */ package com.SecUpwN.AIMSICD.constants; /** diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java b/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java new file mode 100644 index 000000000..88614da15 --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java @@ -0,0 +1,74 @@ +/* Android IMSI Catcher Detector + * Copyright (C) 2015 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You may obtain a copy of the License at + * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE + */ +package com.SecUpwN.AIMSICD.enums; + + +import android.content.Context; + + +import com.SecUpwN.AIMSICD.R; + +import java.util.ArrayList; +import java.util.Arrays; + + +public enum StatesDbViewer { + + UNIQUE_BTS_DATA(R.string.unique_bts_data), + BTS_MEASUREMENTS(R.string.bts_measurements), + IMPORTED_OCID_DATA(R.string.imported_ocid_data), + DEFAULT_MCC_LOCATIONS(R.string.default_mmc_locations), + SILENT_SMS(R.string.silent_sms), + MEASURED_SIGNAL_STRENGTHS(R.string.measured_signal_strengths), + EVENT_LOG(R.string.eventlog); + //TODO DetectionFlags + // DETECTION_FLAGS(R.string.detection_flags) + + private final int mStatementValue; + + StatesDbViewer(int pStatementValue) { + mStatementValue = pStatementValue; + } + + public int getStatementValue() { + return mStatementValue; + } + + + public static ArrayList getStates() { + return new ArrayList<>(Arrays.asList(values())); + } + + public static StatesDbViewer getValueByOrdinal(int pOrdinal) { + StatesDbViewer lResult = null; + for (StatesDbViewer item : values()) { + if (item.ordinal() == pOrdinal) { + lResult = item; + break; + } + } + return lResult; + } + + public String getDisplayName(Context pContext) { + if (pContext == null) { + return null; + } + return pContext.getString(getStatementValue()); + } + +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DbViewerFragment.java b/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DbViewerFragment.java index 65b514830..c87e82c70 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DbViewerFragment.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DbViewerFragment.java @@ -19,6 +19,7 @@ import com.SecUpwN.AIMSICD.adapters.BaseInflaterAdapter; import com.SecUpwN.AIMSICD.adapters.CardItemData; import com.SecUpwN.AIMSICD.adapters.CellCardInflater; +import com.SecUpwN.AIMSICD.adapters.DbViewerSpinnerAdapter; import com.SecUpwN.AIMSICD.adapters.DefaultLocationCardInflater; import com.SecUpwN.AIMSICD.adapters.EventLogCardInflater; import com.SecUpwN.AIMSICD.adapters.EventLogItemData; @@ -28,11 +29,12 @@ import com.SecUpwN.AIMSICD.adapters.SilentSmsCardData; import com.SecUpwN.AIMSICD.adapters.SilentSmsCardInflater; import com.SecUpwN.AIMSICD.constants.Examples; +import com.SecUpwN.AIMSICD.enums.StatesDbViewer; public class DbViewerFragment extends Fragment { private AIMSICDDbAdapter mDb; - private String mTableSelected; + private StatesDbViewer mTableSelected; private boolean mMadeSelection; private Context mContext; @@ -61,6 +63,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa emptyView = view.findViewById(R.id.db_list_empty); tblSpinner = (Spinner) view.findViewById(R.id.table_spinner); + DbViewerSpinnerAdapter mSpinnerAdapter = new DbViewerSpinnerAdapter(getActivity(), R.layout.item_spinner_db_viewer); + tblSpinner.setAdapter(mSpinnerAdapter); tblSpinner.setOnItemSelectedListener(new spinnerListener()); Button loadTable = (Button) view.findViewById(R.id.load_table_data); @@ -75,7 +79,7 @@ private class spinnerListener implements AdapterView.OnItemSelectedListener { @Override public void onItemSelected(AdapterView parentView, View selectedItemView, int position, long id) { - mTableSelected = String.valueOf(tblSpinner.getSelectedItem()); + mTableSelected = (StatesDbViewer)tblSpinner.getSelectedItem(); mMadeSelection = true; } @@ -104,40 +108,54 @@ public void onClick(final View v) { @Override protected BaseInflaterAdapter doInBackground(Void... params) { mDb.open(); - Cursor result = null; + Cursor result; //TODO Table: "DetectionFlags" - //case "DetectionFlags": + //case DETECTION_FLAGS: //result = mDb.getDetectionFlagsData(); + switch (mTableSelected) { + + case UNIQUE_BTS_DATA: + // The unique BTSs we have been connected to in the past + // EVA: Was "Cell Data" // Table: cellinfo + // ToBe: "DBi_bts" + result = mDb.getCellData(); + break; + + case BTS_MEASUREMENTS: + // All BTS measurements we have done since start + // EVA: Was "Location Data" // Table: locationinfo + // ToBe: "DBi_measure" + result = mDb.getLocationData(); + break; + + case IMPORTED_OCID_DATA: + // EVA: Was "OpenCellID Data" // Table: opencellid + // ToBe: "DBe_import" + result = mDb.getOpenCellIDData(); + break; + + case DEFAULT_MCC_LOCATIONS: + result = mDb.getDefaultMccLocationData(); + break; + + case SILENT_SMS: + result = mDb.getSilentSmsData(); + break; + + case MEASURED_SIGNAL_STRENGTHS: + // ToBe merged into "DBi_measure:rx_signal" + result = mDb.getSignalStrengthMeasurementData(); + break; + case EVENT_LOG: + // Table: "EventLog" + result = mDb.getEventLogData(); + break; - if(getString(R.string.unique_bts_data).equalsIgnoreCase(mTableSelected)) { - // The unique BTSs we have been connected to in the past - // EVA: Was "Cell Data" // Table: cellinfo - // ToBe: "DBi_bts" - - result = mDb.getCellData(); - } else if(getString(R.string.bts_measurements).equalsIgnoreCase(mTableSelected)) { - // All BTS measurements we have done since start - // EVA: Was "Location Data" // Table: locationinfo - // ToBe: "DBi_measure" - result = mDb.getLocationData(); - } else if(getString(R.string.imported_ocid_data).equalsIgnoreCase(mTableSelected)) { - // EVA: Was "OpenCellID Data" // Table: opencellid - // ToBe: "DBe_import" - result = mDb.getOpenCellIDData(); - } else if(getString(R.string.default_mmc_locations).equalsIgnoreCase(mTableSelected)) { - result = mDb.getDefaultMccLocationData(); - } else if(getString(R.string.silent_sms).equalsIgnoreCase(mTableSelected)) { - result = mDb.getSilentSmsData(); - } else if(getString(R.string.measured_signal_strengths).equalsIgnoreCase(mTableSelected)) { - // ToBe merged into "DBi_measure:rx_signal" - result = mDb.getSignalStrengthMeasurementData(); - } else if(getString(R.string.eventlog).equalsIgnoreCase(mTableSelected)) { - // Table: "EventLog" - result = mDb.getEventLogData(); + default: + throw new IllegalArgumentException("Unknown type of table"); } - BaseInflaterAdapter adapter = null; if (result != null) { adapter = BuildTable(result); @@ -189,7 +207,8 @@ protected void onPostExecute(BaseInflaterAdapter adapter) { */ private BaseInflaterAdapter BuildTable(Cursor tableData) { if (tableData != null && tableData.getCount() > 0) { - if (getString(R.string.imported_ocid_data).equalsIgnoreCase(mTableSelected)) { + switch (mTableSelected) { + case IMPORTED_OCID_DATA: { /* * Table: DBi_import * @@ -204,122 +223,127 @@ private BaseInflaterAdapter BuildTable(Cursor tableData) { * Thus for OCID data we cannot use: time_first or time_last. * */ - // Table: DBe_import - - BaseInflaterAdapter adapter - = new BaseInflaterAdapter<>(new OpenCellIdCardInflater()); - int count = tableData.getCount(); - while (tableData.moveToNext()) { - // The getString(i) index refer to the table column in the "DBe_import" table - // OLD opencellid(i) // New "DBe_import" column name - CardItemData data = new CardItemData( - //"Source: " + tableData.getString(0), // DBsource - //"RAT: " + tableData.getString(0), // RAT - "CID: " + tableData.getString(0), // - "LAC: " + tableData.getString(1), // - "MCC: " + tableData.getString(2), // - "MNC: " + tableData.getString(3), // - //"PSC: " + tableData.getString(7), // PSC - "Lat: " + tableData.getString(4), // gps_lat - "Lon: " + tableData.getString(5), // gps_lon - //"isExact: " + tableData.getString(7), // isGPSexact - //"Range: " + tableData.getString(7), // avg_range // - "AvgSignal: " + tableData.getString(6), // avg_signal - "Samples: " + tableData.getString(7), // samples // NOTE: #7 is range from ocid csv - //"first: " + tableData.getString(7), // time_first - //"last: " + tableData.getString(7), // time_last - //"reject: " + tableData.getString(7), // rej_cause - "" + (tableData.getPosition() + 1) + " / " + count); - adapter.addItem(data, false); - } - if (!tableData.isClosed()) { - tableData.close(); - } - return adapter; - } else if (getString(R.string.default_mmc_locations).equalsIgnoreCase(mTableSelected)) { - - // Table: defaultlocation - BaseInflaterAdapter adapter - = new BaseInflaterAdapter<>(new DefaultLocationCardInflater()); - int count = tableData.getCount(); - while (tableData.moveToNext()) { - CardItemData data = new CardItemData( - "Country: " + tableData.getString(0),// Country --> country - "MCC: " + tableData.getString(1), // Mcc --> MCC - "Lat: " + tableData.getString(2), // Lat --> lat - "Lon: " + tableData.getString(3), // Lng --> lon - "" + (tableData.getPosition() + 1) + " / " + count); - adapter.addItem(data, false); - } - if (!tableData.isClosed()) { - tableData.close(); - } - return adapter; - } else if (getString(R.string.silent_sms).equalsIgnoreCase(mTableSelected)) { - // Table: silentsms - BaseInflaterAdapter adapter - = new BaseInflaterAdapter<>(new SilentSmsCardInflater()); - //int count = tableData.getCount(); - while (tableData.moveToNext()) { - SilentSmsCardData data = new SilentSmsCardData( - tableData.getString(0), // Address - tableData.getString(1), // Display - tableData.getString(2), // Class - tableData.getString(3), // ServiceCtr - tableData.getString(4), // Message - tableData.getLong(5)); // Timestamp - //"" + (tableData.getPosition() + 1) + " / " + count); - data.setIsFakeData(isExample(data)); - adapter.addItem(data, false); - } - if (!tableData.isClosed()) { - tableData.close(); + // Table: DBe_import + + BaseInflaterAdapter adapter + = new BaseInflaterAdapter<>(new OpenCellIdCardInflater()); + int count = tableData.getCount(); + while (tableData.moveToNext()) { + // The getString(i) index refer to the table column in the "DBe_import" table + // OLD opencellid(i) // New "DBe_import" column name + CardItemData data = new CardItemData( + //"Source: " + tableData.getString(0), // DBsource + //"RAT: " + tableData.getString(0), // RAT + "CID: " + tableData.getString(0), // + "LAC: " + tableData.getString(1), // + "MCC: " + tableData.getString(2), // + "MNC: " + tableData.getString(3), // + //"PSC: " + tableData.getString(7), // PSC + "Lat: " + tableData.getString(4), // gps_lat + "Lon: " + tableData.getString(5), // gps_lon + //"isExact: " + tableData.getString(7), // isGPSexact + //"Range: " + tableData.getString(7), // avg_range // + "AvgSignal: " + tableData.getString(6), // avg_signal + "Samples: " + tableData.getString(7), // samples // NOTE: #7 is range from ocid csv + //"first: " + tableData.getString(7), // time_first + //"last: " + tableData.getString(7), // time_last + //"reject: " + tableData.getString(7), // rej_cause + "" + (tableData.getPosition() + 1) + " / " + count); + adapter.addItem(data, false); + } + if (!tableData.isClosed()) { + tableData.close(); + } + return adapter; } - return adapter; - } else if (getString(R.string.measured_signal_strengths).equalsIgnoreCase(mTableSelected)) { - // ToDo: merge into "DBi_measure:rx_signal" - BaseInflaterAdapter adapter - = new BaseInflaterAdapter<>(new MeasuredCellStrengthCardInflater()); - //int count = tableData.getCount(); - while (tableData.moveToNext()) { - MeasuredCellStrengthCardData data = new MeasuredCellStrengthCardData( - tableData.getInt(0), - tableData.getInt(1), - tableData.getLong(2)); - //"" + (tableData.getPosition() + 1) + " / " + count); - adapter.addItem(data, false); + case DEFAULT_MCC_LOCATIONS: { + + // Table: defaultlocation + BaseInflaterAdapter adapter + = new BaseInflaterAdapter<>(new DefaultLocationCardInflater()); + int count = tableData.getCount(); + while (tableData.moveToNext()) { + CardItemData data = new CardItemData( + "Country: " + tableData.getString(0),// Country --> country + "MCC: " + tableData.getString(1), // Mcc --> MCC + "Lat: " + tableData.getString(2), // Lat --> lat + "Lon: " + tableData.getString(3), // Lng --> lon + "" + (tableData.getPosition() + 1) + " / " + count); + adapter.addItem(data, false); + } + if (!tableData.isClosed()) { + tableData.close(); + } + return adapter; } - if (!tableData.isClosed()) { - tableData.close(); + case SILENT_SMS: { + // Table: silentsms + BaseInflaterAdapter adapter + = new BaseInflaterAdapter<>(new SilentSmsCardInflater()); + //int count = tableData.getCount(); + while (tableData.moveToNext()) { + SilentSmsCardData data = new SilentSmsCardData( + tableData.getString(0), // Address + tableData.getString(1), // Display + tableData.getString(2), // Class + tableData.getString(3), // ServiceCtr + tableData.getString(4), // Message + tableData.getLong(5)); // Timestamp + //"" + (tableData.getPosition() + 1) + " / " + count); + data.setIsFakeData(isExample(data)); + adapter.addItem(data, false); + } + if (!tableData.isClosed()) { + tableData.close(); + } + return adapter; } - return adapter; - } else if (getString(R.string.eventlog).equalsIgnoreCase(mTableSelected)) { - - // Table: EventLog - // Where: Table is displayed with EventLogCardInflater and EventLogItemData - BaseInflaterAdapter adapter - = new BaseInflaterAdapter<>(new EventLogCardInflater()); - - int count = tableData.getCount(); - while (tableData.moveToNext()) { - EventLogItemData data = new EventLogItemData( - "Time: " + tableData.getString(0), // time - "LAC: " + tableData.getInt(1), // LAC - "CID: " + tableData.getInt(2), // CID - "PSC: " + tableData.getInt(3), // PSC - "Lat: " + tableData.getDouble(4), // gpsd_lat - "Lon: " + tableData.getDouble(5), // gpsd_lon - "Accuracy: " + tableData.getInt(6), // gpsd_accu (accuracy in [m]) - "DetID: " + tableData.getInt(7), // DF_id - "Event: " + tableData.getString(8), // DF_desc - "" + (tableData.getPosition() + 1) + " / " + count); - data.setIsFakeData(isExample(data)); - adapter.addItem(data, false); + case MEASURED_SIGNAL_STRENGTHS: { + // ToDo: merge into "DBi_measure:rx_signal" + BaseInflaterAdapter adapter + = new BaseInflaterAdapter<>(new MeasuredCellStrengthCardInflater()); + //int count = tableData.getCount(); + while (tableData.moveToNext()) { + MeasuredCellStrengthCardData data = new MeasuredCellStrengthCardData( + tableData.getInt(0), + tableData.getInt(1), + tableData.getLong(2)); + //"" + (tableData.getPosition() + 1) + " / " + count); + adapter.addItem(data, false); + } + if (!tableData.isClosed()) { + tableData.close(); + } + return adapter; } - if (!tableData.isClosed()) { - tableData.close(); + case EVENT_LOG: { + + // Table: EventLog + // Where: Table is displayed with EventLogCardInflater and EventLogItemData + BaseInflaterAdapter adapter + = new BaseInflaterAdapter<>(new EventLogCardInflater()); + + int count = tableData.getCount(); + while (tableData.moveToNext()) { + EventLogItemData data = new EventLogItemData( + "Time: " + tableData.getString(0), // time + "LAC: " + tableData.getInt(1), // LAC + "CID: " + tableData.getInt(2), // CID + "PSC: " + tableData.getInt(3), // PSC + "Lat: " + tableData.getDouble(4), // gpsd_lat + "Lon: " + tableData.getDouble(5), // gpsd_lon + "Accuracy: " + tableData.getInt(6), // gpsd_accu (accuracy in [m]) + "DetID: " + tableData.getInt(7), // DF_id + "Event: " + tableData.getString(8), // DF_desc + "" + (tableData.getPosition() + 1) + " / " + count); + data.setIsFakeData(isExample(data)); + adapter.addItem(data, false); + } + if (!tableData.isClosed()) { + tableData.close(); + } + return adapter; } - return adapter; /* // Table: EventLog case "EventLog Data": { @@ -342,8 +366,8 @@ private BaseInflaterAdapter BuildTable(Cursor tableData) { } return adapter; } -*/ -/* + */ + /* // Maybe we can skip this one? // Table: DetectionFlags case "DetectionFlags Data": { @@ -436,7 +460,7 @@ private BaseInflaterAdapter BuildTable(Cursor tableData) { } return adapter; } -*/ + */ /** * TODO: @@ -449,7 +473,7 @@ private BaseInflaterAdapter BuildTable(Cursor tableData) { * * Once implemented, remove this or make different default. */ - } else { + default: BaseInflaterAdapter adapter = new BaseInflaterAdapter<>( new CellCardInflater() ); int count = tableData.getCount(); @@ -468,7 +492,7 @@ private BaseInflaterAdapter BuildTable(Cursor tableData) { tableData.close(); } return adapter; - } + } } else { return null; } diff --git a/app/src/main/res/layout/item_spinner_db_viewer.xml b/app/src/main/res/layout/item_spinner_db_viewer.xml new file mode 100644 index 000000000..6d5340521 --- /dev/null +++ b/app/src/main/res/layout/item_spinner_db_viewer.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file From 2f947cc0f1927f1cadcb5415c0a3d72716801fa6 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Mon, 4 May 2015 04:19:41 +0300 Subject: [PATCH 05/27] Translation into Russian has been improved Version of app has been increased --- app/src/main/AndroidManifest.xml | 2 +- .../res/values-ru/translatable_strings.xml | 62 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2cb61cdec..a7fb14d81 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="0.1.26-alpha-b02"> Подробное описание - App is idling or loading. No protection and detection measures are enabled. Please open the Navigation Drawer and enable them in section TRACKING. - No threats detected or found. Our App is constantly checking your network based upon the protection measures you\'ve set in the Navigation Drawer and Preferences. - Insecure Service Area: At least 1 new or unknown BTS is in operation in this vicinity, or using an insecure (broken) encryption algorithm lower than A5/3 [Detection is WIP]. Expect that any phone calls/SMS made in this area can be intercepted and recorded. You better leave this place now. - Hostile Service Actions Detected: An IMSI-Catcher (IMSIC) or fake BTS (FBTS) is actively tracking users. Active scanning takes place in this area. You should avoid this place, especially if there are political unrest. Take out your battery or kill your phone. - Hostile Tracking Detected: An FBTS or IMSIC is actively tracking YOU and preventing your phone from connecting through your normal encrypted mobile provider. If you\'re in danger or repercussions, destroy your phone + SIM and report it as recently stolen. - Hostile Manipulation: Someone is trying to remotely manipulate your handset. Destroy (or sell) your phone and get a new one somewhere far away (don\'t carry your old phone to the changing place). Use a new (anonymous) SIM card, change calling behavior and warn your friends by talking to them in real life, NOT by calling them. - - Cancel + Приложение работает в режиме ожидания или загрузки. Меры защиты и обнаружения не включены. Пожалуйста, откройте меню и включите их в разделе СЛЕЖЕНИЕ. + Никакие угрозы не обнаружены. Наше приложение постоянно проверять вашу сеть на основе мер защиты, которые вы установили в меню и настройках. + Небезопасная зона обслуживания: По крайней мере, 1 новая или неизвестная БС в эксплуатации в этом районе, или с использованием небезопасного (сломанного) алгоритма шифрования меньшего, чем A5 / 3 [Обнаружение WIP]. Ожидайте, что любые телефонные звонки / SMS, сделанные в этой области могут быть перехвачены и зарегистрированы. Вам лучше оставить это место сейчас. + Враждебные действия обнаружены: IMSI-Перехватчик (IMSIC) или поддельные BTS (FBTS) активно отслеживают пользователей. Активное сканирование происходит в этой области. Вы должны избегать этого места, особенно, если есть политическая нестабильность. Выньте батарею или уничтожьте свой телефон. + Враждебные отслеживания обнаружены: FBTS или IMSIC активно отслеживают вас и предотвращают ваш телефон от подключения через обычную зашифрованную мобильную связь. Если вы находитесь в опасности, сломайте ваш телефон + SIM и сообщите, что ваш телефон недавно был украден. + Враждебные манипуляции: Кто-то пытается удаленно управлять вашим телефоном. Уничтожьте (или продайте) свой телефон и возьмите новый где-то подальше (не носите свой старый телефон с собой). Используйте новую (анонимную) SIM-карту, измените поведение вызовов и предупредите своих друзей, разговаривая с ними в реальной жизни, НЕ звоня им. + + Отмена OK @@ -236,17 +236,17 @@ 30 сек 10 мин Главное - Настройки приложения + Настройки Приложение - Monitoring Cell Information. - Stopped monitoring Cell Information. - Tracking Cell Information. - Stopped tracking Cell Information. - Only one new API key request per 24 hours!\nPlease try again later. - Cell ID does not exist in OpenCellID Database! - Hostile Service Area: Changing LAC Detected! - FemtoCell Detection Active. - Cell Tracking Active. + Мониторинг сотовой информации. + Мониторинг сотовой информации остановлен. + Отслеживания данных сотового. + Отслеживания данных сотового остановлена. + Только один запрос нового ключа API за 24 часа!\nПожалуйста, повторите попытку позже. + ID соты не существует в базе данных OpenCellID! + Враждебная зона обслуживания: Изменение LAC обнаружено! + Обнаружение фемтосот активно. + Отслеживание активной сотовой ячейки. Cell Monitoring Active. Тип телефона - Статус: Неработающий. @@ -261,25 +261,25 @@ Обновлять каждые Обновить сейчас… секунд. - Обращение к данным OpenCellID…\nThis may take up to a minute. + Обращение к данным OpenCellID…\nЭто может занять до минуты. Невозможно определить ваш последнее место.\nВключите сервис определения координат и попробуйте еще раз. Не найдено отслеживаемых мест, чтобы показать их на карте. Нет доступных данных для публикации. Ошибка загрузки: - OpenCellID data successfully received. - Error retrieving OpenCellID data.\nCheck your network! - OpenCellID data successfully received.\nMap Markers updated. - Uploaded BTS data to OCID successfully. - Error in uploading BTS data to OCID servers! + Данные OpenCellID успешно приняты. + Ошибка при получении данных OpenCellID.\nПроверьте вашу сеть! + Данные OpenCellID успешно приняты.\nМаркеры карты обновлены. + Данные BTS для OCID выгружены успешно. + Ошибка при выгрузке данных BTS для OCID серверов! Восстановление базы данных успешно завершено. Ошибка восстановления базы данных. - Database backup successfully saved to: - Error backing up database. + Резервная копия базы данных успешна сохранена в: + Ошибка резервного копирования базы данных. No OpenCellID API Key detected!\nPlease enter your key in settings first. - Refreshing display - Unable to acquire ROOT access on your device.\nAT Command Injection requires ROOT Terminal access.\nPlease check your device is ROOTED and try again - Unable to detect Busybox on your device.\nAT Command Injection requires Busybox components to function correctly.\nPlease check your device has Busybox installed and try again - An unknown error has occurred trying to acquire the Serial Device.\nPlease check your logcat for any errors and post them to Github\nor XDA, links to both of these locations can be found within the\nAbout section of the application. + Обновление дисплея + Невозможно получить ROOT доступ на вашем устройстве.\nДля инъекций AT-команд в терминал требуется ROOT доступ.\nПожалуйста, проверьте наличие ROOT прав на вашем устройстве и попробуйте еще раз + Невозможно обнаружить Busybox на вашем устройстве.\nДля инъекций AT-команд в терминал требуются компоненты Busybox для правильного функционирования.\nПожалуйста, проверьте, что Busybox установлен на ваше устройство и попробуйте снова + Произошла неизвестная ошибка при попытке достижения Serial Device.\nПожалуйста, проверьте LogCat на возможные ошибки и отправьте их на Github\nили XDA, ссылки на оба этих места можно найти в \nсекции "О программе" приложения. An unknown error has occurred trying to initialise the AT Command Injector.\nPlease check your logcat for any errors and post them to Github or\nXDA, links to both of these locations can be found within the\nAbout section of the application. Получение ключа API OpenCellID… Невозможно создать карту! From 22c85563f450bb6208d4376ad81cc4787dfa5089 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Mon, 4 May 2015 04:42:14 +0300 Subject: [PATCH 06/27] Trying to increase the version of the support library Changed the way to https instead of http for gradle --- app/build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 81fa7e09a..db3d30203 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -128,7 +128,7 @@ dependencies { // compile 'com.github.amlcurran.showcaseview:library:5.0.0' compile fileTree(dir: 'libs', include: '*.jar') compile project(':third_party:rootshell') - compile 'com.android.support:support-v4:19.1.0' + compile 'com.android.support:support-v4:22.1.1' compile 'org.osmdroid:osmdroid-android:4.2' //https://github.com/lp0/slf4j-android compile 'org.slf4j:slf4j-api:1.7.12' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1dbbefec..c113e1841 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip From f953907d3261594ab64a74459aa6ab1e2384b0b9 Mon Sep 17 00:00:00 2001 From: SecUpwN Date: Mon, 4 May 2015 10:55:29 +0200 Subject: [PATCH 07/27] Added green checkmark to fix #404 --- app/src/main/res/drawable-hdpi/track_cell.png | Bin 1350 -> 667 bytes app/src/main/res/drawable-ldpi/track_cell.png | Bin 1185 -> 667 bytes app/src/main/res/drawable-mdpi/track_cell.png | Bin 1350 -> 667 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/app/src/main/res/drawable-hdpi/track_cell.png b/app/src/main/res/drawable-hdpi/track_cell.png index e12cd28a208f9f2aa561c82934dad5f4d30bf131..69c019e142f535ae0761e380bcb2aa5d259612d1 100644 GIT binary patch delta 643 zcmV-}0(||(3Y!IxBYy!PP)t-sVPIhF>g#rOb!1doaBXg7Wo2w^Y;I?1Y-wuk?d^4S zb!uvAb#--dadCozf^&0oii(PVe}8XpZ{_9Xj*gCZcXw)PYB?MvadB~wkdX5%ZFzZl z=}mx`n3$THn%gI0-2_X(06(3boqc_M>s5xGot>GPnUa!{tADGjtgNim3QYd~{^2lc z!^6Xok&)E{Nri=l-2+R_078|OmFomh-&TWoczDtTN6QgT^HGPOprFFS!nnA&+dOgJ zJaYg4|NZ^_`uh6q?d|FVQ1I~Zgwvn#l`RgQu6Zh-rnBV*VoX{ z(8|inyu7^T=6~j=r>CN#qTc{Y+W|?kva-R!!Izhp*dSfx0!`xrOt!YRHva(s|NpZ@ z^U(kR00DGTPE!Ct=GbNc0004EOGiWihy@);0003TNklU+68?&g#H6{fC#o8_`Xy_@X1_?PXEX@i4lsu6p6KnyY z&IDdSfPCSQXbS}LwHCO5%!C73LSqU}C?X*N9g>R1j)XtK2ykTEk{B9qa!WygBykuM z$R5(ea|D7C*AAM)rPrhcrK2v*T24CTkq)bPKgM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#>&wf_;NalZ z)z# z-2VRlnVFgP_V%BjpSiiY-rnBz_4VD|-NM4cJva+eEsqgRa z;Nalz@9&zLn$^|S-rnA+si_?u9n;g(|NsB~{{HRl?d0U-+S=O5$;tBa^6Kj9zrVlE z&d!e7cX|K-0AO@dPE!B@0RjaE0|N>I2nhWW4-5hg1PI<01OoBnI~xq~=pP9F=H;=h zNj@bZ76$tE@8j3Y%E`#Ynw5ufXh}UcH8LzJClc}S>geX$*V4|-&C18d#iys0iHL-E zZ(v&)4-Cv_^7@~_42Yd7$ zn+h2AC}}!68#k zsXKi!8O%PI`XZV7`b=&UG9d`wnU*D8PNq(sIPvONHQP!{8xhDKbtHsiSn}(+c&h5w z zO@ZctWv+*JB@cviaUQzOtg*&qc0(Zy6Eo#Ff6hskJ8{5n5g{}XOB?}Koh9Ruy%8@T zZ6?0Xu$z5D*qXYKuz$EiRA_@d!v`P-Z-;*YMq4>(2N8XA00000NkvXXu0mjf@F;2% diff --git a/app/src/main/res/drawable-mdpi/track_cell.png b/app/src/main/res/drawable-mdpi/track_cell.png index e12cd28a208f9f2aa561c82934dad5f4d30bf131..69c019e142f535ae0761e380bcb2aa5d259612d1 100644 GIT binary patch delta 643 zcmV-}0(||(3Y!IxBYy!PP)t-sVPIhF>g#rOb!1doaBXg7Wo2w^Y;I?1Y-wuk?d^4S zb!uvAb#--dadCozf^&0oii(PVe}8XpZ{_9Xj*gCZcXw)PYB?MvadB~wkdX5%ZFzZl z=}mx`n3$THn%gI0-2_X(06(3boqc_M>s5xGot>GPnUa!{tADGjtgNim3QYd~{^2lc z!^6Xok&)E{Nri=l-2+R_078|OmFomh-&TWoczDtTN6QgT^HGPOprFFS!nnA&+dOgJ zJaYg4|NZ^_`uh6q?d|FVQ1I~Zgwvn#l`RgQu6Zh-rnBV*VoX{ z(8|inyu7^T=6~j=r>CN#qTc{Y+W|?kva-R!!Izhp*dSfx0!`xrOt!YRHva(s|NpZ@ z^U(kR00DGTPE!Ct=GbNc0004EOGiWihy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mIfLQVO z77s=Mu^qhsD(w`H%Mup_-j_>4rLmvLihqC*>gvWNHIEP?khVCT6-ZXN`D)uypL&{- zzr5~I{%Imns4}J0W4Br!eYQG0+mv^0iXDms_sZrqK*NpB81fSe5d;$4r#KfIR%DL1SV(^p& z(aWw}BubWu0^Aw`wKoYNG1wG1LWmzqd6EHgDJ`n^Cf_1}jU}s~i6b3eASQjZC{J31 zbhT@f0tJBEbE$dYG|x&|lH}G2V}GBrw0Tsp_;so_E&@Q5BL+K4FBj!wjw*nx5Q4q` zmEpP}N0@0lOX54c6s6c_4n{DQcYaSaMW~VzlM$XWB8iBK!S5n8_H%1ZVl=ZhBXf)~ zaQdP5x2%lQfG`E-tYUa(4p=w$5WEY07X*Odi8Bz=KH2+1JlC6Vvp?)D|1J0M9)Le0 qfQRPBhsH<4-@_}|bpfjX65jxF=|@^3?j{BR0000 Date: Mon, 4 May 2015 12:47:03 +0000 Subject: [PATCH 08/27] Added AppCompat library for healing @Buildozer --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle b/app/build.gradle index db3d30203..e3b051cee 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -129,6 +129,7 @@ dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile project(':third_party:rootshell') compile 'com.android.support:support-v4:22.1.1' + compile 'com.android.support:appcompat-v7:22.1.1' compile 'org.osmdroid:osmdroid-android:4.2' //https://github.com/lp0/slf4j-android compile 'org.slf4j:slf4j-api:1.7.12' From b00d6a7a00a5699f8d3c7cebc5fb6b30c4644bb7 Mon Sep 17 00:00:00 2001 From: "Security: Pwned." Date: Mon, 4 May 2015 13:36:20 +0000 Subject: [PATCH 09/27] Synced buildToolsVersion with dependencies --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index e3b051cee..57747250f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,7 +39,7 @@ def getManifestVersionName() { android { compileSdkVersion 19 - buildToolsVersion '21.1.2' + buildToolsVersion '22.0.1' defaultConfig { minSdkVersion 16 From f0e7bffa6fb6d79c6a077694773229829a8f800b Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Mon, 4 May 2015 22:04:07 +0300 Subject: [PATCH 10/27] compileSdkVersion and targetSdkVersion versions were increased --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 57747250f..71f2c47f2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,12 +38,12 @@ def getManifestVersionName() { //====================================================================== android { - compileSdkVersion 19 + compileSdkVersion 22 buildToolsVersion '22.0.1' defaultConfig { minSdkVersion 16 - targetSdkVersion 19 + targetSdkVersion 22 versionCode = getManifestVersionCode() versionName = getManifestVersionName() testApplicationId "com.SecUpwN.AIMSICD.test" From 796dbcc56e7adb2bb354649035249f0a471fb1c5 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Mon, 4 May 2015 22:11:08 +0300 Subject: [PATCH 11/27] build-tools version has been increased --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b5496f18f..bf8cf3149 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ android: - platform-tools - tools # The BuildTools version we are using for our project - - build-tools-21.1.2 + - build-tools-22.0.1 # System Image we use to run emulator(s) during tests - sys-img-armeabi-v7a-android-17 # Additional components From 8baa8bc3a3c89e2e6b055819ab50553b55b889a5 Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Mon, 4 May 2015 22:26:56 +0300 Subject: [PATCH 12/27] experiment with build tools has been finished( stable versions were restored) --- .travis.yml | 2 +- app/build.gradle | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf8cf3149..b5496f18f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ android: - platform-tools - tools # The BuildTools version we are using for our project - - build-tools-22.0.1 + - build-tools-21.1.2 # System Image we use to run emulator(s) during tests - sys-img-armeabi-v7a-android-17 # Additional components diff --git a/app/build.gradle b/app/build.gradle index 71f2c47f2..1e1c8c5d5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,12 +38,12 @@ def getManifestVersionName() { //====================================================================== android { - compileSdkVersion 22 - buildToolsVersion '22.0.1' + compileSdkVersion 19 + buildToolsVersion '21.1.2' defaultConfig { minSdkVersion 16 - targetSdkVersion 22 + targetSdkVersion 19 versionCode = getManifestVersionCode() versionName = getManifestVersionName() testApplicationId "com.SecUpwN.AIMSICD.test" @@ -128,8 +128,8 @@ dependencies { // compile 'com.github.amlcurran.showcaseview:library:5.0.0' compile fileTree(dir: 'libs', include: '*.jar') compile project(':third_party:rootshell') - compile 'com.android.support:support-v4:22.1.1' - compile 'com.android.support:appcompat-v7:22.1.1' + compile 'com.android.support:support-v4:19.1.0' + //compile 'com.android.support:appcompat-v7:22.1.1' compile 'org.osmdroid:osmdroid-android:4.2' //https://github.com/lp0/slf4j-android compile 'org.slf4j:slf4j-api:1.7.12' From dd37fa6c5e91b1c996e3928a7fc30eeca2011a0b Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Tue, 5 May 2015 00:41:18 +0300 Subject: [PATCH 13/27] Fixed bug with doubling (tripling, etc.) markers on the map --- app/src/main/AndroidManifest.xml | 1 + .../com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java | 6 +++++- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a7fb14d81..85743343e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -116,6 +116,7 @@ android:exported="true" android:label="@string/map_view" android:parentActivityName=".AIMSICD" + android:launchMode="singleInstance" android:configChanges="keyboardHidden|screenLayout|screenSize|orientation"> Date: Tue, 5 May 2015 18:12:03 +0200 Subject: [PATCH 14/27] Unified and resized copyright header --- .../java/com/SecUpwN/AIMSICD/AIMSICD.java | 20 ++-------- .../java/com/SecUpwN/AIMSICD/AppAIMSICD.java | 19 ++------- .../AIMSICD/activities/MapViewerOsmDroid.java | 20 ++-------- .../adapters/DbViewerSpinnerAdapter.java | 19 ++------- .../SecUpwN/AIMSICD/constants/DrawerMenu.java | 19 ++------- .../SecUpwN/AIMSICD/constants/Examples.java | 19 ++------- .../SecUpwN/AIMSICD/constants/TinyDbKeys.java | 19 ++------- .../SecUpwN/AIMSICD/enums/StatesDbViewer.java | 19 ++------- .../AIMSICD/service/AimsicdService.java | 40 ++----------------- .../SecUpwN/AIMSICD/utils/BaseAsyncTask.java | 19 ++------- .../SecUpwN/AIMSICD/utils/OemCommands.java | 20 ++-------- 11 files changed, 44 insertions(+), 189 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java b/app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java index fcf1820d1..4a59b8acd 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java @@ -1,20 +1,8 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2014 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ - package com.SecUpwN.AIMSICD; import android.app.ActionBar; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/AppAIMSICD.java b/app/src/main/java/com/SecUpwN/AIMSICD/AppAIMSICD.java index 707ef3d82..45b16d3d7 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/AppAIMSICD.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/AppAIMSICD.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java b/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java index a33267bc8..1e471761d 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/activities/MapViewerOsmDroid.java @@ -1,20 +1,8 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2014 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ - package com.SecUpwN.AIMSICD.activities; import android.content.BroadcastReceiver; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java index c39d2d6e8..f9f9ee713 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/adapters/DbViewerSpinnerAdapter.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.adapters; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java b/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java index bec027f64..b85f70590 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/constants/DrawerMenu.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.constants; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java b/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java index d72cf3467..2441ecdbe 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/constants/Examples.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.constants; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java b/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java index 2593ae35f..970777343 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/constants/TinyDbKeys.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.constants; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java b/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java index 88614da15..8d9db08ea 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/enums/StatesDbViewer.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.enums; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java b/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java index d0e5bf53f..4d7c42e4f 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java @@ -1,39 +1,7 @@ -/* Android IMSI Catcher Detector -* Copyright (C) 2014 -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You may obtain a copy of the License at -* https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE -*/ - -/* - * Portions of this software have been copied and modified from - * Femtocatcher https://github.com/iSECPartners/femtocatcher - * - * Copyright (C) 2013 iSEC Partners - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ /* diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java index 0d38b5618..e41f107ee 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/BaseAsyncTask.java @@ -1,18 +1,7 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2015 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.utils; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java index 59e81a29e..356c282cd 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java @@ -1,20 +1,8 @@ -/* Android IMSI Catcher Detector - * Copyright (C) 2014 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You may obtain a copy of the License at - * https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/LICENSE +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * ----------------------------------------------------------- */ - package com.SecUpwN.AIMSICD.utils; import android.util.Log; From c1de2f9391b104c698d09bb647e844e12924d746 Mon Sep 17 00:00:00 2001 From: SecUpwN Date: Tue, 5 May 2015 18:40:53 +0200 Subject: [PATCH 15/27] Testing WIP-Internal v0.1.26-alpha-build-03 --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 85743343e..5b9102e5d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="0.1.26-alpha-b03"> + All data will be deleted.\nAre you sure? Wpisz komendę AT tutaj Aktywność bazy danych Status danych diff --git a/app/src/main/res/values-ru/translatable_strings.xml b/app/src/main/res/values-ru/translatable_strings.xml index b54992f9d..e7c832387 100644 --- a/app/src/main/res/values-ru/translatable_strings.xml +++ b/app/src/main/res/values-ru/translatable_strings.xml @@ -38,8 +38,8 @@ Переключить Femtocell Сделать резервную копию базы данных - Очистить/Сбросить базу данных + Все данные будут стерты.\nВы уверены? Восстановить базу данных Параметры diff --git a/app/src/main/res/values/translatable_strings.xml b/app/src/main/res/values/translatable_strings.xml index 571dd6011..ca9118818 100644 --- a/app/src/main/res/values/translatable_strings.xml +++ b/app/src/main/res/values/translatable_strings.xml @@ -32,8 +32,8 @@ Toggle Femtocell Backup Database - Clear/Reset Database + All data will be deleted.\nAre you sure? Restore Database Preferences From ff8b367fcc914493becec4e6eb381f55e55b9403 Mon Sep 17 00:00:00 2001 From: SecUpwN Date: Wed, 6 May 2015 17:00:43 +0200 Subject: [PATCH 17/27] Moved into Technical Details within WIKI --- DATABASE.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 DATABASE.md diff --git a/DATABASE.md b/DATABASE.md deleted file mode 100644 index d9fb4acdf..000000000 --- a/DATABASE.md +++ /dev/null @@ -1,37 +0,0 @@ -This is Work in Progress! -Thus this is not yet accurate and quite possibly wrong info. -```html -

This is some red text.

-``` - -

Introduction

- -

AIMSICD utillize several tables in a single SQLite3 database in aimsicd.db to keep track -of all the network changes and the downloaded Open Cell ID (OCID) data. When you're making a file -backup of the AOMSICD database, you're actually saving the various tables into individual -.CSV files. This make it easy to manually or externally update some tables.

- -

All mentioned sqlite commands are properly documented on the SQLite website

- -

Accessing the databases:

- -

From a PC:

- -

adb shell

-

su

-

sqlite3 /data/data/com.SecUpwN.AIMSICD/databases/aimsicd.db

- -

From a Terminal Emulator within Android:

- -

su

-

sqlite3 /data/data/com.SecUpwN.AIMSICD/databases/aimsicd.db

-

*Note: You may need to install sqlite3 binaries

- -

aimsicd.db consists of four relevant tables

- -

TABLE:LOCATION_TABLE

-

TABLE:CELL_TABLE

-

TABLE:OPENCELLID_TABLE

-

TABLE:DEFAULT_MCC_TABLE

-

TABLE:SILENT_SMS_TABLE

- From e27899d7c0dab9d0199088d61778f7ac8a4edcdc Mon Sep 17 00:00:00 2001 From: SecUpwN Date: Fri, 8 May 2015 12:43:12 +0200 Subject: [PATCH 18/27] Added Toast Extender for #403 --- .../com/SecUpwN/AIMSICD/utils/Helpers.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index 295b9a22f..a17cf38ab 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -73,7 +73,7 @@ * * Issues: AS complaints that several of these methods are not used... * - * ChangeLog: + * ChangeLog: 2015-05-08 SecUpwN Added Toast Extender for longer toasts * */ public class Helpers { @@ -130,6 +130,36 @@ public static void sendMsg(Context context, String msg) { msgLong(context, msg); } } + + /** + * Toast Extender + * (To extend toast messages to more than 3.5 sec) + * + * @param context Application Context + * @param msg Message to send + */ + public class Toaster { + private static final int SHORT_TOAST_DURATION = 2000; + + private Toaster() {} + + public static void makeLongToast(String msg, long durationInMillis) { + final Toast t = Toast.makeText(App.context(), msg, Toast.LENGTH_SHORT); + t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0); + + new CountDownTimer(Math.max(durationInMillis - SHORT_TOAST_DURATION, 1000), 1000) { + @Override + public void onFinish() { + t.show(); + } + + @Override + public void onTick(long millisUntilFinished) { + t.show(); + } + }.start(); + } + } /** * Return a timestamp From 9bbb1824579c2520eed3c326a77b2e829fe52976 Mon Sep 17 00:00:00 2001 From: "Security: Pwned." Date: Fri, 8 May 2015 12:03:06 +0000 Subject: [PATCH 19/27] Fixed Toast Extender for #403 --- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index a17cf38ab..35ff63b6c 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -143,8 +143,8 @@ public class Toaster { private Toaster() {} - public static void makeLongToast(String msg, long durationInMillis) { - final Toast t = Toast.makeText(App.context(), msg, Toast.LENGTH_SHORT); + public static void makeLongToast(Context context,String msg, long durationInMillis) { + final Toast t = Toast.makeText(context, msg, Toast.LENGTH_SHORT); t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0); new CountDownTimer(Math.max(durationInMillis - SHORT_TOAST_DURATION, 1000), 1000) { From 3ee9d70004c2e29c5452f143345033a0cca9475c Mon Sep 17 00:00:00 2001 From: "Security: Pwned." Date: Fri, 8 May 2015 12:22:16 +0000 Subject: [PATCH 20/27] Added missing import CountDownTimer --- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index 35ff63b6c..e42eb7888 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -23,6 +23,7 @@ import android.content.DialogInterface; import android.net.ConnectivityManager; import android.net.NetworkInfo; +import android.os.CountDownTimer import android.os.Environment; import android.os.Handler; import android.text.TextUtils; From 8b207566954e02195904c00e5491385c24760be5 Mon Sep 17 00:00:00 2001 From: "Security: Pwned." Date: Fri, 8 May 2015 14:12:57 +0000 Subject: [PATCH 21/27] Small update of makeLongToast --- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index e42eb7888..81a54d59e 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -144,7 +144,7 @@ public class Toaster { private Toaster() {} - public static void makeLongToast(Context context,String msg, long durationInMillis) { + public void makeLongToast(Context context,String msg, long durationInMillis) { final Toast t = Toast.makeText(context, msg, Toast.LENGTH_SHORT); t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0); From 44735963abfc8eabf459b47702d9d5bdf8a67de0 Mon Sep 17 00:00:00 2001 From: "Security: Pwned." Date: Fri, 8 May 2015 20:37:57 +0000 Subject: [PATCH 22/27] Added missing semicolon --- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index 81a54d59e..733ed998f 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -23,7 +23,7 @@ import android.content.DialogInterface; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.os.CountDownTimer +import android.os.CountDownTimer; import android.os.Environment; import android.os.Handler; import android.text.TextUtils; From 9401b0e94167576d63136b23f5a622c2761459ac Mon Sep 17 00:00:00 2001 From: DimaKoz Date: Fri, 8 May 2015 23:39:42 +0300 Subject: [PATCH 23/27] repair --- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index 81a54d59e..b102e87c1 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -23,11 +23,12 @@ import android.content.DialogInterface; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.os.CountDownTimer +import android.os.CountDownTimer; import android.os.Environment; import android.os.Handler; import android.text.TextUtils; import android.util.Log; +import android.view.Gravity; import android.widget.Toast; import com.SecUpwN.AIMSICD.R; @@ -136,8 +137,6 @@ public static void sendMsg(Context context, String msg) { * Toast Extender * (To extend toast messages to more than 3.5 sec) * - * @param context Application Context - * @param msg Message to send */ public class Toaster { private static final int SHORT_TOAST_DURATION = 2000; From 39b1607d79536701149042829827f69e3f7a8072 Mon Sep 17 00:00:00 2001 From: Paul Kinsella Date: Sun, 10 May 2015 15:52:41 +0100 Subject: [PATCH 24/27] Make Longer Toast fixes #403 --- .../com/SecUpwN/AIMSICD/utils/Helpers.java | 61 +++++++------------ 1 file changed, 22 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index b102e87c1..5919e8817 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -84,23 +84,34 @@ public class Helpers { private static final String mTAG = "Helpers"; private static final int CHARS_PER_LINE = 34; - + private static final int SHORT_TOAST_DURATION = 2000;//hardcoded, ideally this could be changed in prefs + private static final long TOAST_DURATION_MILLS = 6000; /** * Long toast message - * (Predefined in AOS to 3500 ms = 3.5 sec) - * + * TOAST_DURATION_MILLS controls the duration + * currently set to 6 seconds * @param context Application Context * @param msg Message to send */ public static void msgLong(final Context context, final String msg) { - if (context != null && msg != null) { - new Handler(context.getMainLooper()).post(new Runnable() { - @Override - public void run() { - Toast.makeText(context, msg.trim(), Toast.LENGTH_LONG).show(); - } - }); - } + if (context != null && msg != null) { + final Toast t = Toast.makeText(context, msg, Toast.LENGTH_SHORT); + t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0); + + new CountDownTimer(Math.max(TOAST_DURATION_MILLS - SHORT_TOAST_DURATION, 1000), 1000) { + @Override + public void onFinish() { + t.show(); + } + + @Override + public void onTick(long millisUntilFinished) { + t.show(); + } + }.start(); + } + + } /** @@ -133,34 +144,6 @@ public static void sendMsg(Context context, String msg) { } } - /** - * Toast Extender - * (To extend toast messages to more than 3.5 sec) - * - */ - public class Toaster { - private static final int SHORT_TOAST_DURATION = 2000; - - private Toaster() {} - - public void makeLongToast(Context context,String msg, long durationInMillis) { - final Toast t = Toast.makeText(context, msg, Toast.LENGTH_SHORT); - t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0); - - new CountDownTimer(Math.max(durationInMillis - SHORT_TOAST_DURATION, 1000), 1000) { - @Override - public void onFinish() { - t.show(); - } - - @Override - public void onTick(long millisUntilFinished) { - t.show(); - } - }.start(); - } - } - /** * Return a timestamp * From 58703a37237bf0fc3cc109bdb8c04bf411c2c17b Mon Sep 17 00:00:00 2001 From: Paul Kinsella Date: Sun, 10 May 2015 15:55:42 +0100 Subject: [PATCH 25/27] Make Longer Toast fixes #403 --- app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java index 5919e8817..e6158ed83 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java @@ -84,8 +84,8 @@ public class Helpers { private static final String mTAG = "Helpers"; private static final int CHARS_PER_LINE = 34; - private static final int SHORT_TOAST_DURATION = 2000;//hardcoded, ideally this could be changed in prefs - private static final long TOAST_DURATION_MILLS = 6000; + private static final int SHORT_TOAST_DURATION = 2000; + private static final long TOAST_DURATION_MILLS = 6000;//change if need longer /** * Long toast message * TOAST_DURATION_MILLS controls the duration From 33d6ada5f435f3bc79815e4be1e78f152f6d4edd Mon Sep 17 00:00:00 2001 From: "Security: Pwned." Date: Sun, 10 May 2015 16:22:54 +0000 Subject: [PATCH 26/27] Unchaining WIP-Release v0.1.27-alpha-build-00 --- app/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 38d4775ce..eb7498706 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="27" + android:versionName="0.1.27-alpha-b00">