This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Play Store installed on Clean TinkerOS_Android 7 Nougat v14.4.0.5
#1
Information 
Getting Google Play Store installed on Clean TinkerOS_Android 7 Nougat v14.4.0.5

following:  Installing Play Store from GAPPs...

Please be advised: development userdebug build configurations..
should not be used in production.. ;-]... 

Google Play Store ON clean install [TinkerOS_Android 7 Nougat v14.4.0.5]

notes... H/W setup...
---------------------------------------------------------------
tinker Board connected to wire LAN @ 192.168.0.21
use clean SanDisk Ultra 64GB microSDXC Memory Card..
format on windows 10.. with SDfomatter.. selected Overwrite format.. from options..
make TinkerOS_Android 7 Nougat v14.4.0.5 image on SD with Etcher..
connect usb Logitech MX Ergo Wireless Trackball Mouse
connect usb DREVO Calibur 72 Key Gaming Mechanical Keyboard RGB LED Backlit Ten keyless Bluetooth 4.0 -UK Layout
upgrade usb DREVO Calibur V2 PRO Bluetooth 5.1 Wireless RGB Mechanical Gaming Keyboard UK Layout
   - for recovery.. Wipe Cache Partition.. & if you love to bash ;-]].. 
connect HANNspree HT225HPB 21.5-Inch Touch Screen HDMI DisplayPort HS-IPS Monitor... set to.. [1920 x 1080 @ 60hz]..
connect power NorthPada Power Supply AC Charger Adapter 5V 3A Micro USB 5 Feet with Power On / Off Switch..
-----------------------------------------------------------------------------------------------------------------------------------------------

power on & first boot...

notes... S/W setup...
---------------------------------------------------------
set auto rotate to landscape in quick settings..
set [Sleep].. to 5 minutes.. [Screen saver].. ON.. set to Clock and set when to start.. [Either]..
set [Wallpaper]..click on the picture and then [Set wallpaper].. [Home screen and lock screen]..
make sure [HDMI].. is on.. [HDMI Resolution].. set to 1920x1080p60.00.. [HDMI Rotation].. 0..

set [Languages & input]... I'm in UK.. add UK keyboard and set to top 
Note... don't remove US Keyboard until after first restart...

set [Date & time]... [Automatic date & time].. GMT+1 British Summer Time.. 

set [Ethernet].. setup wired LAN now & connect to network.. this should update time and date.. 
[Settings].. in Wireless & network section click on [More].. [Ethnet].. [Ethnet Ip mode].. [Static]...
then enter details..  IP 192.168.0.21 / GW 192.168.0.1 / NetMask 255.255.255.0 / DNS1 8.8.8.8 DNS2 8.8.4.4

set Home screen App icons.. as you like..

Restart tinker board... see if all your settings hold on reboot.. 
remove US Keyboard from [Languages & input]..

set [Sound].. set sound volumes.. and make sure [Audio Output].. is set to [HDMI]..
connected StarTech.com Headset adapter & mic...
--------------------------------------------------------------

check what your IP is to use with adb...
[Settings].. [About tablet].. [Status].. IP address.. 192.168.xxx.xxx

enabled Developer options & System UI Tuner..

set System wide Immersive Mode.. with adb.. see here..
Code:
adb connect 192.168.0.21
adb root
adb connect 192.168.0.21
adb remount
adb shell settings put global policy_control immersive.full=*

to disable System wide Immersive Mode..
Code:
adb shell settings put global policy_control null

caution.. Do Not set PIN / Password on tinker Board..
[Security].. pattern/pin/password.. NOT working.. #############
ie.. setting up a pin.. will cause [Security].. menu not to open..
so.. enable [Unknown sources].. just in case [Security].. setting page fails to open...
####################################################
if [Security Menu].. fails to open.. click here.. to see how to reset [Screen lock].. 
to swipe.. and disable PIN / Password.. ;-]..

disable [Sleep] in [Display Menu] by setting time to [never],
or enabled [Developer options].. then you can set [Stay awake] option.. or.. use..
Code:
adb connect 192.168.1.x
adb shell svc power stayon true
How to prevent an android device from entering sleep (via adb command shell)

Note.. If you need [Sleep] enabled then.. After setting time.. make sure
[When to start screen saver] is set to [Either]..



The Log File Navigator
-----------------------------------------------
use lnav from system on same LAN, to look @ logcat with adb..
Code:
adb connect 192.168.0.21
adb logcat | lnav -t -q

Note.. you can write logcat log file to laptop using [-w]...
Code:
adb logcat | lnav -t -w k247_tb11_AndN712.log

connect laptop with Android Debug Bridge (adb) installed to tinker Board and check settings..
Code:
adb connect 192.168.0.21
adb root
adb connect 192.168.0.21
adb remount
adb shell settings list global
notes.. you can check your settings....
>adb shell settings list global 
>adb shell settings list system 
>adb shell settings list secure

===============================================
now ready to download GAPPS... The Open GApps Project is an open-source 
effort to script the automatic generation of up-to-date Google Apps packages.
================================

Installing Play Store from GAPPs

Download open_gapps-arm-7.1-pico-2018xxxx.zip from GAPPS
Platform:ARM, Android:7.1, Variant:pico

from Debian system/VM connected to tinker Board on same LAN
Code:
sudo apt-get update
sudo apt-get install lzip

Download File: Android Extract.zip to get file extract.sh. 

from Debian system/VM..
###################
sh ./extract.sh your_zip_file.zip
###################
Code:
k247@ubuntutb:~/Downloads$ sh ./extract.sh open_gapps-arm-7.1-pico-20200812.zip
Extracting open_gapps-arm-7.1-pico-20200812.zip to ./GAPPs_package/
Archive:  open_gapps-arm-7.1-pico-20200812.zip
signed by SignApk
extracting: ./GAPPs_package/Core/configupdater-all.tar.lz  
extracting: ./GAPPs_package/Core/defaultetc-common.tar.lz  
extracting: ./GAPPs_package/Core/defaultframework-common.tar.lz  
extracting: ./GAPPs_package/Core/extservicesgoogle-all.tar.lz  
extracting: ./GAPPs_package/Core/extsharedgoogle-all.tar.lz  
extracting: ./GAPPs_package/Core/gmscore-arm.tar.lz  
extracting: ./GAPPs_package/Core/googlebackuptransport-all.tar.lz  
extracting: ./GAPPs_package/Core/googlecontactssync-all.tar.lz  
extracting: ./GAPPs_package/Core/googlefeedback-all.tar.lz  
extracting: ./GAPPs_package/Core/googleonetimeinitializer-all.tar.lz  
extracting: ./GAPPs_package/Core/googlepartnersetup-all.tar.lz  
extracting: ./GAPPs_package/Core/googlepixelconfig-common.tar.lz  
extracting: ./GAPPs_package/Core/gsfcore-all.tar.lz  
extracting: ./GAPPs_package/Core/gsflogin-all.tar.lz  
extracting: ./GAPPs_package/Core/setupwizarddefault-all.tar.lz  
extracting: ./GAPPs_package/Core/setupwizardtablet-all.tar.lz  
extracting: ./GAPPs_package/Core/vending-arm.tar.lz  
extracting: ./GAPPs_package/GApps/calsync-all.tar.lz  
extracting: ./GAPPs_package/GApps/dialerframework-common.tar.lz  
extracting: ./GAPPs_package/GApps/googletts-arm.tar.lz  
extracting: ./GAPPs_package/LICENSE  
extracting: ./GAPPs_package/META-INF/com/google/android/update-binary  
extracting: ./GAPPs_package/META-INF/com/google/android/updater-script  
extracting: ./GAPPs_package/Optional/swypelibs-lib-arm.tar.lz  
extracting: ./GAPPs_package/app_densities.txt  
extracting: ./GAPPs_package/app_sizes.txt  
extracting: ./GAPPs_package/bkup_tail.sh  
extracting: ./GAPPs_package/busybox-arm  
extracting: ./GAPPs_package/g.prop  
extracting: ./GAPPs_package/gapps-remove.txt  
extracting: ./GAPPs_package/installer.sh  
extracting: ./GAPPs_package/tar-arm  
extracting: ./GAPPs_package/unzip-arm  
extracting: ./GAPPs_package/zip-arm  
 inflating: ./GAPPs_package/META-INF/MANIFEST.MF  
 inflating: ./GAPPs_package/META-INF/CERT.SF  
 inflating: ./GAPPs_package/META-INF/CERT.RSA  
Unzip successed.
Extracting .lz file in /Core/
vending-arm/
vending-arm/nodpi/
vending-arm/nodpi/priv-app/
vending-arm/nodpi/priv-app/Phonesky/
vending-arm/nodpi/priv-app/Phonesky/Phonesky.apk
gmscore-arm/
gmscore-arm/nodpi/
gmscore-arm/nodpi/priv-app/
gmscore-arm/nodpi/priv-app/PrebuiltGmsCore/
gmscore-arm/nodpi/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
gmscore-arm/240/
gmscore-arm/240/priv-app/
gmscore-arm/240/priv-app/PrebuiltGmsCore/
gmscore-arm/240/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
gmscore-arm/320/
gmscore-arm/320/priv-app/
gmscore-arm/320/priv-app/PrebuiltGmsCore/
gmscore-arm/320/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
gmscore-arm/480/
gmscore-arm/480/priv-app/
gmscore-arm/480/priv-app/PrebuiltGmsCore/
gmscore-arm/480/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
gsfcore-all/
gsfcore-all/nodpi/
gsfcore-all/nodpi/priv-app/
gsfcore-all/nodpi/priv-app/GoogleServicesFramework/
gsfcore-all/nodpi/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk
gsflogin-all/
gsflogin-all/nodpi/
gsflogin-all/nodpi/priv-app/
gsflogin-all/nodpi/priv-app/GoogleLoginService/
gsflogin-all/nodpi/priv-app/GoogleLoginService/GoogleLoginService.apk
googlecontactssync-all/
googlecontactssync-all/nodpi/
googlecontactssync-all/nodpi/app/
googlecontactssync-all/nodpi/app/GoogleContactsSyncAdapter/
googlecontactssync-all/nodpi/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk
Extracting .lz file in /GApps/
calsync-all/
calsync-all/nodpi/
calsync-all/nodpi/app/
calsync-all/nodpi/app/GoogleCalendarSyncAdapter/
calsync-all/nodpi/app/GoogleCalendarSyncAdapter/GoogleCalendarSyncAdapter.apk
Collecting apk from package to ./APK_file/
Done.
k247@ubuntutb:~/Downloads$

Code:
k247@ubuntutb:~/Downloads$ ll GAPPs_package/
total 2.6M
drwxr-xr-x 6 k247 k247 4.0K Aug 12 22:00 ./
drwxr-xr-x 6 k247 k247 4.0K Aug 12 22:00 ../
-rw-r--r-- 1 k247 k247  560 May  5  2017 app_densities.txt
-rw-r--r-- 1 k247 k247  694 May  5  2017 app_sizes.txt
-rw-r--r-- 1 k247 k247 2.8K May  5  2017 bkup_tail.sh
-rw-r--r-- 1 k247 k247 1.7M May  5  2017 busybox-arm
drwxr-xr-x 7 k247 k247 4.0K Aug 12 22:00 Core/
drwxr-xr-x 3 k247 k247 4.0K Aug 12 22:00 GApps/
-rw-r--r-- 1 k247 k247 2.7K May  5  2017 gapps-remove.txt
-rw-r--r-- 1 k247 k247  179 May  5  2017 g.prop
-rw-r--r-- 1 k247 k247 109K May  5  2017 installer.sh
-rw-r--r-- 1 k247 k247 2.0K May  5  2017 LICENSE
drwxr-xr-x 3 k247 k247 4.0K Aug 12 22:00 META-INF/
drwxr-xr-x 2 k247 k247 4.0K Aug 12 22:00 Optional/
-rw-r--r-- 1 k247 k247 418K May  5  2017 tar-arm
-rw-r--r-- 1 k247 k247 139K May  5  2017 unzip-arm
-rw-r--r-- 1 k247 k247 201K May  5  2017 zip-arm
k247@ubuntutb:~/Downloads$

Code:
k247@ubuntutb:~/Downloads$ ll APK_file/
total 93M
drwxr-xr-x 2 k247 k247 4.0K Aug 12 22:00 ./
drwxr-xr-x 6 k247 k247 4.0K Aug 12 22:00 ../
-rw-r--r-- 1 k247 k247 2.5M Feb 28  2008 GoogleCalendarSyncAdapter.apk
-rw-r--r-- 1 k247 k247 1.3M Feb 28  2008 GoogleContactsSyncAdapter.apk
-rw-r--r-- 1 k247 k247 8.1M Feb 28  2008 GoogleLoginService.apk
-rwxr-xr-x 1 k247 k247 3.9M Feb 28  2008 GoogleServicesFramework.apk*
-rw-r--r-- 1 k247 k247  23M Feb 28  2008 Phonesky.apk
-rw-r--r-- 1 k247 k247  55M Feb 28  2008 PrebuiltGmsCore.apk
k247@ubuntutb:~/Downloads$

===============================================
now ready to use "adb push" to copy the APK_files - Google Play Services and 
Google Services Framework apks to /system/priv-app
================================

from Debian system/VM..
change to APK File folder & connect with adb to tinker Board..
Code:
cd APK_file/
adb connect 192.168.0.21
adb root
adb connect 192.168.0.21
adb remount

check adb device connection..
Code:
k247@ubuntutb:~/Downloads/APK_file$ adb devices
List of devices attached
192.168.0.21:5555 device

k247@ubuntutb:~/Downloads/APK_file$ adb devices -l
List of devices attached
192.168.0.21:5555      device product:rk3288 model:Tinker_Board device:rk3288 transport_id:2

k247@ubuntutb:~/Downloads/APK_file$

now.. push APK files..& reboot..
Code:
adb push GoogleLoginService.apk /system/priv-app/
adb push GoogleServicesFramework.apk /system/priv-app/
adb push Phonesky.apk /system/priv-app/
adb push PrebuiltGmsCore.apk /system/priv-app/
adb push GoogleCalendarSyncAdapter.apk /system/priv-app/
adb push GoogleContactsSyncAdapter.apk /system/priv-app/
adb reboot

Download File: Android Fix permissions.zip to get file fix_permissions.sh.

from Debian system/VM..
connect with adb & push fix_permissions.sh file to /sdcard/ on tinker Board..
#
   adb connect 192.168.0.21
   adb root
   adb connect 192.168.0.21
   adb remount
#
adb push fix_permissions.sh /sdcard/
Code:
k247@ubuntutb:~/Downloads$ adb push fix_permissions.sh /sdcard/
fix_permissions.sh: 1 file pushed. 0.5 MB/s (3403 bytes in 0.006s)
k247@ubuntutb:~/Downloads$

