Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ors-utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
ors-utils
Commits
ec9894bd
Commit
ec9894bd
authored
Mar 07, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use smart card reader to write sim card
parent
6c8644e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
uicc/Makefile
uicc/Makefile
+1
-1
uicc/README
uicc/README
+5
-0
uicc/write-sim-card
uicc/write-sim-card
+16
-5
No files found.
uicc/Makefile
View file @
ec9894bd
...
...
@@ -2,7 +2,7 @@ program_uicc: program_uicc.c uicc.h milenage.h
g++
--std
=
c++11
-g3
-I
.
-Wall
program_uicc.c
-o
program_uicc
program_uicc_pcsc
:
program_uicc.c uicc.h milenage.h
g++
--std
=
c++11
-g3
-DPCSC
-I
.
-I
/usr/include/PCSC
-Wall
program_uicc.c
-L
/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux
-lccid
-o
program_uicc_pcsc
g++
--std
=
c++11
-g3
-DPCSC
-I
.
-I
/usr/include/PCSC
-Wall
program_uicc.c
-L
/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux
-
Wl
,-rpath
=
/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux
-
lccid
-o
program_uicc_pcsc
clean
:
rm
program_uicc program_uicc_pcsc
uicc/README
0 → 100644
View file @
ec9894bd
In order to use smart card read HID omnikey, do
sudo apt install libpcsclite-dev libccid
make program_uicc_pcsc
./write-sim-card XXX
uicc/write-sim-card
View file @
ec9894bd
...
...
@@ -6,6 +6,12 @@ if [ -z "$1" ]; then
echo
"Usage: ./write-sim-card ORS_NUMBER [SIM_NUMBER_START]"
;
exit
;
fi
usb_device
=
$(
lsusb |
grep
"Smart Card Reader"
)
if
[
-z
"
$usb_device
"
]
;
then
echo
"No Smart Card Reader found"
exit
1
fi
usb_opt
=
$(
echo
$usb_device
|
sed
's/.* ID //'
|
sed
's/ .*//'
|
sed
's#:#/#'
)
adm
=
"12345678"
plmn
=
"00101"
# Albania
...
...
@@ -21,10 +27,15 @@ else
fi
let
imsinum
=
$1
*
10+
$imsioffset
j
=
y
echo
echo
"Press enter when you have entered the SIM card"
while
read
j
;
do
[[
$j
=
"q"
]]
&&
exit
i
=
$(
printf
"%05d"
$imsinum
)
echo
programming imsi:
$i
sudo
$SOURCE_DIR
/program_uicc
--adm
${
adm
}
--iccid
898600611000000
$i
--imsi
${
plmn
}
00000
$i
--isdn
06000
$i
--acc
0001
--key
00112233445566778899AABBCCDDEEFF
--opc
000102030405060708090A0B0C0D0E0F
-spn
"RS-ORS
$1
-
$i
"
--authenticate
--noreadafter
let
imsinum
=
$imsinum
+1
[[
$j
=
"q"
]]
&&
exit
i
=
$(
printf
"%05d"
$imsinum
)
echo
programming imsi:
$i
$SOURCE_DIR
/program_uicc_pcsc
--port
usb:
$usb_opt
--adm
${
adm
}
--iccid
898600611000000
$i
--imsi
${
plmn
}
00000
$i
--isdn
06000
$i
--acc
0001
--key
00112233445566778899AABBCCDDEEFF
--opc
000102030405060708090A0B0C0D0E0F
-spn
"RS-ORS
$1
-
$i
"
--authenticate
--noreadafter
let
imsinum
=
$imsinum
+1
echo
echo
"Press enter when you have entered the new SIM card (or 'q' to quit)"
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment