Posts

Showing posts with the label Android

Stop using third party packages that has many dependencies that the author didn't have a check before they use

33. "remove every backend project that uses node third party packages, they might has backdoor that could use your VPS as their VPS to act like a general web client for hackers"   it is even worse if you use npm in root VPS, because the npm will always use new version of a package or sub_package, how can you make sure your 3000 dependencies will not have a virus that could use your VPS root permission to do bad things?   it is the same for other package manager, for example, python pip. or golang package, java package, rust package, flutter package. in chinese, people usally call those machine that has those software running 'rou ji'. """ 利用 package manager 自动更新新版本的特性,做远控 轻而易举 就算不更新,利用现有的package,二进制文件或者脚本 一个post发到黑客服务器,它就知道你的电脑能不能被控制 对于root设备,被控制就是被完全控制,对于普通设备,就是被当成hacker web 客户端,可以被拿来在网上发垃圾信息、垃圾账号注册 到时候你的ip就会被当成坏ip被服务器墙掉 """

New android system is garbage!

Android14 can't disable app network. New android 12 and above, also can't continuesly connect to a LAN wifi that does not have outside network. So don't use new android system. Android 5 to 7 is the best.

How to download lineage 16 adb sideload package?

Lineage 16 download place: https://archive.org/download/lineage-16.0-20200325-nightly-beryllium-signed

Does Android and MacOS created by microsoft secretly?

I recently face a problem from Android system. Syncthing can't sync 'two files with same name but have different case' between Linux and Android. It seems like the Android is working just like Windows system. They do not distinguish `~/Download/HI.png` and `~/Download/hi.png`. Both android and windows will think `~/Download/HI.png` and `~/Download/hi.png` as the same file. Which is not right, which means their storage system is case-insensitive. But for general Linux system, it is fine, linux storage are case-sensitive. Does this mean the android enginner secrectly come from microsoft? I don't know. #android #storage #bug #yingshaoxo

How to let LinuxDeploy desktop audio input and output work

Install LinuxDeploy apk; Install busybox apk, install busybox payloads, reboot your phone https://github.com/meefik/linuxdeploy/releases/tag/2.6.0 https://github.com/meefik/busybox/releases/tag/1.34.1 Select Ubuntu, bionic, File, image size 60GB, set username and password, enable ssh, enable vnc gui, select xfce. Hit the install button, hit the configure button, hit the start button. Install “termux” apk, install “com.termux.api” apk https://github.com/termux/termux-app/releases/tag/v0.118.0 https://github.com/termux/termux-api/releases/tag/v0.50.1 In termux pkg update pkg install pulseaudio pkg install termux-api termux-microphone-record -l 3 pulseaudio --start --exit-idle-time=-1 pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 pacmd load-module module-sles-source pactl load-module module-sles-source In LinuxDeploy system, add “export PULSE_SERVER=127.0.0.1” to the end of “/etc/profile”, do a reboot Use fakestandby apk to make sure the netw...

How to install new system for your android phone with the help of TWRP

unlock bootloader  fastboot oem unlock or fastboot flashing unlock get into the recovery mode by pressing buttons Power key + Volume Up key get into the recovery mode by running a command adb reboot recovery or fastboot reboot recovery get into the bootloader by pressing buttons Power key + Volume Down key get into the bootloader by running a command in recovery mode, or other case that have ADB support adb reboot bootloader boot into the twrp fastboot boot twrp.img flash twrp to recovery partion fastboot flash recovery twrp.img force twrp to be in the top when boot Install -> Flash img -> Flash to boot partion just install a new system Install -> Flash zip -> a_system.zip install a system by using ADB sideload tech adb sideload a_system.zip adb sideload can be used in some third party recovery img directly install some third party package Put it into phone’s storage, then use twrp to install them Install tips: Upgrading from earlier versi...

Kotlin: How to override a class, then pass it to a function as an anonymous function argument