########################
adb shell sh /sdcard/fix_permissions.sh
########################
Code:
k247@ubuntutb:~/Downloads$ adb shell sh /sdcard/fix_permissions.sh
> pm grant com.google.android.gsf.login android.permission.READ_CONTACTS
> pm grant com.google.android.gsf.login android.permission.WRITE_CONTACTS
> pm grant com.google.android.gsf.login android.permission.GET_ACCOUNTS
> pm grant com.google.android.gsf.login android.permission.READ_PHONE_STATE
> pm grant com.google.android.gsf.login android.permission.CALL_PHONE
> pm grant com.google.android.gsf.login android.permission.READ_CALL_LOG
> pm grant com.google.android.gsf.login android.permission.WRITE_CALL_LOG
> pm grant com.google.android.gsf.login android.permission.ADD_VOICEMAIL
> pm grant com.google.android.gsf.login android.permission.USE_SIP
> pm grant com.google.android.gsf.login android.permission.PROCESS_OUTGOING_CALLS
> pm grant com.google.android.googlequicksearchbox android.permission.READ_CALENDAR
> pm grant com.google.android.googlequicksearchbox android.permission.WRITE_CALENDAR
> pm grant com.google.android.googlequicksearchbox android.permission.GET_ACCOUNTS
> pm grant com.google.android.googlequicksearchbox android.permission.CAMERA
> pm grant com.google.android.googlequicksearchbox android.permission.READ_CONTACTS
> pm grant com.google.android.googlequicksearchbox android.permission.WRITE_CONTACTS
> pm grant com.google.android.googlequicksearchbox android.permission.GET_ACCOUNTS
> pm grant com.google.android.googlequicksearchbox android.permission.ACCESS_FINE_LOCATION
> pm grant com.google.android.googlequicksearchbox android.permission.ACCESS_COARSE_LOCATION
> pm grant com.google.android.googlequicksearchbox android.permission.RECORD_AUDIO
> pm grant com.google.android.googlequicksearchbox android.permission.READ_PHONE_STATE
> pm grant com.google.android.googlequicksearchbox android.permission.CALL_PHONE
> pm grant com.google.android.googlequicksearchbox android.permission.READ_CALL_LOG
> pm grant com.google.android.googlequicksearchbox android.permission.WRITE_CALL_LOG
> pm grant com.google.android.googlequicksearchbox android.permission.ADD_VOICEMAIL
> pm grant com.google.android.googlequicksearchbox android.permission.USE_SIP
> pm grant com.google.android.googlequicksearchbox android.permission.PROCESS_OUTGOING_CALLS
> pm grant com.google.android.googlequicksearchbox android.permission.SEND_SMS
> pm grant com.google.android.googlequicksearchbox android.permission.RECEIVE_SMS
> pm grant com.google.android.googlequicksearchbox android.permission.READ_SMS
> pm grant com.google.android.googlequicksearchbox android.permission.RECEIVE_WAP_PUSH
> pm grant com.google.android.googlequicksearchbox android.permission.RECEIVE_MMS
> pm grant com.google.android.googlequicksearchbox android.permission.READ_CELL_BROADCASTS
> pm grant com.google.android.googlequicksearchbox android.permission.READ_EXTERNAL_STORAGE
> pm grant com.google.android.googlequicksearchbox android.permission.WRITE_EXTERNAL_STORAGE
> pm grant com.google.android.gms android.permission.BODY_SENSORS
> pm grant com.google.android.gms android.permission.READ_CALENDAR
> pm grant com.google.android.gms android.permission.WRITE_CALENDAR
> pm grant com.google.android.gms android.permission.GET_ACCOUNTS
> pm grant com.google.android.gms android.permission.CAMERA
> pm grant com.google.android.gms android.permission.READ_CONTACTS
> pm grant com.google.android.gms android.permission.WRITE_CONTACTS
> pm grant com.google.android.gms android.permission.GET_ACCOUNTS
> pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
> pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION
> pm grant com.google.android.gms android.permission.RECORD_AUDIO
> pm grant com.google.android.gms android.permission.READ_PHONE_STATE
> pm grant com.google.android.gms android.permission.CALL_PHONE
> pm grant com.google.android.gms android.permission.READ_CALL_LOG
> pm grant com.google.android.gms android.permission.WRITE_CALL_LOG
> pm grant com.google.android.gms android.permission.ADD_VOICEMAIL
> pm grant com.google.android.gms android.permission.USE_SIP
> pm grant com.google.android.gms android.permission.PROCESS_OUTGOING_CALLS
> pm grant com.google.android.gms android.permission.SEND_SMS
> pm grant com.google.android.gms android.permission.RECEIVE_SMS
> pm grant com.google.android.gms android.permission.READ_SMS
> pm grant com.google.android.gms android.permission.RECEIVE_WAP_PUSH
> pm grant com.google.android.gms android.permission.RECEIVE_MMS
> pm grant com.google.android.gms android.permission.READ_CELL_BROADCASTS
> pm grant com.google.android.gms android.permission.READ_EXTERNAL_STORAGE
> pm grant com.google.android.gms android.permission.WRITE_EXTERNAL_STORAGE
> pm grant com.google.android.apps.gcs android.permission.READ_CONTACTS
> pm grant com.google.android.apps.gcs android.permission.WRITE_CONTACTS
> pm grant com.google.android.apps.gcs android.permission.GET_ACCOUNTS
> pm grant com.google.android.apps.gcs android.permission.ACCESS_FINE_LOCATION
> pm grant com.google.android.apps.gcs android.permission.ACCESS_COARSE_LOCATION
> pm grant com.google.android.syncadapters.contacts android.permission.READ_CONTACTS
> pm grant com.google.android.syncadapters.contacts android.permission.WRITE_CONTACTS
> pm grant com.google.android.syncadapters.contacts android.permission.GET_ACCOUNTS
> pm grant com.google.android.syncadapters.calendar android.permission.READ_CALENDAR
> pm grant com.google.android.syncadapters.calendar android.permission.WRITE_CALENDAR
> pm grant com.google.android.syncadapters.calendar android.permission.GET_ACCOUNTS
> pm grant com.google.android.backuptransport android.permission.READ_CONTACTS
> pm grant com.google.android.backuptransport android.permission.WRITE_CONTACTS
> pm grant com.google.android.backuptransport android.permission.GET_ACCOUNTS
> pm grant com.google.android.gsf android.permission.READ_CONTACTS
> pm grant com.google.android.gsf android.permission.WRITE_CONTACTS
> pm grant com.google.android.gsf android.permission.GET_ACCOUNTS
> pm grant com.google.android.gsf android.permission.READ_PHONE_STATE
> pm grant com.google.android.gsf android.permission.CALL_PHONE
> pm grant com.google.android.gsf android.permission.READ_CALL_LOG
> pm grant com.google.android.gsf android.permission.WRITE_CALL_LOG
> pm grant com.google.android.gsf android.permission.ADD_VOICEMAIL
> pm grant com.google.android.gsf android.permission.USE_SIP
> pm grant com.google.android.gsf android.permission.PROCESS_OUTGOING_CALLS
> pm grant com.google.android.setupwizard android.permission.READ_CONTACTS
> pm grant com.google.android.setupwizard android.permission.WRITE_CONTACTS
> pm grant com.google.android.setupwizard android.permission.GET_ACCOUNTS
> pm grant com.google.android.setupwizard android.permission.READ_PHONE_STATE
> pm grant com.google.android.setupwizard android.permission.CALL_PHONE
> pm grant com.google.android.setupwizard android.permission.READ_CALL_LOG
> pm grant com.google.android.setupwizard android.permission.WRITE_CALL_LOG
> pm grant com.google.android.setupwizard android.permission.ADD_VOICEMAIL
> pm grant com.google.android.setupwizard android.permission.USE_SIP
> pm grant com.google.android.setupwizard android.permission.PROCESS_OUTGOING_CALLS
> pm grant com.android.vending android.permission.READ_CONTACTS
> pm grant com.android.vending android.permission.WRITE_CONTACTS
> pm grant com.android.vending android.permission.GET_ACCOUNTS
> pm grant com.android.vending android.permission.READ_PHONE_STATE
> pm grant com.android.vending android.permission.CALL_PHONE
> pm grant com.android.vending android.permission.READ_CALL_LOG
> pm grant com.android.vending android.permission.WRITE_CALL_LOG
> pm grant com.android.vending android.permission.ADD_VOICEMAIL
> pm grant com.android.vending android.permission.USE_SIP
> pm grant com.android.vending android.permission.PROCESS_OUTGOING_CALLS
> pm grant com.android.vending android.permission.ACCESS_FINE_LOCATION
> pm grant com.android.vending android.permission.ACCESS_COARSE_LOCATION
> pm grant com.android.vending android.permission.SEND_SMS
> pm grant com.android.vending android.permission.RECEIVE_SMS
> pm grant com.android.vending android.permission.READ_SMS
> pm grant com.android.vending android.permission.RECEIVE_WAP_PUSH
> pm grant com.android.vending android.permission.RECEIVE_MMS
> pm grant com.android.vending android.permission.READ_CELL_BROADCASTS
k247@ubuntutb:~/Downloads$

