dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
providerstrings.cpp
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #include "providerstrings.h"
28 #include <QDebug>
29 #include <QApplication>
30 #include <QCryptographicHash>
31 
32 namespace core {
33 const QString ProviderStrings::levelsForSigPacSpainMap[] = {"0", "1", "2", "3", "4",
34  "MTNSIGPAC",
35  "MTN2000", "MTN2000", "MTN2000", "MTN2000", "MTN2000",
36  "MTN200", "MTN200", "MTN200",
37  "MTN25", "MTN25",
38  "ORTOFOTOS","ORTOFOTOS","ORTOFOTOS","ORTOFOTOS"};
39 
40 QString ProviderStrings::encrypt(QString str)
41 {
42  QByteArray array = str.toUtf8();
43  array = qCompress(array, 9);
44  int pos(0);
45  char lastChar(0);
46  int cnt = array.length();
47  while (pos < cnt) {
48  array[pos] = array.at(pos) ^ cryptKeyVector.at(pos % 8) ^ lastChar;
49  lastChar = array.at(pos);
50  ++pos;
51  }
52  return QString::fromLatin1(array.toBase64());
53 }
54 
55 QString ProviderStrings::decrypt(QString str)
56 {
57  QByteArray ba = QByteArray::fromBase64(str.toLatin1());
58  int pos(0);
59  int cnt(ba.count());
60  char lastChar = 0;
61 
62  while (pos < cnt) {
63  char currentChar = ba[pos];
64  ba[pos] = ba.at(pos) ^ lastChar ^ cryptKeyVector.at(pos % 8);
65  lastChar = currentChar;
66  ++pos;
67  }
68 
69  return QString::fromUtf8(qUncompress(ba));
70 }
71 
73 {
74  quint64 key = 0;
75  QByteArray array = QCryptographicHash::hash(QString("taulabs.org").toLatin1(), QCryptographicHash::Md4);
76  for(uint x = 0; x < 3; ++x) {
77  key += array.at(2 ^ x);
78  }
79  cryptKeyVector.resize(8);
80  for (int i = 0; i < 8; i++) {
81  quint64 part = key;
82  for (int j = i; j > 0; j--)
83  part = part >> 8;
84  part = part & 0xff;
85  cryptKeyVector[i] = static_cast<char>(part);
86  }
87 
88  VersionGoogleMap = decrypt("hoaGv8cd7uEX4ukZ7RwTmmudkhqWmenlbRwZK3YqyRQQ7JFyMS1uE4kUlnX266hKmYTQo74yHjO5eXl5jPvrog==").split("%@%").at(1);;
89  VersionGoogleSatellite = decrypt("hoaGt88V5ukf6uER5RQbkmOVmhKekeHtZRQRI34iwRwY5Jl6OSVmG4Ecnn3+46BCkYzY1RgVFWJLRTQ=").split("%@%").at(1);
90  VersionGoogleLabels = decrypt("hoaGv8cd7uEX4ukZ7RwTmmudkhqWmenlbRwZK3YqyRQQ7JFyMS1uE4kUlnX266hKmYTQ4/9zX3L4ODg4zY2d2Q==").split("%@%").at(1);
91  VersionGoogleTerrain = decrypt("hoaGucEb6OcR5O8f6xoVnG2blByQn+/jaxofLXAszxIW6pd0NytoFY8SkHPw7a5Mn4LWnYGNAI1/9ellSWRoqC4ucLqrbw==").split("%@%").at(1);
92  SecGoogleWord = "Galileo";
93 
94  // Google (China) version strings
98  VersionGoogleTerrainChina = decrypt("hoaGucEb6OcR5O8f6xoVnG2blByQn+/jaxofLXAszxIW6pd0NytoFY8SkHPw7a5Mn4LWnYGNAI1/9ellSWRoqC4ucLqrbw==").split("%@%").at(1);
99 
100  // Google (Korea) version strings
104 
105  // Yahoo version strings
106  VersionYahooMap = "4.3";
107  VersionYahooSatellite = "1.9";
108  VersionYahooLabels = "4.3";
109 
110  // BingMaps
111  VersionBingMaps = "563";
112 
113  // YandexMap
114  VersionYandexMap = "2.16.0";
115  //VersionYandexSatellite = "1.19.0";
117 
122  BingMapsClientToken = "";
123 
124  gMapRegex = decrypt("hoaG36d9joF3gol5jXxz+gv98nr2+YmFDXx5SxZKqXRwjPESUU0Oc+l09hVodXaUR1oOPXc9N73We496CULIJcCSZrRHtGcUwDWnVCfSGVO3WygCiQNuHYay0II2AgP2YX2a").split("%@%").at(1);
125  gLabRegex = decrypt("hoaG36d9joF3gol5jXxz+gv98nr2+YmFDXx5SxZKqXRwjPESUU0Oc+l09hWU0GzGw6nvpu+uH6KxD3EfVuea1tqE/oD+hMpguMq0GmQ9dPgDTSh5yKUjoGAspjAWFuT4YrE=").split("%@%").at(1);
126  gSatRegex = decrypt("hoaG06txgo17joV1gXB/9gfx/nb69YWJAXB1RxpGpXh8gP0eXUECf+V4+hmah8Qm9ei8j8WPhQ9kyT3Ie0g6sdq56x/NPs0e67lM3i1e350q3LkPFSQNV0tLy1ZNdQ==").split("%@%").at(1);
127  gTerRegex = decrypt("hoaG559FtrlPurFBtURLwjPFykLOwbG9NURBcy5ykUxItMkqaXU2S9FMzi2us/ASwdyIu/G7sTtQ/Qn8j8ROo0YU4DLBMuGSRrMh0qFUn9Ux3a6ED4XoozkNbz2JvchC5NDQOOT76g==").split("%@%").at(1);
128 
129  gAPIUrl = decrypt("hoaGGGC6nxXS3B4+Ki9gM8LvlJnIHCpDlxJKFq6M0yHk1cHJKdR5lPwx/R68AYr0ksCdJV10tfOsgnGrAe8uQY0/2BjWdRe1ZLEYgshBOHc5NQQzFRHy4sYLhoh7kVkbeeplv+YSl/nwClU/WFO93dXStWpj8TR4zY9djqhp8t1D5w9YFn4S4pCXNLWCdg==").split("%@%").at(1);
130 }
131 }
132 
133 
QVector< char > cryptKeyVector
for i
Definition: OPPlots.m:140
QString VersionGoogleSatelliteKorea
QString VersionGoogleSatelliteChina
QString BingMapsClientToken
Bing Maps Customer Identification, more info here http://msdn.microsoft.com/en-us/library/bb924353.aspx
static const QString levelsForSigPacSpainMap[]
QString decrypt(QString str)
QString encrypt(QString str)
QString VersionYahooMap
Google Maps API generated using http://greatmaps.codeplex.com/ from http://code.google.com/intl/en-us/apis/maps/signup.html
x
Definition: OPPlots.m:100