Tools:
https://github.com/patrickfav/uber-apk-signer
https://github.com/iBotPeaches/Apktool
How:
apktool d app-release.apk -o extracted_apk| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| package com.example.myapplication | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.getValue | |
| import androidx.compose.runtime.mutableStateOf | |
| import androidx.compose.runtime.remember | |
| import androidx.compose.runtime.setValue | |
| import androidx.compose.ui.ExperimentalComposeUiApi | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.modifier.modifierLocalConsumer |
| #!/usr/bin/env kotlin -language-version 1.9 | |
| // Make sure you run "brew install kotlin graphviz" first. | |
| @file:Repository("https://repo.maven.apache.org/maven2/") | |
| @file:Repository("https://dl.google.com/dl/android/maven2/") | |
| @file:DependsOn("com.squareup.leakcanary:shark-android:3.0-alpha-8") | |
| @file:DependsOn("androidx.collection:collection-jvm:1.4.0") | |
| import androidx.collection.IntList |
| class MainActivity : ComponentActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| WindowCompat.setDecorFitsSystemWindows(window, false) | |
| super.onCreate(savedInstanceState) | |
| setContent { | |
| P2RTheme { | |
| // A surface container using the 'background' color from the theme | |
| Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { | |
| CompositionLocalProvider( | |
| LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance |
| # To measure lauch time | |
| fun launchTime(){ | |
| # Config | |
| LAUNCH_COUNT=10 | |
| REGEX='TotalTime: (\d+)' | |
| # The two params are configurable via argument | |
| DEFAULT_PACKAGE_NAME='com.your.packagename' |
| # brew install figlet cowsay lolcat coreutils fortune | |
| echo "Justin" | figlet -f starwars | lolcat --animate -s 1000 | |
| fortune -s | cowsay -f $(cd /opt/homebrew/Cellar/cowsay/3.04_1/share/cows && ls *.cow | shuf -n1) | lolcat --animate -s 1000 |
| @Composable | |
| fun CustomWebView(modifier: Modifier = Modifier, | |
| url:String, | |
| onBack: (webView:WebView?) -> Unit, | |
| onProgressChange: (progress:Int)->Unit = {}, | |
| initSettings: (webSettings:WebSettings?) -> Unit = {}, | |
| onReceivedError: (error: WebResourceError?) -> Unit = {}){ | |
| val webViewChromeClient = object:WebChromeClient(){ | |
| override fun onProgressChanged(view: WebView?, newProgress: Int) { | |
| //回调网页内容加载进度 |
| @Composable | |
| fun FlowRow( | |
| horizontalGap: Dp = 0.dp, | |
| verticalGap: Dp = 0.dp, | |
| alignment: Alignment.Horizontal = Alignment.Start, | |
| content: @Composable () -> Unit, | |
| ) = Layout(content = content) { measurables, constraints -> | |
| val horizontalGapPx = horizontalGap.toPx().roundToInt() | |
| val verticalGapPx = verticalGap.toPx().roundToInt() |
| ffmpeg -ss $INPUT_START_TIME -t $LENGTH -i $INPUT_FILENAME \ | |
| -vf "fps=$OUTPUT_FPS,scale=$OUTPUT_WIDTH:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
| -loop $NUMBER_OF_LOOPS $OUTPUT_FILENAME | |
| # Change these placeholders: | |
| # * $INPUT_START_TIME - number of seconds in the input video to start from. | |
| # * $LENGTH - number of seconds to convert from the input video. | |
| # * $INPUT_FILENAME - path to the input video. | |
| # * $OUTPUT_FPS - ouput frames per second. Start with `10`. | |
| # * $OUTPUT_WIDTH - output width in pixels. Aspect ratio is maintained. |
Tools:
https://github.com/patrickfav/uber-apk-signer
https://github.com/iBotPeaches/Apktool
How:
apktool d app-release.apk -o extracted_apk