[now on tinker board..
Grant all permissions for Google Play service and Google Play Store, you can find them from Settings -> Apps]


-----
Then.. Very important !!!...
You MUST factory reset Tinker Board....
[Settings] [Backup & reset] [Factory data reset] [RESET TABLET]
========================================;-]..
it's a pain having to setup the tinker board again.. but I end up with a much
stable install with no errors...

clear cache.. [Settings].. [Storage].. click on [Cached data] to clear cached data..
go to [Settings].. [Apps].. click on each of the apps and check the Permissions are ALL [ON]..
be sure to also check the two [Additional permissions] in [Google Services Framework]...
also make sure [Draw over other apps] & [Modify system settings] is set to [Yes] if available.. 

Restart tinker board in recovery  to Wipe Cache Partition...
adb connect 192.168.0.21
adb reboot recovery
Note.. use keyboard arrow keys to selected [Wipe cache partition]... [Yes]...
then... select [reboot system]... ;-]...
################################

Note.. wait a bit to check to see if you are getting any play service errors...
if not.. then its time to open the [Play Store]...;-]... and enter your Google Account details.. and accept terms ;-]...
===============================================================================
Note.. [Play Store].. should be running.. go to [Setting].. of [Play store].. 
click on [Play Store version]... it should say..
Google Play Store is up to date.. ;-]...
========================================
Restart tinker board..

Note.. wait a bit to check to see if there is any play service errors...
if not.. open the [Play Store]... search Google Play.. for Gmail and see if it will Install..
;-]..----------------------------------------------------------------------------------------
open [Gmail] from applications.. and check its working...
open  the [Play Store].. check [My apps & games].. [INSTALLED].. to see its listed.. ]]]]].......
and then check [LIBRARY].. all your previously installed apps.. ;-].. 
################################################################################
Google Play Store Now installed and working with no errors ;-]..
------------------------------------------------------------------------------
hope it helps,
k,

TinkerOS_Android 7 Nougat v14.4.0.5 with Google Play Store

next> Rooting Tinker Board with Magisk Manager Latest Version 7.5.1
Reply
#2
Capture Picture / Record Video with Screencap / Screenrecord using ADB


AOSP (Android Open Source Project)  / 
TinkerOS_Android 7 Nougat v14.4.0.5 is userdebug build configuration..

The BUILDTYPE is one of the following..
  • user -  Limited access; suited for production
  • userdebug - Like user but with root access and debug capability; preferred for debugging
  • eng - Development configuration with additional debugging tools
        "...The userdebug build should behave the same as the user build, 
         with the ability to enable additional debugging that normally violates 
         the security model of the platform. This makes the userdebug build 
         good for user testing with greater diagnosis capabilities...."

a quick google search for " screencap screenrecord adb " got me to
Capture Picture and Record Video using ADB

from system/VM on same LAN as tinker board..
#
   adb connect 192.168.0.21
   adb root
   adb connect 192.168.0.21
   adb remount
   adb shell
#
Code:
rk3288:/ # which screencap
/system/bin/screencap
rk3288:/ # which screenrecord
/system/bin/screenrecord
rk3288:/ #

Screen Capture
Code:
adb shell screencap -p > myfile.jpg
"Just use the above command, to capture the image on your phone to myfile.jpg."

soooo.... to capture tinker board screenshots on LAN connected system/VM..
Code:
k247@ubuntutb:~/Downloads$ adb shell screencap -p -d 0 > Screenshots/Screenshot_k01.png
k247@ubuntutb:~/Downloads$ adb shell screencap -p -d 0 > Screenshots/Screenshot_k02.png
k247@ubuntutb:~/Downloads$ ll Screenshots/
total 3.2M
drwxr-xr-x 2 k247 k247 4.0K Aug 13 08:14 ./
drwxr-xr-x 7 k247 k247 4.0K Aug 13 08:12 ../
-rw-r--r-- 1 k247 k247  23K Aug 13 08:13 Screenshot_k01.png
-rw-r--r-- 1 k247 k247 3.2M Aug 13 08:14 Screenshot_k02.png
k247@ubuntutb:~/Downloads$
nice.. ;-]..

Screen Record
Code:
adb shell screenrecord /sdcard/video.mp4
"To record the video, you can’t straight away record the file onto your computer. 
You need to store it in your phone sdcard first..."

for videos.. found a workaround for the 3 mins time limit.. but I had to also 
disable hardware Codec accelerations in kodi & Vlc.. 
Code:
adb shell "\
screenrecord --bit-rate 6M --size 1920x1080 --time-limit 180 /sdcard/Screenshots/Screenvideo_K01.mp4; \
screenrecord --bit-rate 6M --size 1920x1080 --time-limit 180 /sdcard/Screenshots/Screenvideo_K02.mp4; \
screenrecord --bit-rate 6M --size 1920x1080 --time-limit 180 /sdcard/Screenshots/Screenvideo_K03.mp4; \
screenrecord --bit-rate 6M --size 1920x1080 --time-limit 180 /sdcard/Screenshots/Screenvideo_K04.mp4; \
screenrecord --bit-rate 6M --size 1920x1080 --time-limit 180 /sdcard/Screenshots/Screenvideo_K05.mp4"
this makes 5 X 3 mins video files that can be mkvmerge for a 15 mins video file ]]]].....
[bit-rate 6M: size 1920x1080: 24 fps] / [bit-rate 8M : size 1920x1080: 30 fps] /  [bit-rate 16M : size 1920x1080: 60 fps]

sooooo.. just adb pull the 5 video files to LAN connected system/VM &
Code:
mkvmerge -o Screenvideo_K_15mins.mp4 \
Screenvideo_K01.mp4 \+ \
Screenvideo_K02.mp4 \+ \
Screenvideo_K03.mp4 \+ \
Screenvideo_K04.mp4 \+ \
Screenvideo_K05.mp4

note.. make sure to.. 
Code:
sudo apt install vlc ffmpeg mkvtoolnix
on system/VM... ]]]]......


Screen Stream
now something to try, once adb connected from system/VM ...
Code:
adb exec-out "while true; do screenrecord --bit-rate=6M --output-format=h264 --size 1920x1080 --time-limit 180 -; done" | ffplay -framerate 30 -framedrop -bufsize 6M -
39 seconds latter.. 
.. ;-].. pipe: window opens... streaming tinker board screen..
[Image: ObRwUTG.jpg]
---------------
hope it helps,
k,
Reply
#3
Rooting Tinker Board with Magisk Manager Latest Version 7.5.1

following: [Howto] Root TB Android Nougat with Magisk

to root TinkerOS_Android 7 Nougat v14.4.0.5...

connect USB cable to OTG micro USB port on tinker board and power the tinker board via GPIO pins ;-]..

[Image: PNUfAP4.jpg:]

note.. I'm using laptop with Ubuntu Mate 18.04, adb & rkflashtool installed,
connected USB-A to tinker board micro USB port & tinker board powered via
GPIO pins 4 & 6.......

you will need to download.. lobo's boot.img file & Magisk Manager Latest Version 7.5.1
to tinker board & install Magisk Manager 7.5.1.. 

run Magisk Manager.. 
Magisk... click on [install].. [Download Zip Only].. then again..
Magisk... click on [install].. [Select and Patch a File].. & use file manager to select boot.img file..
 
then follow.. 
rooting TinkerOS_Android 7 Nougat V14.3.2.82 using lobo's boot.img file...


I still haven't figured out how to make boot.img file..
I used rkflashtool... to make file.. 
it did not work with [Select and Patch a File].. tbc.. ]]]....

----------------
hope it helps,
k,

next> Termux with auto-starting SSH server & Root shell
Reply
#4
Termux with auto-starting SSH server & Root shell


So.. Why Termux?
well..  AOSP (Android Open Source Project) / TinkerOS_Android 7 Nougat V14.4.0.5..
doesn't come with a terminal App.. but.. this userdebug build configuration is primarily used for developing Android
and comes with su binary and adb enabled by default.. The su binary in this build is only accessible by certain uid..
root & shell, I believe.. adb can be used to connect to mksh [MirBSD Korn Shell LINUX interactive user interface]
via USB / Serial or Network tcp/ip [LAN/Wifi]..

