mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-04 00:17:49 +00:00
new addon: pcscd-addon
This commit is contained in:
parent
edae841ee4
commit
3a860fc772
42
packages/addons/service/system/pcscd-addon/addon
Executable file
42
packages/addons/service/system/pcscd-addon/addon
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2011-2011 Gregor Fuis (gujs@openelec.tv)
|
||||||
|
#
|
||||||
|
# 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, 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 OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. config/options $1
|
||||||
|
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin/
|
||||||
|
|
||||||
|
cp -Pa $BUILD/pcsc-lite-*/src/pcscd $ADDON_BUILD/$PKG_ADDON_ID/bin/pcscd.bin
|
||||||
|
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||||
|
cp -Pa $BUILD/pcsc-lite-*/src/.libs/*.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||||
|
cp -Pa $BUILD/pcsc-lite-*/src/spy/.libs/*.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||||
|
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/drivers/serial
|
||||||
|
cp -Pa $BUILD/libccid-*/src/.libs/libccidtwin.so $ADDON_BUILD/$PKG_ADDON_ID/drivers/serial
|
||||||
|
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/drivers/ifd-ccid.bundle/Contents/Linux/
|
||||||
|
cp -Pa $BUILD/libccid-*/src/.libs/libccid.so $ADDON_BUILD/$PKG_ADDON_ID/drivers/ifd-ccid.bundle/Contents/Linux/
|
||||||
|
cp -Pa $BUILD/libccid-*/src/Info.plist $ADDON_BUILD/$PKG_ADDON_ID/drivers/ifd-ccid.bundle/Contents
|
||||||
|
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config
|
||||||
|
cp -Pa $PKG_DIR/config/* $ADDON_BUILD/$PKG_ADDON_ID/config/
|
2
packages/addons/service/system/pcscd-addon/changelog.txt
Normal file
2
packages/addons/service/system/pcscd-addon/changelog.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
2.0.1
|
||||||
|
- initial version for pcsc-lite 1.8.2 / ccid 1.4.5
|
@ -0,0 +1,10 @@
|
|||||||
|
# Gemalto reader with serial communication
|
||||||
|
# - n is the serial port to use n in [0..3]
|
||||||
|
# - reader is the reader name. It is needed for multi-slot readers.
|
||||||
|
# Possible reader values are: GemPCPinPad, GemCorePOSPro, GemCoreSIMPro,
|
||||||
|
# GemPCTwin (default value)
|
||||||
|
# example: /dev/ttyS0:GemPCPinPad
|
||||||
|
#FRIENDLYNAME "GemPCTwin serial"
|
||||||
|
#DEVICENAME /dev/ttySn[:reader]
|
||||||
|
#LIBPATH /storage/.xbmc/addons/service.system.pcscd-addon/drivers/serial/libccidtwin.so
|
||||||
|
#CHANNELID n
|
BIN
packages/addons/service/system/pcscd-addon/icon/icon.png
Normal file
BIN
packages/addons/service/system/pcscd-addon/icon/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
37
packages/addons/service/system/pcscd-addon/meta
Executable file
37
packages/addons/service/system/pcscd-addon/meta
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2011-2011 Gregor Fuis (gujs@openelec.tv)
|
||||||
|
#
|
||||||
|
# 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, 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 OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
PKG_NAME="pcscd-addon"
|
||||||
|
PKG_VERSION="2.0"
|
||||||
|
PKG_REV="1"
|
||||||
|
PKG_ARCH="any"
|
||||||
|
PKG_LICENSE="GPL"
|
||||||
|
PKG_SITE="http://www.openelec.tv"
|
||||||
|
PKG_URL=""
|
||||||
|
PKG_DEPENDS=""
|
||||||
|
PKG_BUILD_DEPENDS="toolchain pcsc-lite libusb libccid"
|
||||||
|
PKG_PRIORITY="optional"
|
||||||
|
PKG_SECTION="service/system"
|
||||||
|
PKG_SHORTDESC="Middleware to access a smart card using SCard API (PC/SC)"
|
||||||
|
PKG_LONGDESC="Middleware to access a smart card using SCard API (PC/SC)"
|
||||||
|
PKG_IS_ADDON="yes"
|
||||||
|
PKG_ADDON_TYPE="xbmc.service"
|
||||||
|
PKG_AUTORECONF="no"
|
55
packages/addons/service/system/pcscd-addon/source/bin/pcscd.start
Executable file
55
packages/addons/service/system/pcscd-addon/source/bin/pcscd.start
Executable file
@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
|
#
|
||||||
|
# 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, 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 OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
ADDON_NAME="service.system.pcscd-addon"
|
||||||
|
ADDON_DIR="$HOME/.xbmc/addons/$ADDON_NAME"
|
||||||
|
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/$ADDON_NAME"
|
||||||
|
|
||||||
|
ADDON_CONFIG_DIR="$ADDON_HOME/config"
|
||||||
|
|
||||||
|
LOCKDIR="/var/lock/"
|
||||||
|
LOCKFILE="pcscd.disabled"
|
||||||
|
|
||||||
|
mkdir -p $ADDON_HOME
|
||||||
|
|
||||||
|
export PATH=$ADDON_DIR/bin:$PATH
|
||||||
|
|
||||||
|
cd $ADDON_DIR/config
|
||||||
|
mkdir -p $ADDON_CONFIG_DIR
|
||||||
|
for config in `find . -type f -name "*.conf*"`; do
|
||||||
|
if [ ! -f $ADDON_CONFIG_DIR/$config ]; then
|
||||||
|
cp $config $ADDON_CONFIG_DIR/$config
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! "$(pidof pcscd.bin)" ];then
|
||||||
|
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
|
||||||
|
rm -rf "$LOCKDIR/$LOCKFILE"
|
||||||
|
fi
|
||||||
|
while [ true ] ; do
|
||||||
|
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
pcscd.bin --foreground -c $ADDON_CONFIG_DIR/reader.conf
|
||||||
|
sleep 1
|
||||||
|
done &
|
||||||
|
fi
|
30
packages/addons/service/system/pcscd-addon/source/bin/pcscd.stop
Executable file
30
packages/addons/service/system/pcscd-addon/source/bin/pcscd.stop
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
|
#
|
||||||
|
# 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, 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 OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
LOCKDIR="/var/lock/"
|
||||||
|
LOCKFILE="pcscd.disabled"
|
||||||
|
|
||||||
|
if [ "$(pidof pcscd.bin)" ];then
|
||||||
|
mkdir -p "$LOCKDIR"
|
||||||
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
|
killall -9 pcscd.bin
|
||||||
|
fi
|
44
packages/addons/service/system/pcscd-addon/source/default.py
Executable file
44
packages/addons/service/system/pcscd-addon/source/default.py
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2011-2011 Gregor Fuis (gujs@openelec.tv)
|
||||||
|
#
|
||||||
|
# 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, 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 OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import xbmcaddon
|
||||||
|
import time
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
__scriptname__ = "PCSC lite"
|
||||||
|
__author__ = "OpenELEC"
|
||||||
|
__url__ = "http://www.openelec.tv"
|
||||||
|
__settings__ = xbmcaddon.Addon(id='service.system.pcscd-addon')
|
||||||
|
__cwd__ = __settings__.getAddonInfo('path')
|
||||||
|
__start__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "pcscd.start") )
|
||||||
|
__stop__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "pcscd.stop") )
|
||||||
|
|
||||||
|
#make binary files executable in adson bin folder
|
||||||
|
subprocess.Popen("chmod -R +x " + __cwd__ + "/bin/*" , shell=True, close_fds=True)
|
||||||
|
|
||||||
|
subprocess.Popen(__start__, shell=True, close_fds=True)
|
||||||
|
|
||||||
|
while (not xbmc.abortRequested):
|
||||||
|
time.sleep(0.250)
|
||||||
|
|
||||||
|
subprocess.Popen(__stop__, shell=True, close_fds=True)
|
Loading…
x
Reference in New Issue
Block a user