/!\ Anyone interested in this Gist should look at the work of @danielchc ;)
-> https://gist.github.com/danielchc/c159626485a08c76856b2d30ae457e04
/!\ I used bind9 on my local server to add mb3admin.com entry for all devices ( like android app ) Otherwise in hosts fie :
<your_server> mb3admin.com
C:\Users\<YOUR_USER>\AppData\Roaming\Emby-Theater\system\electronapp
Add after app.on('window-all-closed', function () {
block L:18
To accept self certificate
app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
event.preventDefault()
callback(true)
})
- Create /var/www/mb3admin.com folder
- In /var/www/mb3admin.com/ create file
index.php
with
<?php
if (false){
$file = 'data.log';
$content = file_get_contents($file);
$content .= date('Y-m-d H:i:s').' : '.$_SERVER['REMOTE_ADDR'].' URL : '.$_SERVER['REDIRECT_URL'].' Query : '.json_encode($_REQUEST)."\r\n";
file_put_contents($file, $content);
}
if ($_SERVER['REDIRECT_URL'] == '/admin/service/registration/validate'){
header('content-type:application/json');
$date = new DateTime();
$date->add(new DateInterval('P14D'));
echo '{"featId":"'.$_POST['feature'].'","registered":true,"expDate":"'.$date->format('Y-m-d').'","key":"'.$_POST['key'].'"}';
}elseif ($_SERVER['REDIRECT_URL'] == '/admin/service/registration/validateDevice'){
header('content-type:application/json');
echo '{"cacheExpirationDays":21,"resultCode":"GOOD","message":"Device Valid"}';
}
- Create file
.htaccess
Allow from all Options -Indexes <IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] </IfModule>
# /etc/apache2/sites-enabled/mb3admin.conf
<VirtualHost *:80>
DocumentRoot "/var/www/mb3admin.com"
ServerName mb3admin.com
<Directory "/var/www/mb3admin.com/">
Options MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
TransferLog /var/log/apache2/mb3admin_access.log
ErrorLog /var/log/apache2/mb3admin_error.log
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/www/mb3admin.com"
ServerName mb3admin.com
SSLEngine on
SSLCertificateFile /etc/apache2/mb3admin.crt # Self signed certificate
SSLCertificateKeyFile /etc/apache2/mb3admin.key
<Directory "/var/www/mb3admin.com/">
Options MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
TransferLog /var/log/apache2/mb3admin_access.log
ErrorLog /var/log/apache2/mb3admin_error.log
</VirtualHost>
@qwedass You understood correctly, Emby.Web.dll provide web client with auth URL
https://mb3admin.com
, replacing that url in the dll file provide client with another URL for which i can generate valid SSL to avoid importing cert to all clients to be able to stream TV channels. On first look, server seemed like control point to provide clients with auth URL.I will have to look further into this, will checkout android app since it can be easily decompiled to be sure what logic standalone clients use to obtain
mb3admin.com
url. Hopefully it is all server side logic so that we can provide patch set of files to unlock all features.Will post if i find anything useful :).