update version 1.0.0 Alpha

This commit is contained in:
BobH
2022-05-11 22:09:39 +08:00
commit a2bf32a476
19 changed files with 1788 additions and 0 deletions

109
.gitignore vendored Normal file
View File

@@ -0,0 +1,109 @@
secretConfig.js
/cache
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port

47
Logger.js Normal file
View File

@@ -0,0 +1,47 @@
const chalk = require('chalk');
const fs = require('fs');
const path = require("path");
Date.prototype.format = function(fmt) {
let o = {
"M+" : this.getMonth()+1,
"d+" : this.getDate(),
"h+" : this.getHours(),
"m+" : this.getMinutes(),
"s+" : this.getSeconds(),
"q+" : Math.floor((this.getMonth()+3)/3),
"S" : this.getMilliseconds()
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
}
for(let k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
}
return fmt;
}
const LogFileName = new Date().format("yyyy-MM-dd") + ".txt";
if(!fs.existsSync("Logs")){
fs.mkdirSync("Logs");
}
function LogError(str){
console.log(chalk.redBright("[" + new Date().format("yyyy-MM-dd hh:mm:ss") + "][Error] ") + str);
fs.appendFileSync(path.join(__dirname,"./Logs/" + LogFileName), "[" + new Date().format("yyyy-MM-dd hh:mm:ss") + "][Error] " + str + "\n");
}
function LogInfo(str){
console.log(chalk.green("[" + new Date().format("yyyy-MM-dd hh:mm:ss") + "][Info] ") + str);
fs.appendFileSync(path.join(__dirname,"./Logs/" + LogFileName), "[" + new Date().format("yyyy-MM-dd hh:mm:ss") + "][Info] " + str + "\n");
}
function LogWarn(str){
console.log(chalk.yellow("[" + new Date().format("yyyy-MM-dd hh:mm:ss") + "][Warn] ") + str);
fs.appendFileSync(path.join(__dirname,"./Logs/" + LogFileName), "[" + new Date().format("yyyy-MM-dd hh:mm:ss") + "][Warn] " + str + "\n");
}
module.exports = { LogInfo,LogWarn,LogError };

72
README.md Normal file
View File

