# Documentation

Config your application without technical knowable

Thank you for purchasing my theme. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

Created: 09/01/2020
By: Virmana Inc
Email: virmana.inc@gmail.com

## Config Android Project

After Download , install and open the project on Android Studio , now you need to config your source code and make it ready by change package name config firebase config facebook ....

#### Open Project in Android studio

Now you need to open the Android Application on Android Studio just follow the video bellow to open the project .

#### Change the package name

Every Android Application on Google Play has a unique package name (unique id) , for this application too we need to use a unique package name , for that you need to choose a unique package name (ApplicationId) with three part for example : com.companyname.appname , now to change you package name follow the video bello :

#### Please note

- The only special characters allowed on package name its underscore
- Don't change the "com" part on package name
- Google will not allow you to change the package name after publish the app on google play

#### Firebase Configuration

After Change package name now you need to config the firebase (firebase its a google service used to send notification and to allow the application login with google accounts)

#### Please note

- Don't try to generate APK without config firebase
- Don't try To sync the project without config firebase

#### Facebook Configuration

After config Firebase now you need to config the facebook Application (this configuratio required to use facebook login + Facebook Network Audiance )

###### use the commande bellow to generate the hashkey :

     keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64

#### Fix After Publish App On Google play

- Publish app on google play store
- Install app from google play
- Open Your application > menu left > settings
- Long click on version name you will get message said the "hashkey is copied"
- Go your facebook app on developper facebook and add the copied haskey .

#### Google / Phone Auth Configuration

After Publish App On google Play follow the video bellow

## Admin Panel

Now you need to setup your admin panel and that required a shared hosting or a vps server with the requirement bellow

#### Hosting Requirements

- Exif Extension
- Fileinfo Extension
- GD Extension
- PHP iconv extension
- PHP Vertsion 5.6/5.8/7.0

After prepare your server follow the video bellow to setup the admin panel

After Config admin panel Go to firebase > Project settings > Cloud Messaging > and copy the server key
Then Go to Admin panel > menu left > Settings > and past your server key and click save check screenshot bellow:

#### Link The Android App With Admin panel

After the android app configuration and the admin panel configuration now you need to link it .
to do this go to :

    Android App>Config>Global.java

