fooooooooooooooooool
fooooooooooooooooool
无标题
18 posts
Don't wanna be here? Send us removal request.
fooooooooooooooooool · 2 years ago
Text
Android 11 重打包对齐错误
跳转目录 1.报错信息 2.原因分析 3.重打包步骤 3.1 找到Android SDK 3.2 找到对齐工具 zipalign 3.3 使用zipalign重打包 3.3.1 对齐apk 3.3.2 确认对齐方式 3.3.3 重新手动签名 4.参考资料 1.报错信息 Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary] Failure [-124: Failed parse during installPackageLI:…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 2 years ago
Text
[Android]获取Android设备的Mac地址和IP
Mac地址获取 有线网络  /**      * Get the STB MacAddress      * https://blog.csdn.net/csdnzouqi/article/details/124316910      * @param needColon 是否需要带上冒号      * true 需要携带冒号 - 11:22:33:44:55:66      * false 不需要携带冒号 - 112233445566      */  public static String getSTBMac(boolean needColon) {      Log.d(TAG, "getSTBMac: needColon = " + needColon);      try {          String filePath =…
View On WordPress
0 notes
fooooooooooooooooool · 2 years ago
Text
[SwiftUI]Day0_Before you start
0. Reference Links: Day 0 Day0-YoutubeVideo 1. Five core skills 1.1 Swift 1.2 Swift UI Why (1) SwiftUI is easier (2) SwiftUI was built for Swift (3) works everywhere (4) is the future 1.3 working with data 1.4 networking 1.5 version control 2. extension skills 2.1 UIKit why popular/powerful/precise/proven nagetive (1) Implicitly unwrapped optionals (2) Using the @objc…
View On WordPress
0 notes
fooooooooooooooooool · 2 years ago
Text
[Swift]扩展类型下标
建议阅读时间:1分钟 0.太长不看版 subscript传入的参数只能作为常量使用,需要借助变量更新对应值。 代码样例为取出整数第n位的位数 参考代码方法1:  import Cocoa ​ extension Int {     subscript( multtable: Int) -> Int {         var no1 = 1         var temp = multtable         while temp > 0 {             no1 *= 10             temp-=1         }         return (self / no1) % 10     } } ​ print(12[0]) print(7869[1]) print(786543[2]) 参考代码方法2:  import…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 2 years ago
Text
[Swift4以上]协议合成
建议阅读时间:1分钟 参考链接 0.太长不看版 Swift 4以上使用 & 连接多个协议,比如 ProtocolA & ProtocolB Swift 3使用的是 protocol<A, B> 的形式来连接多个协议的 参考代码  import Cocoa ​ protocol Stname {     var name: String { get } } ​ protocol Stage {     var age: Int { get } } ​ struct Person: Stname, Stage {     var name: String     var age: Int } ​ func show(celebrator: Stname & Stage) {     print("\(celebrator.name) is \(celebrator.age)…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Swift3]Dictionary has no member 'removeValueForKey'
[Swift3]Dictionary has no member ‘removeValueForKey’
建议阅读时间:1分钟 0.太长不看版 移除Dictionary中某个Key-Value 对不能使用removeValueForKey() 方法1: 使用API: removeValue(forKey: Int)  var someDict:[Int:String] = [1:"One", 2:"Two", 3:"Three"]  var removedValue = someDict.removeValue(forKey: 2)  ​  print( "key = 1 的值为 \(someDict[1])" )  print( "key = 2 的值为 \(someDict[2])" )  print( "key = 3 的值为 \(someDict[3])" )  ​ 方法2: 使用API: remove(at: Dictionary<Key,…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Swift5.0]String.characters被弃用
建议阅读时间:1分钟 0.太长不看版 Swift 5.0以上,直接使用String.count获取字符串长度。  var varA  = "wwww.3cschoo.lcn"  ​  print( "\(varA), 长度为 \(varA.count)" ) 输出结果为: wwww.3cschoo.lcn, 长度为 16 1.问题现象 ‘characters’ is unavailable: Please use String directly ‘characters’ is unavailable: Please use String directly 2.分析原因 2.1 报错日志 报错日志有两句关键: ‘characters’ is unavailable: Please use String directly ‘characters’ was…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Swift]let字符串字面量不能修改
建议阅读时长:1分钟 0.太长不看版 需要变更的字符串,���var定义;不需要变更的字符串常量可用let定义。 需要变更的字符串,用var定义 1.报错信息 error: TestMacOSPlayground.playground:11:9: error: left side of mutating operator isn’t mutable: ‘stringB’ is a ‘let’ constant left side of mutating operator isn’t mutable 2.分析 报错提示中有:change 'let' to 'var' to make it mutable 后续要使用字符串操作,因此需要将字符串定义为变量。let是用于定义常量的,因此后续不可修改。 3.修改let为var 修改let为var
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Swift3]C-style for statement has been removed in Swift 3
[Swift3]C-style for statement has been removed in Swift 3
建议阅读时间:1分钟 0.太长不看版 Swift3使用for-in结构来写for循环 需要使用index下标的结构  for index in list.indices {    //循环体 } 实例:  var someInts:[Int] = [10, 20, 30] ​ for index in someInts.indices {    print( "索引 [\(index)] 对应的值为 \(someInts[index])") } 1.问题现象 C-style for statement has been removed in Swift 3 2.分析原因 根据问题英文报错,Swift 3不支持类似C结构的声明局部变量来更新index的操作 3.解决: Swift3只能使用for in结构
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
20221110_[XCode]Playground-Swift: No such module ‘Cocoa’
20221110_[XCode]Playground-Swift: No such module ‘Cocoa’
建议阅读时间:1分钟 0.太长不看版 注意⚠️:需要选择macOS创建playground,才可以import Cocoa XCode版本:13.3 选择macOS创建playground 1.报错提示 No such module ‘Cocoa’ No such module ‘Cocoa’ 2.分析原因 iOS使用的是UIKit包,macOS使用的是Cocoa包 创建项目时默认为iOS,因此不可以在iOS的playground内import Cocoa 3.解决方法 3.1 New Playground File->New->Playground... File->New->Playground… 3.2 选择macOS 选择macOS 选择macOS 3.3 默认选Blank 默认Blank->Next 默认Blank->Next 3.4…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
20221109_node.js&electron: asar安装失败
20221109_node.js&electron: asar安装失败
建议阅读时间:1分钟 0.太长不看版 输入如下命令来安装asar  sudo npm install -g asar 1.报错截图: npm install -g asar报错 npm install -g asar报错 2.分析 相关信息为: permission denied permission denied you do not have the permissions It is likely you do not have the permissions to access this file as the current user 3.解决问题 使用sudo npm install -g asar命令,sudo获取更高权限 sudo npm install -g asar
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Android]Error initializing ADB
1.问题现象:Error initializing ADB 在Android Studio侧边栏Device File Explorer中看到如下提示报错—— Error initializing ADB 2.解决问题步骤 问题大概翻译为:adb server启动异常,进程没能超时后终止 则查看adb相关的进程,强行终止已关闭的进程 2.1 尝试adb kill-server adb kill-server 输入后发现持续无响应,输入Control(⌃) + C终止:如图所示,输入后显示为⌃C 2.2 sudo lsof -i :5037 输入查看adb相关进程的命令sudo lsof -i :5037 sudo lsof -i…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Notepad--]Mac系统深色模式正常使用配置
[Notepad–]Mac系统深色模式正常使用配置
使用的安装包:Notepad–v1.16.2-mac_x64_12.3 v1.16.2版本的NotePad–, Mac系统打开深色模式时看不清日志字体内容(深色模式影响) 1.主题修改 默认: 黄色: 仅改变应用背景色,没有修改字体的选项 2.关闭深色模式 2.1 打开->系统偏好设置 点击通用 2.3 检查通用,发现为深色模式 发现关闭深色模式时能正常显示 3.不希望为了单独的app每次修改深色模式 参考资料:如何在 macOS 为特定应用程序关闭黑暗模式 3.1 打开终端 3.1.1 方法1: 找图标 找到对应的图标,鼠标放在上面会有终端文字显示 3.1.2 方法2: 打开Finder(访达) (1)同3.1.1类似,找到Finder(访达)的图标 点开后,找到菜单栏前往->实用工具 如果快捷键Shift(⇧) + Command(⌘) +…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[Android][Mac]Mac系统为apk打包记录
app上架/转移时需要对应用商店apk进行签名,“打空包”,线上教程一般为windows版本,故记录使用Mac系统打包apk过程 0.太长不看: 命令如下: jarsigner -verbose -keystore .keystore文件完整路径+名称 -signedjar 目标apk路径+名称 源文件apk路径+名称 keystore文件别名 1.测试jarsigner命令是否可用 如下输出为可用 2.相关错误记录 2.1 jarsigner: 找不到密钥别名的证书链。 jarsigner:…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
【Android】RecyclerView数据刷新
[太长不看] 使用notifyItemRangeChanged()方法刷新数据,保持焦点 [问题现象] RecyclerView刷新数据后焦点乱跳 [问题分析] 找到刷新数据位置,查到刷新时使用notifyDataSetChanged()方法刷新View,导致页面焦点重置,出现焦点乱跳 [源码资料] 方法1: notifyItemRangeChanged() public final void notifyItemRangeChanged(int positionStart, int itemCount)  /** Notify any registered observers that the itemCount items starting at position positionStart have changed. Equivalent to calling…
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
【软件】SecureCRT Mac-破解版 安装、破解、配置
1.查看系统设置 (1.1)左上角苹果图标->系统偏好设置 系统偏好设置 (1.2)找到 安全性与隐私 安全性与隐私 (1.3) 确认 通用 -> 允许从以下位置下载,选择了任何来源 下载 2.根据以下链接下载 下载链接 下载链接 密码 CRTMAC 3.安装 (3.1)下载后,会看到如下文件 dmg文件 (3.2)双击,打开内容如图 安装包内容 (3.3)双击打开激活步骤.rtf文件,按照内部要求进行安装、破解 4.破解(补充) (4.1)拖动安装SecureCRT后,双击SecureCRT图标 (找不到的可在启动台or 快捷键Command + 空格全局搜索) (4.2)会看到如下对话窗,点Close 提示激活 (4.3)激活步骤二、2 回到电脑桌面,然后同时按下「command + shift +…
Tumblr media
View On WordPress
0 notes
fooooooooooooooooool · 3 years ago
Text
[error合集]20220328_112003-ndk error
问题 1.No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi 2.找到 Project Structure 3.找到 Android NDK location 4.发现有本地ndk,不需要另外下载(接4-10),没有的情况见解决方案&参考链接 5.选择默认(二选一尝试) 6.发现无法设置 7.根据提示打开路径,确实没有Platforms文件夹 8.点... ,选中 9.确认该文件夹有所需要的platforms文件夹 10.apply->ok 11.完成配置 解决方案 1.ndk下载地址 [Android…
Tumblr media
View On WordPress
0 notes