What is Termux?
Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required.
A minimal base system is installed automatically - additional packages are available using the APT package manager.
here are some links that might help...
----------------------------------------------
Termux turns Android into a Linux development environment
Basic Commands Using Termux
Guide: Installing and Running a GNU/Linux Environment on Any Android Device
How to install DAT on mobile under Termux
Unveil full workstation environment on Android with Termux
Termux PHP Tutorial: Steps to Have the Full Setup for Using Termux PHP
How does Termux work on Android?
Mobile Ops and Tablet Terraform with Termux
PRoot / Emulate chroot, bind mount and binfmt_misc for non-root users
----------------------------------------------------------------------------------------

Termux Setup on tinker board with root shell
-----------------------------------------------------------------------------------
after you install the App form Play Store.. or download Termux_v0.98_apkpure.com.apk  
and install using file manger.. you also need to find and download 
su binary that has features like [su --auto-daemon]..

the default su installed..
Code:
rk3288:/ # su --help
usage: su [UID[,GID[,GID2]...]] [COMMAND [ARG...]]

Switch to WHO (default 'root') and run the given command (default sh).

where WHO is a comma-separated list of user, group,
and supplementary groups in that order.
rk3288:/ #

if you fully root tinker board using Magisk Manager Latest Version 7.5.1
Code:
rk3288:/ # su --help
MagiskSU 20.4(20400)

Usage: su [options] [-] [user [argument...]]

Options:
 -c, --command COMMAND         pass COMMAND to the invoked shell
 -h, --help                    display this help message and exit
 -, -l, --login                pretend the shell to be a login shell
 -m, -p,
 --preserve-environment        preserve the entire environment
 -s, --shell SHELL             use SHELL instead of the default /system/bin/sh
 -v, --version                 display version number and exit
 -V                            display version code and exit
 -mm, -M,
 --mount-master                force run in the global mount namespace
rk3288:/ #
this is recommended by lobo.. [Howto] Root TB Android Nougat with Magisk  ;-]..

Termux pkg Update & Install
[Image: Wdt2XKE.png]
first.. open termux App, update & install Linux apps..
Code:
pkg upgrade
pkg install root-repo
pkg install x11-repo
pkg install openssh mosh
pkg install nano micro htop mc tmux screen tsu coreutils ncurses-utils util-linux net-tools grep pcre tree rsync mlocate
pkg install termux-api php termux-exec termux-tools proot termux-services
pkg install git wget curl clang python python2 ecj dx build-essential perl w3m file man texinfo
pkg install aapt ltrace cmatrix
termux-setup-storage
mkdir /sdcard/php
exit termux, clear from Recent List & re-start termux App..

install Termux: API
This addon exposes device functionality as API to command line programs in Termux..
Code:
bash:5.0][u0_a133]@~:$ termux-
termux-audio-info            termux-dialog                termux-media-scan            termux-share                 termux-tts-engines
termux-battery-status        termux-download              termux-microphone-record     termux-sms-inbox             termux-tts-speak
termux-brightness            termux-fingerprint           termux-notification          termux-sms-list              termux-usb
termux-call-log              termux-fix-shebang           termux-notification-list     termux-sms-send              termux-vibrate
termux-camera-info           termux-info                  termux-notification-remove   termux-speech-to-text        termux-volume
termux-camera-photo          termux-infrared-frequencies  termux-open                  termux-storage-get           termux-wake-lock
termux-change-repo           termux-infrared-transmit     termux-open-url              termux-telephony-call        termux-wake-unlock
termux-chroot                termux-job-scheduler         termux-reload-settings       termux-telephony-cellinfo    termux-wallpaper
termux-clipboard-get         termux-keystore              termux-reset                 termux-telephony-deviceinfo  termux-wifi-connectioninfo
termux-clipboard-set         termux-location              termux-sensor                termux-toast                 termux-wifi-enable
termux-contact-list          termux-media-player          termux-setup-storage         termux-torch                 termux-wifi-scaninfo
bash:5.0][u0_a133]@~:$ termux-

a quick test of termux:API...
Code:
termux-toast hi..... there...... \:-]....

termux-info
Code:
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://dl.bintray.com/termux/termux-packages-24/ stable main
# game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
# science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable
# root-repo (sources.list.d/root.list)
deb https://dl.bintray.com/grimler/termux-root-packages-24 root stable
# x11-repo (sources.list.d/x11.list)
deb https://dl.bintray.com/xeffyr/x11-packages x11 main
Updatable packages:
dash/stable 0.5.11.2 arm [upgradable from: 0.5.11.1]
gpgv/stable 2.2.22 arm [upgradable from: 2.2.21]
htop/stable 3.0.0 arm [upgradable from: 2.2.0-2]
libgpg-error/stable 1.39 arm [upgradable from: 1.38]
libuv/stable 1.39.0 arm [upgradable from: 1.38.1]
Android version:
7.1.2
Kernel build information:
Linux localhost 4.4.112 #1 SMP PREEMPT Fri Dec 27 09:20:07 CST 2019 armv7l Android
Device manufacturer:
rockchip
Device model:
Tinker Board

setup Touch Keyboard - Extra Keys Row(s)
mkdir ~/.termux
nano ~/.termux/termux.properties
Code:
extra-keys = [ \
['ESC','|','/','HOME','UP','END','PGUP','DEL'], \
['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','BKSP'] \
]
exit termux, clear from Recent List & re-start termux App..


Setup sshd for password-less login.. on port 8022
------------------------------------------------------
so you will need to copy id_rsa.pub of connecting system..
to.. ~/.ssh/authorized_keys... on tinker board..

on connecting system, this..
Code:
cd ~/.ssh
ssh-keygen -t rsa -b 2048 -f id_rsa
generates private RSA key with 2048 bit key length and saves it to file `id_rsa`

Example.. allow my system @ 192.168.0.55 to connect to tinker board..
Code:
ssh k247@192.168.0.55 'cat ~/.ssh/id_rsa.pub' | cat >> ~/.ssh/authorized_keys
----- enter pass -----
https://wiki.termux.com/wiki/Remote_Access

from tinker board Termux, Edit file
nano $PREFIX/etc/ssh/sshd_config
Code:
...
PasswordAuthentication no
...
exit termux, clear from Recent List & re-start termux App..


to Auto Start sshd..
you do not need to add sshd to ~/.bashrc as termux-services in installed..

to start sshd as service..
Code:
sv up sshd
sv-enable sshd
note.. Enabling a service will make it autostart.. ;-]..

now... need to find a way 
to auto run Termux @ boot...

option [1]
install & open AutoStart - No root and add termux App twice..  
I had to add it twice for termux to start with session 1..
[Image: daJvojx.png]
also.. it can take ups 2-4 mins before you see session 1.. ;-[...  

option [2]
thanks to doggedly - AUTOSTART, START ON BOOT SCRIPT?
from system/VM on same LAN as tinker board..
Code:
adb connect 192.168.0.21
adb connect root
adb connect 192.168.0.21
adb remount
Note... this will give you (read,write) for /system but not /......

make file.. 
nano init.asus.sh
Code:
sleep 90&& ./system/etc/init.asus.autostart.sh&
push file to tinker board..
Code:
adb push init.asus.sh /system/etc/init.asus.sh

then make file.. 
nano init.asus.autostart.sh
Code:
#!/system/bin/sh
sleep 05&& am start -n com.termux/com.termux.HomeActivity&
sleep 30&& am start -n com.termux/com.termux.app.TermuxActivity&
sleep 30&& am start -n com.termux/com.termux.HomeActivity&
sleep 30&& am start -n com.termux/com.termux.app.TermuxActivity&
push file to tinker board..
Code:
adb push init.asus.autostart.sh /system/etc/init.asus.autostart.sh
adb shell chmod 0755 /system/etc/init.asus.autostart.sh
adb shell
now... Termux runs after boot with Session 1 ;-]...

