我下载并安装了一个 Android 应用程序,我还提取了 APK,
有什么方法可以从 apk 文件中知道用什么编程语言来编写程序?
是否有任何工具可以帮助解决这个问题?
哪些语言可以确定,哪些不能?
下面是原始的Delphi源代码TNetEncoding.GetBase64Encoding.但我怀疑是否会出现内存泄漏AtomicCmpExchange(Pointer(FBase64Encoding), Pointer(LEncoding), nil) <> nil
TNetEncoding = class
private
class var
FBase64Encoding: TNetEncoding;
Run Code Online (Sandbox Code Playgroud)
同
class function TNetEncoding.GetBase64Encoding: TNetEncoding;
var
LEncoding: TBase64Encoding;
begin
if FBase64Encoding = nil then
begin
LEncoding := TBase64Encoding.Create;
if AtomicCmpExchange(Pointer(FBase64Encoding), Pointer(LEncoding), nil) <> nil then
LEncoding.Free;
{$IFDEF AUTOREFCOUNT}
FBase64Encoding.__ObjAddRef;
{$ENDIF AUTOREFCOUNT}
end;
Result := FBase64Encoding;
end;
Run Code Online (Sandbox Code Playgroud)
我认为必须写成:
class function TNetEncoding.GetBase64Encoding: TNetEncoding;
var
LEncoding: TBase64Encoding;
begin
if FBase64Encoding = nil then
begin
LEncoding := TBase64Encoding.Create;
if AtomicCmpExchange(Pointer(FBase64Encoding), Pointer(LEncoding), nil) <> nil then
LEncoding.Free
{$IFDEF AUTOREFCOUNT} …Run Code Online (Sandbox Code Playgroud) 我尝试运行此命令以列出 firebase-messaging 库的所有依赖项:
gradlew :app:dependencyInsight --configuration compile --dependency firebase-messaging
Run Code Online (Sandbox Code Playgroud)
但它返回给我:
:app:dependencyInsight 在配置“:app:compile”中找不到与给定输入匹配的依赖项
BUILD SUCCESSFUL in 0s 1 个可操作的任务:1 个执行
这是我的 build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.test.myapplication"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
}
Run Code Online (Sandbox Code Playgroud)
我做错了什么?
在system.sysutils.pas里约热内卢,他们添加了以下说明:
var intPart: String;
... IntPart.Chars[length(IntPart)] in ['1','3','5','7','9'] ...
Run Code Online (Sandbox Code Playgroud)
但是据我所知,s.Chars [xx]始终是从零开始的字符串,所以这样做IntPart.Chars[length(IntPart)] in ['1','3','5','7','9']总是会超出界限吗?
绝对不能写
... IntPart.Chars[length(IntPart)-1] in ['1','3','5','7','9'] ...
Run Code Online (Sandbox Code Playgroud)
还是我想念什么?
我通过mWindowManager.addview(). 现在我想知道是否有可能获得window实例。他们是myView.getWindowID(),myView.getWindowToken()但我找不到从中检索窗口实例的方法
在Delphi的源代码中,我在FMX.Forms单元中看到了这样的内容:
procedure TCommonCustomForm.SetHovered(const Value: IControl);
begin
if (Value <> FHovered) then
begin
....
end;
end;
Run Code Online (Sandbox Code Playgroud)
我认为这样做Value <> FHovered 从根本上来说是错误的,因为Value <> FHovered可以返回 true 并且同时两者都Value可以FHovered指向同一个TControl对象。我错了吗?(注意这是我在调试中看到的)。
现在有一个附属问题:为什么两个IControl接口可以不同(从指针的角度来看)但指向相同TControl?
注意:下面的示例显示 2 如何IControl不同(从指针视图)但仍然指向同一个对象:
procedure TForm.Button1Click(Sender: TObject);
var LFrame: Tframe;
Lcontrol: Tcontrol;
LIcontrol1: Icontrol;
LIcontrol2: Icontrol;
begin
Lframe := Tframe.Create(nil);
Lcontrol := Lframe;
LIcontrol1 := Lframe;
LIcontrol2 := Lcontrol;
if LIcontrol1 <> LIcontrol2 then
raise Exception.Create('Boom');
end;
Run Code Online (Sandbox Code Playgroud)
现在修复这个错误的好方法是什么?
当我阅读此文档时: https: //developers.google.com/android/guides/google-services-plugin他们说:
作为在 Android 应用程序中启用 Google API 或 Firebase 服务的一部分,您可能需要将 google-services 插件添加到您的 build.gradle 文件中:
Run Code Online (Sandbox Code Playgroud)dependencies { classpath 'com.google.gms:google-services:4.3.14' // ... }
然后他们还说:
添加已启用的服务所需的基本库的依赖项。此步骤要求您在 app/build.gradle 文件中应用 Google Services Gradle 插件,如下所示:apply plugin: 'com.google.gms.google-services'
所以我在android studio的最后一个版本中启动了一个空白的新android项目,并且我有根build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
}
Run Code Online (Sandbox Code Playgroud)
在 app/build.gradle 中:
plugins {
id 'com.android.application'
}
android {
namespace 'app.dependencieswalker'
compileSdk 32
defaultConfig { …Run Code Online (Sandbox Code Playgroud) android firebase google-play-services android-studio android-gradle-plugin
我需要创建一个包含一行文本的图像.但问题是,我首先需要创建上下文(CGBitmapContextCreate),要求图像的宽度和高度有可能以后计算文本的边界(通过CTLineGetImageBounds).但我想要图像的大小=文本的边界:(我该怎么办?
实际上我用
CGBitmapContextCreate
CTLineGetImageBounds
CTLineDraw
Run Code Online (Sandbox Code Playgroud)
也许可以在没有上下文的情况下调用CTLineGetImageBounds?
注意:我在delphi上,这不是一个真正的问题,因为我可以访问所有的API,我只需要函数名称
当我在智能手机上做应用程序时,我定义(例如)一个20px*20px的图标.这个图标在我的手机屏幕上看起来很棒,但不适用于大屏幕的平板电脑(如ipad pro).在这种情况下,图标看起来很小.
如果我按比例增加屏幕图标的大小,那么图标最终看起来太大了.举个例子:
有人知道设置图标/字体/等大小的好规则.根据屏幕的大小?我在delphi下(firemonkey)
我在Delphi Tokyo第 2版下,我有这个声明:
type
FIRMessagingConnectCompletion = procedure of object;
Run Code Online (Sandbox Code Playgroud)
我会将其标记为已弃用.我试着这样:
type
FIRMessagingConnectCompletion = procedure of object deprecated 'Please listen for the FIRMessagingConnectionStateChangedNotification NSNotification instead.';
Run Code Online (Sandbox Code Playgroud)
但没有错误的工作"E1030 Invalid compiler directive: 'DEPRECATED'".我错过了什么?
android ×5
delphi ×5
firemonkey ×2
ios ×2
android-view ×1
apk ×1
base64 ×1
build.gradle ×1
cgcontext ×1
encoding ×1
firebase ×1
gradle ×1
gradlew ×1
objective-c ×1
swift ×1