and add your api url there (if your admin panel its http://admin.example.com you api url will be http://admin.example.com/api/)

    public static final String API_URL = "http://flix.virmana.com/api/";

## Android Application Customization

After config everything now you app need a customization to take your touch like title,icon,colors ....

#### Change the application name

To change the application name
Go to :

    Android App>res>values>strings.xml

And change the application name there :

    <string name="app_name">Flix App</string>

#### Change the application icons

To change the application logo
Go to :
Then change the icon on folders bellow

#### Change the application colors

To change the application colors
Go to :

    Android App>res>values>colors.xml

and change all app colors there

#### Change Admob/Facebook ads IDs

To Admin Panel > Menu > Settings > Settings Ads and set your AdMob / Facebook Ads Ids

## Update 2.0

To update App to 2.0
Frist You will need to download the original android application and re-config with your package name becuase the project has many new intergration(will be more difficult to update file by file)
Then Update database > phpMyAdmin > select your database > SQL > past the SQL request bellow > GO

    CREATE TABLE subscription_table
    (   id INT AUTO_INCREMENT NOT NULL,
        user_id INT NOT NULL,
        media_id INT DEFAULT NULL,
        created DATETIME NOT NULL,
        duration INT NOT NULL,
        method VARCHAR(255) NOT NULL,
        pack VARCHAR(255) NOT NULL,
        infos LONGTEXT DEFAULT NULL,
        status VARCHAR(255) NOT NULL,
        currency VARCHAR(255) NOT NULL,
        price DOUBLE  NOT NULL,
        transaction VARCHAR(255) DEFAULT NULL,
        email VARCHAR(255) DEFAULT NULL,
        started DATETIME DEFAULT NULL,
        expired DATETIME DEFAULT NULL,
        INDEX IDX_C118E35A76ED395 (user_id),
        INDEX IDX_C118E35EA9FDD75 (media_id),
        PRIMARY KEY(id)
    )
    DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

Then

    CREATE TABLE pack_table
    (
        id INT AUTO_INCREMENT NOT NULL,
        title VARCHAR(255) NOT NULL,
        description VARCHAR(255) DEFAULT NULL,
        discount VARCHAR(255) DEFAULT NULL,
        price DOUBLE  NOT NULL,
        duration INT NOT NULL,
        PRIMARY KEY(id)
    )
    DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

Then

    CREATE TABLE items_table
    (
        id INT AUTO_INCREMENT NOT NULL,
        poster_id INT DEFAULT NULL,
        channel_id INT DEFAULT NULL,
        user_id INT NOT NULL,
        position INT NOT NULL,
        INDEX IDX_F2F545FD5BB66C05 (poster_id),
        INDEX IDX_F2F545FD72F5A1AA (channel_id),
        INDEX IDX_F2F545FDA76ED395 (user_id),
        PRIMARY KEY(id)
    )
    DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

Then

    ALTER TABLE subscription_table
    ADD CONSTRAINT FK_C118E35A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user_table (id);

Then

    ALTER TABLE subscription_table
    ADD CONSTRAINT FK_C118E35EA9FDD75 FOREIGN KEY (media_id) REFERENCES media_table (id);

Then

    ALTER TABLE items_table
    ADD CONSTRAINT FK_F2F545FD5BB66C05 FOREIGN KEY (poster_id) REFERENCES poster_table (id);

Then

    ALTER TABLE items_table
    ADD CONSTRAINT FK_F2F545FD72F5A1AA FOREIGN KEY (channel_id) REFERENCES channel_table (id);

Then

    ALTER TABLE items_table
    ADD CONSTRAINT FK_F2F545FDA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user_table (id);

Then

    ALTER TABLE settings_table
    ADD logo_id INT DEFAULT NULL,
    ADD favicon_id INT DEFAULT NULL,
    ADD title VARCHAR(255) DEFAULT NULL,
    ADD subtitle VARCHAR(255) DEFAULT NULL,
    ADD sitedescription VARCHAR(255) DEFAULT NULL,
    ADD sitekeywords VARCHAR(255) DEFAULT NULL,
    ADD login TINYINT(1) NOT NULL,
    ADD currency VARCHAR(255) DEFAULT NULL,
    ADD cashaccount LONGTEXT DEFAULT NULL,
    ADD paypalclientid VARCHAR(255) DEFAULT NULL,
    ADD paypalclientsecret VARCHAR(255) DEFAULT NULL,
    ADD paypalaccount VARCHAR(255) DEFAULT NULL,
    ADD stripeapikey LONGTEXT DEFAULT NULL,
    ADD manual TINYINT(1) NOT NULL,
    ADD stripe TINYINT(1) NOT NULL,
    ADD paypal TINYINT(1) NOT NULL,
    ADD gpay TINYINT(1) NOT NULL,
    ADD stripepublickey LONGTEXT DEFAULT NULL,
    ADD paypalsandbox TINYINT(1) NOT NULL,
    ADD refundpolicy LONGTEXT DEFAULT NULL,
    ADD faq LONGTEXT DEFAULT NULL,
    ADD homebanner VARCHAR(255) DEFAULT NULL,
    ADD homebannertype VARCHAR(255) DEFAULT NULL,
    ADD moviebanner VARCHAR(255) DEFAULT NULL,
    ADD moviebannertype VARCHAR(255) DEFAULT NULL,
    ADD seriebanner VARCHAR(255) DEFAULT NULL,
    ADD seriebannertype VARCHAR(255) DEFAULT NULL,
    ADD channelbanner VARCHAR(255) DEFAULT NULL,
    ADD channelbannertype VARCHAR(255) DEFAULT NULL,
    ADD themoviedbkey VARCHAR(255) DEFAULT NULL,
    ADD themoviedblang VARCHAR(255) DEFAULT NULL,
    ADD header LONGTEXT DEFAULT NULL;

Then

    ALTER TABLE settings_table
    ADD CONSTRAINT FK_4EF0C90FF98F144A FOREIGN KEY (logo_id) REFERENCES media_table (id);

Then

    ALTER TABLE settings_table
    ADD CONSTRAINT FK_4EF0C90FD78119FD FOREIGN KEY (favicon_id) REFERENCES media_table (id);

Then

    CREATE INDEX IDX_4EF0C90FF98F144A ON settings_table (logo_id);
    CREATE INDEX IDX_4EF0C90FD78119FD ON settings_table (favicon_id);

Then

    ALTER TABLE poster_table
    ADD slug VARCHAR(255) NOT NULL,
    ADD label VARCHAR(255) DEFAULT NULL,
    ADD sublabel VARCHAR(255) DEFAULT NULL;

Then

    UPDATE poster_table SET slug = id;
    CREATE UNIQUE INDEX UNIQ_2AD2483989D9B62 ON poster_table (slug);

Then

    ALTER TABLE actor_table
    ADD slug VARCHAR(255) NOT NULL;

    UPDATE actor_table SET slug = id;

Then

    CREATE UNIQUE INDEX UNIQ_D2AD64D2989D9B62 ON actor_table (slug);

Then

    ALTER TABLE episode_table
    ADD slug VARCHAR(255) NOT NULL;

    UPDATE episode_table SET slug = id;

Then

    CREATE UNIQUE INDEX UNIQ_CD237912989D9B62 ON episode_table (slug);

    ALTER TABLE channel_table
    ADD slug VARCHAR(255) NOT NULL,
    ADD label VARCHAR(255) NOT NULL,
    ADD sublabel VARCHAR(255) NOT NULL;
    UPDATE channel_table SET slug = id;
    CREATE UNIQUE INDEX UNIQ_410887DE989D9B62 ON channel_table (slug);

Then

    ALTER TABLE source_table
    ADD quality VARCHAR(255) DEFAULT NULL,
    ADD title VARCHAR(255) DEFAULT NULL,
    ADD size VARCHAR(255) DEFAULT NULL,
    ADD kind VARCHAR(255) DEFAULT NULL,
    ADD external TINYINT(1) DEFAULT NULL,
    ADD premium VARCHAR(255) DEFAULT NULL, CHANGE type type VARCHAR(255) DEFAULT NULL;

Then

    UPDATE source_table SET title = type  ;
    UPDATE source_table SET premium = 1  ;
    UPDATE source_table SET external = 0  ;
    UPDATE source_table SET kind = "both"  ;

Then

    ALTER TABLE fos_user_table
    ADD theme VARCHAR(255) DEFAULT NULL,
    DROP expires_at,
    DROP credentials_expire_at,
    CHANGE username username VARCHAR(180) NOT NULL,
    CHANGE username_canonical username_canonical VARCHAR(180) NOT NULL,
    CHANGE email email VARCHAR(180) NOT NULL,
    CHANGE email_canonical email_canonical VARCHAR(180) NOT NULL,
    CHANGE salt salt VARCHAR(255) DEFAULT NULL,
    CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL;

Then

    CREATE UNIQUE INDEX UNIQ_C3D4D4BDC05FB297 ON fos_user_table (confirmation_token);

Then go to admin panel and replace the exist folders and files from the new admin panel

    admin_panel/app/config/config.yml
    admin_panel/app/config/security.yml
    admin_panel/app/config/services.yml
    admin_panel/app/config/routing.yml
    admin_panel/app/AppKarnel.php
    admin_panel/public_html/css/demo.css
    admin_panel/public_html/js/app.js
    admin_panel/src/AppBundle
    admin_panel/src/UserBundle
    admin_panel/vendor

    then go to admin panel > app > cach > and delete prod folder

## Update 2.1

To updare admin panel to 2.1 update the files bellow

    admin_panel/vendor/friendsofsymfony/user-bundle/Controller/ChangePasswordController.php
    admin_panel/src/UserBundle/Resources/views/ChangePassword/admin_changePassword_content.html.twig
    admin_panel/src/AppBundle/Controller/SerieController.php
    admin_panel/src/AppBundle/Controller/MovieController.php
    admin_panel/src/UserBundle/Entity/User.php
    admin_panel/public_html/js/app.js
    admin_panel/src/AppBundle/Resources/views/Subscription/index.html.twig
    admin_panel/src/AppBundle/Resources/views/Subscription/edit.html.twig
    admin_panel/src/AppBundle/Resources/views/Pack/edit.html.twig
    admin_panel/src/AppBundle/Resources/views/Pack/add.html.twig
    admin_panelsrc/AppBundle/Resources/views/Home/api_all.html.php
    then go to admin panel > app > cach > and delete prod folder

Then Update the android app by update the files bellow

    /ui/activities/SerieActivity.java
    /ui/activities/ChannelActivity.java
    /entity/Poster.java
    /MyApplication.java

## Update 2.2

To updare admin panel to 2.2 update the files bellow

    admin_panel/src/UserBundle/Entity/User.php
    admin_panel/src/AppBundle/Entity/Source.php
    admin_panel/src/AppBundle/Controller/HomeController.php

Then Update the android app by update the files bellow

    /ui/activities/PlansActivity.java

## Update 2.3

To updare admin panel to 2.3 update the files bellow

    ui > Adapters > HomeAdapter
    ui > Adapters > ChannelAdapter
    ui > Adapters > PosterAdapter

    ui > activities > HomeActivity.java
    ui > activities > ChannelActivity.java
    ui > activities > MoviesActivity.java
    ui > activities > SerieActivity.java
    ui > activities > SerieActivity.java
    ui > activities > LoginActivity
    ui > activities > RefundActivity

    res > layout > activity_refund.xml
    res > layout > activity_login.xml
    res > layout > native_ad_layout_1.xml
    res > layout > item_facebook_ads.xml
    res > layout > dialog_subscribe.xml
    res > values > strings.xml

    manifests > AndroidManifest.xml

    Gradle Scriptes > build.gradle

Then Update the admin panel by update the files bellow

    src/AppBundle/Resources/config/routing.yml
    src/AppBundle/Controller/HomeController.php
    src/AppBundle/Resources/views/Home/apprefundpolicy.html.twig

Then go to admin panel / app / cach and delete prod folder

## Update 2.4

To update App to 2.4
You will need to download the original android application and re-config with your package name becuase the project has many new intergration(will be more difficult to update file by file)

To updare admin panel to 2.4 update the files bellow

    adminsrc/AppBundle/Controller/MovieController.php
    adminsrc/AppBundle/Controller/ChannelController.php
    adminsrc/AppBundle/Controller/SubscriptionController.php
    adminsrc/AppBundle/Controller/SubtitleController.php
    adminsrc/UserBundle/Controller/UserController.php
    adminsrc/AppBundle/Resources/config/routing.yml
    adminsrc/AppBundle/Resources/views/Movie/api_reviews.html.php
    adminsrc/AppBundle/Resources/views/Channel/api_reviews.html.php
    adminsrc/AppBundle/Form/AdsType.php
    adminsrc/AppBundle/Resources/views/Home/ads.html.twig

    Then go to admin panel / app / cach and delete prod folder

## Update 3.0

To update App to 3.0
You will need to download the original android application and re-config with your package name becuase the project has many new intergration(will be more difficult to update file by file)

To updare admin panel to 3.O update the files bellow

    admin panel / src / AppBundle/Form/AdsType.php
    admin panel / src / AppBundle/Resources/views/Home/ads.html.twig
    admin panel / src / AppBundle/Controller/SubscriptionController.php
    admin panel / src / AppBundle/Controller/VersionController.php
    admin panel / src / AppBundle/ Resources/ views/ Home/ ads.html.twig

    Then go to admin panel / app / cach and delete prod folder

## Update 3.1

To updare the android to 3.1 update the files bellow

    android app/manifests/AndroidManifest.xml
    android app/ui/activities/MovieActivity.java
    android app/ui/Adapters/PosterAdapter.java
    android app/ui/Adapters/ChannelAdapter.java

## Update 3.2

To updare the android to 3.2 update the files bellow

    Anroid App/res/layout/activity_plans.xml
    Anroid App/ui/activities/PlansActivity.java
    Anroid App/ui/activities/MovieActivity.java
    Anroid App/ui/activities/SerieActivity.java
    Anroid App/ui/activities/ChannelActivity.java
    Anroid App/ui/Adapters/PosterAdapter.java
    Anroid App/ui/Adapters/ChannelAdapter.java
    Anroid App/ui/activities/LoginActivity.java
    Anroid App/build.gradle

## Update 3.3

To updare the android to 3.3 update the files bellow

    Android App/manifests/AndroidManifest.xml
    Android App/api/apiClient
    Android App/ui/Adapters/PosterAdapter.java
    Android App/ui/Adapters/ChannelAdapter.java
    Android App/ui/activities/ChannelActivity.java
    Android App/ui/activities/MovieActivity.java
    Android App/ui/activities/SerieActivity.java
    Anroid App/build.gradle

## Update 4.O

To updare the android to 4.O update the files bellow

    android app / build.gradle (Project : Application)
    android app / build.gradle (Module : Application.app)

    android app / services / CallBackPrice
    android app / services / CallBackCheck
    android app / services / CallBackBilling
    android app / services / BillingSubs
    android app / services / BillingInApp
    android app / services / Billing

    android app / ui /activities/SplashActivity.java
    android app / ui / activities/ActorActivity.java
    android app / ui /activities/ActorActivity.java
    android app / ui /activities/MyListActivity.java
    android app / ui /activities/SearchActivity.java
    android app / ui /activities/SerieActivity.java
    android app / ui /activities/TopActivity.java
    android app / ui /activities/MovieActivity.java
    android app / ui /activities/ActorsActivity.java
    android app / ui /activities/ChannelActivity.java
    android app / ui /activities/GenreActivity.java

    android app / ui /Adapters/ChannelAdapter.java
    android app / ui /Adapters/PosterAdapter.java
    android app / ui /Adapters/HomeAdapter.java
    android app / se rvices/NotifFirebaseMessagingService.java
    android app / ui /player/CustomPlayerViewModel.java

    android app/res/layout/item_max_native_ads.xml
    android app/res/layout/activity_login.xml
    AndroidManifest.xml

To updare admin panel to 4.O update the files bellow

    admin panel / src / AppBundle/Form/AdsType.php

    Then go to admin panel / app / cach and delete prod folder

## Update 4.1

To updare the android to 4.1 update the files bellow

    android app / build.gradle (Project : Application)
    android app / build.gradle (Module : Application.app)
    android app / proguard-rules.pro