Code:
rk3288:/ # ll /system/etc/init.asus*
-rwxr-xr-x 1 root root 265 2020-08-26 08:04 /system/etc/init.asus.autostart.sh*
-rw-r--r-- 1 root root  48 2020-08-26 08:03 /system/etc/init.asus.sh
rk3288:/ #
stat of files..
Code:
rk3288:/ # stat /system/etc/init.asus*
 File: `/system/etc/init.asus.autostart.sh'
 Size: 265      Blocks: 8       IO Blocks: 4096        regular file
Device: b30ah/45834d     Inode: 1898     Links: 1
Access: (755/-rwxr-xr-x)        Uid: (0/    root)       Gid: (0/    root)
Access: 2020-08-26 08:04:37.000000000
Modify: 2020-08-26 08:04:37.000000000
Change: 2020-08-26 08:05:19.490714839
 File: `/system/etc/init.asus.sh'
 Size: 48       Blocks: 8       IO Blocks: 4096        regular file
Device: b30ah/45834d     Inode: 1897     Links: 1
Access: (644/-rw-r--r--)        Uid: (0/    root)       Gid: (0/    root)
Access: 2020-08-26 08:03:52.000000000
Modify: 2020-08-26 08:03:52.000000000
Change: 2020-08-26 08:04:14.737375000
rk3288:/ #
also... it can take ups 2-4 mins before you see session 1..

this works.. but.. its still a guessing game for me as to the timing & 
boot order of Init .rc Files.. more work to follow on..
Android Init Language & Digging Into Android Startup... tbc...

note.. "2 Ways to find appPackage and appActivity name of your App"
apps to help with figuring out Activity Names..
Apk InfoQuickShortcutMaker on Google Play Store..


continue with mksh config..

note.. ..once in root Android shell (mksh).. to make / (read,write)...
Code:
rk3288:/ # cat /proc/mounts | grep root
rootfs / rootfs ro,seclabel,size=1013416k,nr_inodes=119724 0 0
rk3288:/ #
rk3288:/ # mount -o rw,remount /
rk3288:/ #
rk3288:/ # cat /proc/mounts | grep root
rootfs / rootfs rw,seclabel,size=1013416k,nr_inodes=119724 0 0
rk3288:/ #

Note.. add aliases for adb root shell in /system/etc/mkshrc...
Code:
# Copyright (c) 2010, 2012, 2013, 2014
# Thorsten Glaser <tg@mirbsd.org>
# This file is provided under the same terms as mksh.
#-
# Minimal /system/etc/mkshrc for Android
#
# Support: https://launchpad.net/mksh

: ${HOSTNAME:=$(getprop ro.product.device)}
: ${HOSTNAME:=android}
: ${TMPDIR:=/data/local/tmp}
export HOSTNAME TMPDIR

if (( USER_ID )); then PS1='$'; else PS1='#'; fi
PS4='[$EPOCHREALTIME] '; PS1='${|
local e=$?

(( e )) && REPLY+="$e|"

return $e
}$HOSTNAME:${PWD:-?} '"$PS1 "
#
# set aliases....
alias ll='ls -Flah'
alias lla='ls -AFlh'
alias lld='ls -lah -d */'
alias l='ls -CF'
alias la='ls -ACF'
alias cls='clear'
alias ..='cd ..'
alias ,,='cd -'
#
# set termux env vars...
#export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
#export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
export PREFIX=/data/data/com.termux/files/usr
#
alias sush='su --preserve-environment -c LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so PREFIX=/data/data/com.termux/files/usr PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets HOME=/data/data/com.termux/files/home/.suroot /system/bin/sh -l'
#
alias subash='su --preserve-environment -c LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so PREFIX=/data/data/com.termux/files/usr PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets HOME=/data/data/com.termux/files/home/.suroot PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[31m\]#\[\e[m\]" SHELL=/data/data/com.termux/files/usr/bin/bash /data/data/com.termux/files/usr/bin/bash -l'
#
alias expath='export PATH=$PATH:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets'
#
better to adb pull /system/etc/mkshrc & edit file on system/VM first.. before you adb push it back to tinker board..

to open Android root sh (Bourne shell) with LD_LIBRARY_PATH set. so to run Linux apps..
adb connect into shell 
and run alias 
sush

to open Android root bash shell with LD_LIBRARY_PATH set... 
adb connect into shell 
and run alias 
subash

& to run Linux apps in mksh..
adb connect into shell 
and run alias
expath

note.. never install or update with pkg 
from adb connect shell ;-].....

if you ever find folders or files not owned by termux user u0_a60....
then you can fix by.. 
Code:
cd "folderName"

sudo chown -R u0_a60:u0_a60 .

cd ..