@@ -0,0 +1,72 @@
# FakeLocation-Server
## Introduction
A fake api server for FakeLocation App
Unlock all apps limitation and you can use pro version permanently for free
## How to use?
I only test FakeLocation app with version **1.3.0.2**, so it is strongly recommended that you use the same version
You can download the corresponding version through following url:
[download link1](https://pan.baidu.com/s/1i_QEPgEiGHBAC4QDJvFavw?pwd=xeqf)
clone the project
```bash
git clone https://github.com/BobH233/FakeLocation-server.git
```
~~install the nodejs~~
run
```bash
npm install
```
to start the server:
```bash
node index.js
```
and you should setup the proxy so that FakeLocation app connect to your own server
then open the app, and login with any username and password
## Setup the proxy
you can choose any of the methods
### 1. your router(system: OpenWrt)
Go to `Network > DHCP/DNS > DNS hijacking`
And add following config:
```
fakelocation.api.lerist.cc -> your server ip
notice.api.lerist.cc -> your server ip
ads.api.lerist.cc -> your server ip
```
### 2. Other method
To be updated...
## Why I made this?
Firstly, I would like to greatly thank **lerist** for developing such an excellent app
You should have made enough money with this app, and I want to note that nowdays we love "Open Source"
I don't think your price setting is reasonable and it's time to embrace **Open Source Era**
## @lerist
If this project bothers you, please contact me without any hesitation

207
core.js Normal file
View File

@@ -0,0 +1,207 @@
/*
FakeLocation-Server
File: core.js
Description: Core code to simulate the server response.
Author: BobH
Time: 2022-5-11
A free and open source api server for app "Fake Location @ 1.3.0.2"
*/
const logger = require('./Logger');
const recommandedVersion = "1.3.0.2";
const fs = require('fs');
const path = require('path');
// enable this so that when there's a login request, the server will check users.json and verify the password
const UseVerification = false;
const sharedToken = "T0666f0186548415db1e594fd1e9a96884835";
const sharedKey = "TiwFHDBEL2OQsvV5hD8I3IqwlBSai3XkBnn/WJzecUs+Dkl4iI6a8SecE7ZQAuqt/p2QL9Dve1a8\ngdS5d19wcAZbGdGq3NuM";
const sharedUserId = "U6add3391f48b4f689d85f7623a30e571121";
function Init(){
let usersConfigPath = "";
//TODO: support specific user to login
}
function login(reqBody, res){
let appVersion = reqBody['versionName'];
if(appVersion != recommandedVersion){
logger.LogWarn("Login request shows the version of the app is" + appVersion + ". However, version " + recommandedVersion + " is recommanded.");
}
let username = reqBody['loginName'];
let password = reqBody['loginPwd'];
logger.LogInfo("[ device: "+ reqBody.deviceModel + " ] Username = " + username + ", password = " + password + " login!");
if(!UseVerification || true){
//TODO: support specific user to login
let retPayload = {
"body": {
"regtime": Date.now() - 1000 * 60 * 60,
"proindate": Date.now() + 1000 * 60 * 60 * 24 * 365,
"createTime": Date.now() - 1000 * 60 * 60 - 1,
"loginType": "email",
"loginName": "BobH" + "Crack",
"updateTime": 0,
"type": 1,
"userId": sharedUserId,
"key": sharedKey,
"token": sharedToken
},
"code": 200,
"returnTime": Date.now(),
"success": true
};
res.send(JSON.stringify(retPayload));
}
}
function checkExist(reqBody, res){
logger.LogInfo("checkExist request.");
let retPayload = {
"body": true,
"code": 200,
"returnTime": Date.now(),
"success": true
};
res.send(JSON.stringify(retPayload));
}
function getNotices(reqBody, res){
logger.LogInfo("getNotices request.");
let retPayload = [
{
"content": "<p><strong>这是由BobH破解的FakeLocationApp的服务端发送的消息</strong></p>\r\n\r\n<p><strong>请勿将此软件用于非法用途,请勿用于出售或非法盈利</strong></p>\r\n\r\n",
"createTime": 0,
"flavor": "*",
"id": "00008",
"isAvailable": true,
"isNeedAgree": true,
"language": "*",
"needAgree": true,
"title": "破解说明",
"type": "text",
"weight": 100001
}
];
res.send(JSON.stringify(retPayload));
}
function getAds(reqBody, res){
logger.LogInfo("getAds request.");
let retPayload = [
{
"available": true,
"createTime": 0,
"intervalTime": 30000,
"isAvailable": true,
"isRandom": false,
"language": "*",
"provider": "BobH",
"random": false,
"texts": "此软件已经连接破解版服务器,无需再进行购买即可免费不限制使用",
"urls": "#",
"weight": 3
},
{
"available": true,
"createTime": 0,
"intervalTime": 16000,
"isAvailable": true,
"isRandom": false,
"language": "*",
"provider": "BobH",
"random": false,
"texts": "已经解锁了软件的全部应用模拟功能,不再有特定应用无法使用的问题",
"urls": "#",
"weight": 2
}
];
res.send(JSON.stringify(retPayload));
}
function getRenewalGoodsList(reqBody, res){
logger.LogInfo("getRenewalGoodsList request.");
let retPayload = {
"body": [
{
"createTime": 0,
"description": "",
"id": "0011",
"isAvailable": 1,
"locale": "*",
"name": "永久使用无限制",
"price": 0,
"priceUnit": "¥",
"recommend": "BobH",
"updateTime": 0,
"value": 30,
"weight": 4
}
],
"code": 200,
"returnTime": Date.now(),
"success": true
};
res.send(JSON.stringify(retPayload));
}
function getAppConfigs(reqBody, res){
logger.LogInfo("getAppConfigs request.");
// allow all apps to be simulated
let retPayload = {
"body": {
"createTime": Date.now(),
"disabledApps": [
],
"disabledFuncs": [
],
"disabledInfos": [
],
"isAllowRun": 1,
"isAvailable": 1,
"notice": "",
"updateTime": 0
},
"code": 200,
"returnTime": Date.now(),
"success": true
};
res.send(JSON.stringify(retPayload));
}
function checkApkUpdate(reqBody, res){
logger.LogInfo("checkApkUpdate request.");
let retPayload = {
"code": parseInt(reqBody.versionCode),
"message": "??????",
"returnTime": Date.now(),
"success": true
};
res.send(JSON.stringify(retPayload));
}
function userget(reqBody, res){
logger.LogInfo("userget request.");
let retPayload = {
"body": {
"regtime": Date.now() - 1000 * 60 * 60,
"proindate": Date.now() + 1000 * 60 * 60 * 24 * 365,
"createTime": Date.now() - 1000 * 60 * 60 - 1,
"loginType": "email",
"loginName": "BobH" + "Crack",
"updateTime": 0,
"type": 1,
"key": sharedKey,
"token": sharedToken
},
"code": 200,
"returnTime": Date.now(),
"success": true
}
res.send(JSON.stringify(retPayload));
}
module.exports = { login, Init, checkExist, getNotices, getAds, getRenewalGoodsList, getAppConfigs, checkApkUpdate, userget };

View File

@@ -0,0 +1,6 @@
{
"code": 2002,
"message": "??????",
"returnTime": 1652265311756,
"success": false
}

View File

@@ -0,0 +1,14 @@
{
"loginName": "1551608379@qq.com",
"loginType": "email",
"deviceId": "57fc0e90b697bfb1",
"deviceModel": "Xiaomi M2102K1AC",
"deviceSdkCode": 31,
"deviceSdkName": "12",
"flavor": "CN",
"language": "zh",
"packageName": "com.lerist.fakelocation",
"timezone": "GMT+08:00",
"versionCode": "1022",
"versionName": "1.3.0.2"
}

View File

@@ -0,0 +1,6 @@
{
"body": true,
"code": 200,
"returnTime": 1652244842307,
"success": true
}

View File

@@ -0,0 +1,28 @@
[
{
"available": true,
"createTime": 0,
"intervalTime": 30000,
"isAvailable": true,
"isRandom": false,
"language": "*",
"provider": "BobH",
"random": false,
"texts": "此软件已经连接破解版服务器,无需再进行购买即可免费不限制使用",
"urls": "#",
"weight": 3
},
{
"available": true,
"createTime": 0,
"intervalTime": 16000,
"isAvailable": true,
"isRandom": false,
"language": "*",
"provider": "BobH",
"random": false,
"texts": "已经解锁了软件的全部应用模拟功能,不再有特定应用无法使用的问题",
"urls": "#",
"weight": 2
}
]

View File

@@ -0,0 +1,21 @@
{
"body": {
"createTime": 1652265311817,
"disabledApps": [
],
"disabledFuncs": [
],
"disabledInfos": [
],
"isAllowRun": 1,
"isAvailable": 1,
"notice": "",
"updateTime": 0
},
"code": 200,
"returnTime": 1652265311817,
"success": true
}

View File

@@ -0,0 +1,15 @@
[
{
"content": "<p><strong>这是由BobH破解的FakeLocationApp的服务端发送的消息</strong></p>\r\n\r\n<p><strong>请勿将此软件用于非法用途,请勿用于出售或非法盈利</strong></p>\r\n\r\n",
"createTime": 0,
"flavor": "*",
"id": "00008",
"isAvailable": true,
"isNeedAgree": true,
"language": "*",
"needAgree": true,
"title": "破解说明",
"type": "text",
"weight": 100001
}
]

View File

@@ -0,0 +1,15 @@
{
"loginName": "1551608379@qq.com",
"loginPwd": "usuususi",
"loginType": "email",
"deviceId": "57fc0e90b697bfb1",
"deviceModel": "Xiaomi M2102K1AC",
"deviceSdkCode": 31,
"deviceSdkName": "12",
"flavor": "CN",
"language": "zh",
"packageName": "com.lerist.fakelocation",
"timezone": "GMT+08:00",
"versionCode": "1022",
"versionName": "1.3.0.2"
}

View File

@@ -0,0 +1,17 @@
{
"body": {
"regtime": 1652235871953,
"proindate": 1659999906729,
"createTime": 1652235871952,
"loginType": "email",
"loginName": "1551608379@qq.com",
"updateTime": 0,
"type": 1,
"userId": "U6add3391f48b4f689d85f7623a30e571121",
"key": "TiwFHDBEL2OQsvV5hD8I3IqwlBSai3XkBnn/WJzecUs+Dkl4iI6a8SecE7ZQAuqt/p2QL9Dve1a8\ngdS5d19wcAZbGdGq3NuM",
"token": "T0666f0186548415db1e594fd1e9a96884835"
},
"code": 200,
"returnTime": 1652236555370,
"success": true
}

View File

@@ -0,0 +1,21 @@
{
"body": [
{
"createTime": 0,
"description": "",
"id": "0011",
"isAvailable": 1,
"locale": "*",
"name": "永久使用无限制",
"price": 0,
"priceUnit": "¥",
"recommend": "BobH",
"updateTime": 0,
"value": 30,
"weight": 4
}
],
"code": 200,
"returnTime": 1652265315347,
"success": true
}

View File

@@ -0,0 +1,14 @@
{
"deviceId": "57fc0e90b697bfb1",
"deviceModel": "Xiaomi M2102K1AC",
"deviceSdkCode": 31,
"deviceSdkName": "12",
"flavor": "CN",
"language": "zh",
"packageName": "com.lerist.fakelocation",
"timezone": "GMT+08:00",
"token": "T0666f0186548415db1e594fd1e9a96884835",
"userId": "U6add3391f48b4f689d85f7623a30e571121",
"versionCode": "1022",
"versionName": "1.3.0.2"
}

View File

@@ -0,0 +1,16 @@
{
"body": {
"regtime": 1652235871953,
"proindate": 1659999906729,
"createTime": 1652235871952,
"loginType": "email",
"loginName": "1551608379@qq.com",
"updateTime": 0,
"type": 1,
"key": "TiwFHDBEL2OQsvV5hD8I3IqwlBSai3XkdZGSQTX1ruo+Dkl4iI6a8SecE7ZQAuqt/p2QL9Dve1a8\ngdS5d19wcAZbGdGq3NuM",
"token": "T0666f0186548415db1e594fd1e9a96884835"
},
"code": 200,
"returnTime": 1652236560560,
"success": true
}

73
index.js Normal file
View File

@@ -0,0 +1,73 @@
/*
FakeLocation-Server
File: index.js
Description: Main code to create the express web server and dispatch the requests.
Author: BobH
Time: 2022-5-11
A free and open source api server for app "Fake Location @ 1.3.0.2"
*/
const ServerVersion = "1.0.0 Alpha";
const express = require('express');
const logger = require('./Logger');
const app = express();
const core = require('./core');
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.get('*', (req, res) => {
res.send("FakeLocationServer @ " + ServerVersion);
});
app.post('/FakeLocation/user/login', (req, res) => {
let reqBody = req.body;
core.login(reqBody, res);
});
app.post('/FakeLocation/user/get', (req, res) => {
let reqBody = req.body;
core.userget(reqBody, res);
});
app.post('/FakeLocation/user/checkPwdExist', (req, res) => {
let reqBody = req.body;
core.checkExist(reqBody, res);
});
app.post('/FakeLocation/user/checkUserExist', (req, res) => {
let reqBody = req.body;
core.checkExist(reqBody, res);
});
app.post('/Notice/getNotices', (req, res) => {
let reqBody = req.body;
core.getNotices(reqBody, res);
});
app.post('/Ads/getAds', (req, res) => {
let reqBody = req.body;
core.getAds(reqBody, res);
});
app.post('/FakeLocation/goods/getRenewalGoodsList', (req, res) => {
let reqBody = req.body;
core.getRenewalGoodsList(reqBody, res);
});
app.post('/FakeLocation/app/getAppConfigs', (req, res) => {
let reqBody = req.body;
core.getAppConfigs(reqBody, res);
});
app.post('/FakeLocation/version/checkApkUpdate', (req, res) => {
let reqBody = req.body;
core.checkApkUpdate(reqBody, res);
});
const server = app.listen(8000, () => {
let host = server.address().address;
let port = server.address().port;
core.Init();
logger.LogInfo("Server running at http://" + host + ":" + port + "!");
});

1088
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
package.json Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "fakelocation-server",
"version": "1.0.0",
"description": "a fakelocation app pro version server",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"fakelocation",
"fakeserver"
],
"author": "bobh",
"license": "ISC",
"dependencies": {
"chalk": "^4.1.2",
"express": "^4.18.1"
}
}

0
users.json Normal file
View File