```kotlin val commonDestureDetector = GestureDetector( this, object : GestureDetector.OnGestureListener { // 1. 用户轻触触摸屏 override fun onDown (e: MotionEvent): Boolean { Log.i( "MyGesture" , "onDown" ) return false } // 2. 用户轻触触摸屏,尚未松开或拖动 // 与onDown()的区别:无松开 / 拖动 // 即:当用户点击的时,onDown()就会执行,在按下的瞬间没有松开 / 拖动时onShowPress就会执行 override fun onShowPress (e: MotionEvent) { Log.i( "MyGesture" , "onShowPress" ) } // 3. 用户长按触摸屏 override fun onLongPress (e: MotionEvent) { Log.i( "MyGesture" , "onLongPress" ) } // 4. 用户轻击屏幕后抬起 override fun onSingleTapUp (e: MotionEvent): Boolean { Log.i( "MyGesture" , "onSingleTapUp" ) return true } // 5. 用户按下触摸屏 & 拖动 override fun onScroll ( e1: MotionEvent , e2: MotionEvent , distanceX: Float , distanceY: Float ): Boolean { Log.i( "MyGesture...

How to use Golang to make a flutter plugin

1. compile golang codes into a aar file https://yingshaoxo.gitbook.io/go-tutorial-for-pythoner/go-for-android 2. create a flutter plugin https://flutter.dev/docs/development/packages-and-plugins/developing-packages#step-1-create-the-package-1 3. use the aar file https://stackoverflow.com/a/57075972/8667243 Congratulations  You have a common code base for windows, android, IOS now. More info: https://github.com/yingshaoxo/flutter-discoverpingableserviceonlocalnetwork ​

How to use Java bindings of OpenCV with Android Studio and Gradle

The source https://github.com/bytedeco/javacpp-presets Why I write this Beacuse they didn’t make it clear about how can I use their libs. I spent 6 hours to figure out how can I simply import it. The Code defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.god_loves_you" minSdkVersion 16 targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true //ADD THIS LINE } packagingOptions { exclude('META-INF/native-image/android-x86_64/jnijavacpp/jni-config.json') exclude('META-INF/native-image/android-x86_64/jnijavacpp/reflect-config.json') exclude('META-INF/native-image/android-arm64/jnijavacpp/jni-config.json') exclude('META-INF/native-image/android-arm64/jnijavacpp/reflect-config.json')...

Flutter and Pigeon tutorial

install https://pub.dev/packages/pigeon#flutter-calling-into-android-steps write import 'package:pigeon/pigeon_lib.dart' ; class SearchRequest { String keyword; } class SearchReply { String result; } //@HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi') @HostApi () abstract class FileManagerApi { SearchReply search(SearchRequest request); } void configurePigeon(PigeonOptions opts) { opts.dartOut = 'lib/messages.dart' ; opts.objcHeaderOut = 'ios/Runner/messages.h' ; opts.objcSourceOut = 'ios/Runner/messages.m' ; opts.objcOptions.prefix = 'FLT' ; opts.javaOut = 'android/app/src/main/java/io/flutter/plugins/filemanager/Messages.java' ; opts.javaOptions.package = 'io.flutter.plugins.filemanager' ; } compile flutter pub run pigeon --input pigeons/messages.dart java side import androidx.annotation.NonNull; import io.flutter.embedding.android.FlutterActivity; import io...

Solve the problem of android automatic-brightness shaking with Automate

Image

How to run android app at Linux with Anbox

1. install anbox sudo snap install --devmode --beta anbox 2. start app manager anbox.appmgr 3. download an apk https://apkpure.com 4. install that app adb install **.apk 5. enjoy

How to use docker to build kivy to android app

0. Example App git clone https://github.com/yingshaoxo/kivy-diary.git cd kivy-diary 1. Prepare your SDK Use Android Studio SDK Manager to install it. Here I installed SDK 29 and NDK 21. 2. Pull p4a to local docker pull kivy/python-for-android 3. Run it (you need to change the first SDK path) docker run -it --name kivy --volume " $(pwd) " :/home/user/host/app --volume /home/yingshaoxo/Android/Sdk:/home/user/host/Android/Sdk kivy/python-for-android 4. Active the virtual env source venv/bin/activate && cd ../host/app 5. Build it use ./build.sh or export ANDROIDSDK="/home/user/host/Android/Sdk" export ANDROIDNDK="/home/user/host/Android/Sdk/ndk/21.0.6113669" export ANDROIDAPI="29" # Target API version of your application export NDKAPI="21" # Minimum supported API version of your application p4a apk --private . --package=xyz.yingshaoxo.kivydiary --name "KivyDiary" --version 0.2 --bootstrap=sdl...