sudo chown u0_a60:u0_a60 "folderName"
this I needed to do for /data/data/com.termux/files/usr folder after I ran 
> sudo apt-get update, &
> sudo pkg update.... by mistake [[[.....
NEVER EVER run pkg update as root ;-]...

restart tinker board so to continue to configure... 
Code:
adb reboot


Setup termux Bash environment variables..
open Termux.. and create files..
nano .bashrc
Code:
#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

# If not running interactively, don't do anything
#case $- in
#    *i*) ;;
#      *) return;;
#esac
#

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
#HISTCONTROL=ignoreboth
HISTCONTROL=ignoreboth:erasedups

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar


# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
  xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
  if [ -x /data/data/com.termux/files/usr/bin/tput ] && tput setaf 1 >&/dev/null; then
      # We have color support; assume it's compliant with Ecma-48
      # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
      # a case would tend to support setf rather than setaf.)
      color_prompt=yes
  else
      color_prompt=
  fi
fi

#set prompt......................
#export PS1="\s\v\u\W\\$ "
#export PS1="\s:\v][\u]@\W:\\$ "
#export PS1="\s:\v][\u]@\w:\\$ "
#Bash:Virgin][User]@Home : ;-].... http://ezprompt.net
# If id command returns zero, you have root access..
if [ $(id -u) -eq 0 ];
then # you are root, set red colour prompt & set Home root Dir..
 #PS1="\\[$(tput setaf 1)\\]\\u@\\h:\\w #\\[$(tput sgr0)\\]"
 #PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[37m\] \[\e[m\] "
 #PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[37m\] \[\e[m\]\[\e[31m\]#\[\e[m\] "
 PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[31m\]#\[\e[m\] "
#  export HOME=/data/data/com.termux/files/root
  export HOME=/data/data/com.termux/files/home/.suroot
else # normal
 #PS1="[\\u@\\h:\\w] $ "
 PS1="\s:\v][\u]@\w:\\$ "
fi

# enable color support of ls and also add handy aliases
if [ -x /data/data/com.termux/files/usr/bin/dircolors ]; then
  test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  alias ls='ls --color=auto'
  #alias dir='dir --color=auto'
  #alias vdir='vdir --color=auto'
  alias grep='grep --color=auto'
  alias fgrep='fgrep --color=auto'
  alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
#alias ll='ls -alF'
#alias ls='ls --color=auto'
alias ll='ls -Flah'
alias la='ls -ACF'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

#export LANG=en_GB.UTF-8
#export LANGUAGE=en_GB:en
#export LC_ALL=en_GB.UTF-8
# these android setting environment variable don't seem to be working..

#
# add kPATH/bin to $PATH... only once...
if [ "$SHLVL" = 1 ] && [ $(id -u) -ne 0 ]; then     # check for 1st shell and not root....
 [[ ":$PATH:" != *":/data/data/com.termux/files/home/kPATH/bin:"* ]] && PATH="/data/data/com.termux/files/home/kPATH/bin:${PATH}"
 #export PATH=$PATH:/data/data/com.termux/files/home/kPATH/bin
 export PATH=$PATH
fi
#

#
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
  . ~/.bash_aliases
fi
#
# as termux-services is installed.. you do not need to add sshd here...##########
# start ssh server...
#/data/data/com.termux/files/usr/bin/sshd
#---------------------------------------
#if ! pgrep -f "termux-chroot" >/dev/null ; then echo "[Starting chroot...]" && termux-chroot; else echo "[chroot is running]"; fi
#if ! pgrep "sshd" >/dev/null ; then echo "[Starting sshd...]" && sshd && echo "[OK]"; else echo "[ssh is running]"; fi
#----------------------------------------------------------------------------------------------------------------------
# this does not work well.. even though you can clear recent apps and close termux.. ssh connection keep running in chroot but
# gets closed after 5-10mins.. remember to keep termux running and only clear reacent apps.. also.. tsu runs bash twice??
# it can get pretty funky... needs lots more work.. tbc..

# Customizing colors - directory that is world writable
export LS_COLORS=$LS_COLORS:'ow=30;42'

#function to delete range of history lines...
#ie... history-del 1049 1051
history-del(){
 for h in $(seq $1 $2 | tac); do
   history -d $h
 done
 history -d $(history | tail -1 | awk '{print $1}')
 }
#https://stackoverflow.com/questions/14750650/how-to-delete-history-of-last-10-commands-in-shell

nano .bash_logout
Code:
# ~/.bash_logout: executed by bash(1) when login shell exits.

history -a
history -w

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
 [ -x /data/data/com.termux/files/usr/bin/clear ] && /data/data/com.termux/files/usr/bin/clear
fi

nano .bash_aliases
Code:
### aliases file....
#
#
### DIRS ###
#alias d="cd ~/storage/downloads"
#alias gh="cd ~/GitHub"
#alias h="cd ~"
#alias t="cd ~/temp"
alias ..='cd ..'
alias ,,='cd -'
alias lla='ls -AFlh'
alias lld='ls -lah -d */'
#
alias cls='clear'
#

nano .profile
Code:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

HISTCONTROL=erasedups
PROMPT_COMMAND='history -a'

# if running bash
if [ -n "$BASH_VERSION" ]; then
   # include .bashrc if it exists
   if [ -f "$HOME/.bashrc" ]; then
       . "$HOME/.bashrc"
   fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
   PATH="$HOME/bin:$PATH"
fi

now exit termux App & restart tinker board... ;-]...

open termux App.. & list home folder with alias >ll..
Code:
Welcome to Termux!

Wiki:            https://wiki.termux.com
Community forum: https://termux.com/community
Gitter chat:     https://gitter.im/termux/termux
IRC channel:     #termux on freenode

Working with packages:

* Search packages:   pkg search <query>
* Install a package: pkg install <package>
* Upgrade packages:  pkg upgrade

Subscribing to additional repositories:

* Root:     pkg install root-repo
* Unstable: pkg install unstable-repo
* X11:      pkg install x11-repo

Report issues at https://termux.com/issues

bash:5.0][u0_a133]@~:$ ll
total 60K
drwx------ 12 u0_a133 u0_a133 3.5K Aug 26 09:26 ./
drwx------  4 u0_a133 u0_a133 3.5K Aug 20 23:52 ../
-rw-------  1 u0_a133 u0_a133  235 Aug 21 01:03 .bash_aliases
-rw-------  1 u0_a133 u0_a133 5.6K Aug 26 09:26 .bash_history
-rw-------  1 u0_a133 u0_a133  276 Aug 26 00:26 .bash_logout
-rw-------  1 u0_a133 u0_a133 5.3K Aug 26 00:22 .bashrc
drwx------  3 u0_a133 u0_a133 3.5K Aug 21 01:05 .config/
-rw-------  1 u0_a133 u0_a133  733 Aug 26 00:18 .profile
drwx------  2 u0_a133 u0_a133 3.5K Aug 21 00:57 .ssh/
drwx------  4 u0_a133 u0_a133 3.5K Aug 26 01:21 .suroot/
drwx------  2 u0_a133 u0_a133 3.5K Aug 26 01:55 .termux/
drwx------  2 u0_a133 u0_a133 3.5K Aug 25 01:42 bin/
drwx------  3 u0_a133 u0_a133 3.5K Aug 21 01:04 kPATH/
drwx------  2 u0_a133 u0_a133 3.5K Aug 21 01:04 notes/
drwx------  2 u0_a133 u0_a133 3.5K Aug 21 00:55 storage/
drwx------  2 u0_a133 u0_a133 3.5K Aug 25 01:40 temp/
bash:5.0][u0_a133]@~:$
also use [mkdir -p] to create folders.. kPATH/bin   notes   temp   bin

note... when Termux v0.98 is installed in rooted tinker board..
.suroot folder is created in termux user home folder..
Code:
bash:5.0][u0_a133]@~:$ ll .suroot/
total 27K
drwx------  4 u0_a133 u0_a133 3.5K Aug 26 01:21 ./
drwx------ 12 u0_a133 u0_a133 3.5K Aug 26 09:26 ../
-rw-------  1 root    root     235 Aug 21 01:15 .bash_aliases
-rw-------  1 root    root    2.2K Aug 26 01:22 .bash_history
-rw-------  1 root    root     279 Aug 26 01:09 .bash_logout
-rw-------  1 root    root    5.3K Aug 26 01:00 .bashrc
drwx------  3 root    root    3.5K Aug 21 01:17 .config/
-rw-------  1 root    root     733 Aug 26 00:59 .profile
drwxr-xr-x  2 root    root    3.5K Aug 26 00:58 bin/
bash:5.0][u0_a133]@~:$

you will need to use sudo to access file in .suroot folder..
Code:
bash:5.0][u0_a133]@~:$ cat .suroot/.bash_aliases
cat: .suroot/.bash_aliases: Permission denied
bash:5.0][u0_a133]@~:$ sudo cat .suroot/.bash_aliases
### aliases file....
#
#
### DIRS ###
#alias d="cd ~/storage/downloads"
#alias gh="cd ~/GitHub"
#alias h="cd ~"
#alias t="cd ~/temp"
alias ..='cd ..'
alias ,,='cd -'
alias lla='ls -AFlh'
alias lld='ls -lah -d */'
#
alias cls='clear'
#
bash:5.0][u0_a133]@~:$

use tsu to open termux root bash shell...
Code:
bash:5.0][u0_a133]@~:$ tsu
bash:5.0][root]@/data/data/com.termux/files/home:# cd
bash:5.0][root]@~:# id
uid=0(root) gid=0(root) groups=0(root)
bash:5.0][root]@~:# ll
total 27K
drwx------  4 u0_a133 u0_a133 3.5K Aug 26 01:21 ./
drwx------ 12 u0_a133 u0_a133 3.5K Aug 26 09:26 ../
-rw-------  1 root    root     235 Aug 21 01:15 .bash_aliases
-rw-------  1 root    root    2.2K Aug 26 01:22 .bash_history
-rw-------  1 root    root     279 Aug 26 01:09 .bash_logout
-rw-------  1 root    root    5.3K Aug 26 01:00 .bashrc
drwx------  3 root    root    3.5K Aug 21 01:17 .config/
-rw-------  1 root    root     733 Aug 26 00:59 .profile
drwxr-xr-x  2 root    root    3.5K Aug 26 00:58 bin/
bash:5.0][root]@~:# exit
exit
bash:5.0][u0_a133]@~:$

