Skip to content
This repository was archived by the owner on Aug 6, 2019. It is now read-only.

Commit 4de3344

Browse files
committed
init commit
0 parents  commit 4de3344

File tree

5 files changed

+129
-0
lines changed

5 files changed

+129
-0
lines changed

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Opm-Server-Golang
2+
=================
3+
4+
Opera Mini Server Mirror with Golang
5+
6+
##Requirements
7+
8+
Go compiler toolchains <http://golang.org/doc/install>
9+
10+
Android apktool <https://code.google.com/p/android-apktool/>
11+
12+
##Usage
13+
14+
###Server
15+
16+
Build & Run
17+
18+
```
19+
go build server.go
20+
./server &
21+
```
22+
23+
Set iptables
24+
25+
```
26+
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 9003 -j DNAT --to-destination 141.0.11.253:1080
27+
iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 9003 -j SNAT --to-source YOUR-SERVER-IP
28+
```
29+
30+
###Client
31+
32+
Download operamini.apk
33+
34+
`wget http://m.opera.com/android/Ow7Good/operamini.apk`
35+
36+
Decode apk file
37+
38+
`apktool d operamini.apk`
39+
40+
Replace proxy server with your server `opera.example.com:8080`
41+
42+
```
43+
sed -i 's/"http:\/\/"/"http:\/\/opera.example.com:8080\/"/g' `find operamini -name '*.smali'`
44+
sed -i 's/"socket:\/\/"/"socket:\/\/opera.example.com:9003\/"/g' `find operamini -name '*.smali'`
45+
```
46+
47+
Build apk file
48+
49+
`apktool b operamini`
50+
51+
Sign apk file
52+
53+
`java -jar signapk.jar testkey.x509.pem testkey.pk8 operamini/dist/operamini.apk operamini_mod.apk`
54+
55+
Enjoy~

server.go

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"bytes"
7+
"io"
8+
"io/ioutil"
9+
"net/http"
10+
)
11+
const (
12+
PORT = ":8080"
13+
URL = "http://server4.operamini.com/"
14+
)
15+
16+
func handler(w http.ResponseWriter, r *http.Request) {
17+
body, err := ioutil.ReadAll(r.Body)
18+
if err != nil && err != io.EOF {
19+
fmt.Println(err)
20+
return
21+
}
22+
req, err := http.NewRequest("POST",URL,bytes.NewReader(body))
23+
if err != nil && err != io.EOF {
24+
fmt.Println(err)
25+
return
26+
}
27+
req.Header.Add("content-type","application/xml")
28+
resp, err := http.DefaultClient.Do(req)
29+
if err != nil && err != io.EOF {
30+
fmt.Println(err)
31+
return
32+
}
33+
w.WriteHeader(resp.StatusCode)
34+
result, err := ioutil.ReadAll(resp.Body)
35+
if err != nil && err != io.EOF {
36+
fmt.Println(err)
37+
return
38+
}
39+
w.Write(result)
40+
return
41+
}
42+
43+
func main() {
44+
http.HandleFunc("/",handler)
45+
http.ListenAndServe(PORT,nil)
46+
os.Exit(0)
47+
}

signapk.jar

7.2 KB
Binary file not shown.

testkey.pk8

1.19 KB
Binary file not shown.

testkey.x509.pem

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIEqDCCA5CgAwIBAgIJAJNurL4H8gHfMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
3+
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4g
4+
VmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UE
5+
AxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAe
6+
Fw0wODAyMjkwMTMzNDZaFw0zNTA3MTcwMTMzNDZaMIGUMQswCQYDVQQGEwJVUzET
7+
MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4G
8+
A1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9p
9+
ZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAw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