use su to open Android root mksh shell..
Code:
bash:5.0][u0_a133]@~:$ su
rk3288:/data/data/com.termux/files/home # cd
rk3288:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
rk3288:/ # ll
total 2.2M
drwxrwxrwt  18 root   root   1.2K 2013-01-18 08:50 ./
drwxrwxrwt  18 root   root   1.2K 2013-01-18 08:50 ../
dr-xr-xr-x  65 root   root      0 2013-01-18 08:50 acct/
lrwxrwxrwx   1 root   root     50 1970-01-01 01:00 bugreports -> /data/user_de/0/com.android.shell/files/bugreports@
drwxrwx---   7 system cache  4.0K 2013-01-18 08:50 cache/
lrwxrwxrwx   1 root   root     13 1970-01-01 01:00 charger -> /sbin/healthd@
drwxr-xr-x   4 root   root      0 1970-01-01 01:00 config/
lrwxrwxrwx   1 root   root     17 1970-01-01 01:00 d -> /sys/kernel/debug@
drwxrwx--x  40 system system 4.0K 2020-08-26 12:59 data/
-rw-r--r--   1 root   root    998 1970-01-01 01:00 default.prop
drwxr-xr-x  18 root   root   1.7K 2013-01-18 08:50 dev/
-rw-r--r--   1 root   root   135K 1970-01-01 01:00 drmboot.ko
lrwxrwxrwx   1 root   root     11 1970-01-01 01:00 etc -> /system/etc@
-rw-r--r--   1 root   root    98K 1970-01-01 01:00 file_contexts.bin
lrwxrwxrwx   1 root   root     35 2013-01-18 08:50 fstab.rk30board -> /fstab.rk30board.bootmode.sd.rk3288@
-rw-r-----   1 root   root   3.1K 1970-01-01 01:00 fstab.rk30board.bootmode.emmc
-rw-r-----   1 root   root   2.2K 1970-01-01 01:00 fstab.rk30board.bootmode.emmc.rk3288
-rw-r-----   1 root   root   2.2K 1970-01-01 01:00 fstab.rk30board.bootmode.emmc.rk3288w
-rw-r-----   1 root   root   3.1K 1970-01-01 01:00 fstab.rk30board.bootmode.sd
-rw-r-----   1 root   root   2.1K 1970-01-01 01:00 fstab.rk30board.bootmode.sd.rk3288
-rw-r-----   1 root   root   2.1K 1970-01-01 01:00 fstab.rk30board.bootmode.sd.rk3288w
-rw-r-----   1 root   root   3.1K 1970-01-01 01:00 fstab.rk30board.bootmode.unknown
-rw-r-----   1 root   root   2.0K 1970-01-01 01:00 fstab.rk30board.bootmode.unknown.rk3288
-rw-r-----   1 root   root   2.0K 1970-01-01 01:00 fstab.rk30board.bootmode.unknown.rk3288w
-rwxr-x---   1 root   root   804K 1970-01-01 01:00 init*
-rwxr-x---   1 root   root    188 1970-01-01 01:00 init.asus.rc*
-rwxr-x---   1 root   root   5.8K 1970-01-01 01:00 init.connectivity.rc*
-rwxr-x---   1 root   root    887 1970-01-01 01:00 init.environ.rc*
-rwxr-x---   1 root   root     89 1970-01-01 01:00 init.optee.rc*
-rwxr-x---   1 root   root    27K 2013-01-18 08:50 init.rc*
-rwxr-x---   1 root   root    556 1970-01-01 01:00 init.rk30board.bootmode.emmc.rc*
-rwxr-x---   1 root   root    556 1970-01-01 01:00 init.rk30board.bootmode.nvme.rc*
-rwxr-x---   1 root   root    556 1970-01-01 01:00 init.rk30board.bootmode.sd.rc*
-rwxr-x---   1 root   root    453 1970-01-01 01:00 init.rk30board.bootmode.unknown.rc*
-rwxr-x---   1 root   root     44 1970-01-01 01:00 init.rk30board.environment.rc*
-rwxr-x---   1 root   root    11K 1970-01-01 01:00 init.rk30board.rc*
-rwxr-x---   1 root   root   3.5K 1970-01-01 01:00 init.rk30board.usb.rc*
-rwxr-x---   1 root   root   1.2K 1970-01-01 01:00 init.rk3288.rc*
-rwxr-x---   1 root   root   6.7K 1970-01-01 01:00 init.rockchip.rc*
-rwxr-x---   1 root   root   9.0K 1970-01-01 01:00 init.usb.configfs.rc*
-rwxr-x---   1 root   root   5.5K 1970-01-01 01:00 init.usb.rc*
-rwxr-x---   1 root   root    411 1970-01-01 01:00 init.zygote32.rc*
drwxr-xr-x   5 root   root   4.0K 2020-08-22 04:14 metadata/
drwxr-xr-x  11 root   system  240 2013-01-18 08:50 mnt/
drwxr-xr-x   2 root   root     40 1970-01-01 01:00 oem/
dr-xr-xr-x 227 root   root      0 1970-01-01 01:00 proc/
-rw-r--r--   1 root   root   4.8K 1970-01-01 01:00 property_contexts
drwxr-xr-x   3 root   root     60 1970-01-01 01:00 res/
-rw-r--r--   1 root   root   145K 1970-01-01 01:00 rk30xxnand_ko.ko
drwxr-x---   2 root   root    140 2013-01-18 08:50 root/
drwxr-xr-x   3 root   root    300 2013-01-18 08:50 sbin/
lrwxrwxrwx   1 root   root     21 1970-01-01 01:00 sdcard -> /storage/self/primary@
-rw-r--r--   1 root   root    758 1970-01-01 01:00 seapp_contexts
-rw-r--r--   1 root   root     68 1970-01-01 01:00 selinux_version
-rw-r--r--   1 root   root   870K 2013-01-18 08:50 sepolicy
-rw-r--r--   1 root   root    11K 1970-01-01 01:00 service_contexts
drwxr-xr-x   5 root   root    100 2013-01-18 08:50 storage/
dr-xr-xr-x  13 root   root      0 2013-01-18 08:50 sys/
drwxr-xr-x  16 root   root   4.0K 1970-01-01 01:00 system/
-rw-r--r--   1 root   root   4.7K 1970-01-01 01:00 ueventd.rc
-rw-r--r--   1 root   root    32K 1970-01-01 01:00 ueventd.rk30board.rc
drwxr-xr-x   6 root   root   4.0K 1970-01-01 01:00 vendor/
rk3288:/ #

show termux Bash environment variables with > id & env
Code:
bash:5.0][u0_a133]@~:$ id
uid=10133(u0_a133) gid=10133(u0_a133) groups=10133(u0_a133),3003(inet),9997(everybody),50133(all_a133)
bash:5.0][u0_a133]@~:$ env
SHELL=/data/data/com.termux/files/usr/bin/bash
PREFIX=/data/data/com.termux/files/usr
PWD=/data/data/com.termux/files/home
LOGNAME=u0_a133
LOGDIR=/data/data/com.termux/files/usr/var/log
EXTERNAL_STORAGE=/sdcard
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
HOME=/data/data/com.termux/files/home
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36::ow=30;42
SVDIR=/data/data/com.termux/files/usr/var/service
TMPDIR=/data/data/com.termux/files/usr/tmp
SSH_CONNECTION=192.168.0.18 50540 192.168.0.21 8022
ANDROID_DATA=/data
TERM=xterm-256color
USER=u0_a133
SHLVL=1
ANDROID_ROOT=/system
BOOTCLASSPATH=/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache-xml.jar:/system/framework/org.apache.http.legacy.boot.jar
SSH_CLIENT=192.168.0.18 50540 8022
PATH=/data/data/com.termux/files/home/bin:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
SSH_TTY=/dev/pts/1
_=/data/data/com.termux/files/usr/bin/env
bash:5.0][u0_a133]@~:$ tsu
bash:5.0][root]@/data/data/com.termux/files/home:# cd
bash:5.0][root]@~:# pwd
/data/data/com.termux/files/home/.suroot
bash:5.0][root]@~:# id
uid=0(root) gid=0(root) groups=0(root)
bash:5.0][root]@~:# exit
exit
bash:5.0][u0_a133]@~:$ id
uid=10133(u0_a133) gid=10133(u0_a133) groups=10133(u0_a133),3003(inet),9997(everybody),50133(all_a133)
bash:5.0][u0_a133]@~:$

lots of fun .. ;-]... to follow....
------------------
hope it helps
k,

next>.. Android Termux Development Environment... see post[X]
next>.. debian-on-Termux  via debootstrap & proot working on TinkerOS_Android 7 Nougat V14.4.0.5... see post[X]
next>.. GPIO & Tinker Board Device Tree & interfacing with SPI / I2C / UART.. see post[X]
next>.. making a live compressed Backup image / snapshot of SD Card in tinker Board... see post[X]
next>.. Node-RED in debian-on-Termux via debootstrap & proot working on TinkerOS_Android 7 Nougat V14.4.0.5... see post[X]
next>.. Update Node.Js to Latest LTS Version: XX.XX.X & Secure Node-Red... see post[X]
next>.. Google Assistant & Home with Tinker Board... see post[X]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)